Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples crash depending on MatLab version #46

Open
ec2608 opened this issue Nov 13, 2023 · 16 comments
Open

Examples crash depending on MatLab version #46

ec2608 opened this issue Nov 13, 2023 · 16 comments

Comments

@ec2608
Copy link

ec2608 commented Nov 13, 2023

Hi, This may have been reported before but I couldn't find relevant info.

I get the following error at Matlab R2023a (apologies cannot install an earlier version for license related reasons).

Error using mex
/matlab-bindings/+precice/@Participant/private/preciceGateway.cpp:7:10: fatal error:
precice/Participant.hpp: No such file or directory
    7 | #include "precice/Participant.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.


Error in compile_matlab_bindings_for_precice (line 18)
mex(strcat(path_Interface,".cpp"),'CXXFLAGS="-std=c++17 -fPIC"',"-output",path_Interface,flags{:});

This is in WSL Ununtu 22.04. I installed precise using spack.
Thanks in advance

@uekerman
Copy link
Member

Which version of the Matlab bindings do you use? Seems like you use the develop version, which is only compatible with the develop version of preCICE.
Try using the latest release of the bindings.

@ec2608
Copy link
Author

ec2608 commented Nov 19, 2023

Many thanks for the reply. Is the relase version of the matlab bindings called by a different..m file or in a different github repo? Many thanks

@IshaanDesai
Copy link
Member

Many thanks for the reply. Is the relase version of the matlab bindings called by a different..m file or in a different github repo? Many thanks

The release is tagged: https://github.com/precice/matlab-bindings/releases/tag/v2.5.0.0 you can go to this release by checking out the release branch or also also simply checking out the tag. This release is compatible with preCICE v2.5.0

@ec2608
Copy link
Author

ec2608 commented Nov 20, 2023

Yes that was indeed the issue all works well with the release version of the bindings

@ec2608
Copy link
Author

ec2608 commented Nov 20, 2023

Just a minor addition. While the installation file works. I have the issue that the tutorial m file for the explicit solvers cause Matlab to crash immediately. The implicit solver examples works fine. I wonder if you have observed something like this before?

the error message is about XMLParser not being able to parse the configuration file (and then matlab immediately crashes).

@uekerman
Copy link
Member

@ec2608 Can you please give more details. Which configuration gives this error exactly?

@ec2608
Copy link
Author

ec2608 commented Nov 21, 2023

WSL2 Ubuntu 22.04- Matlab 2023a

precice installed by:
spack 2.5.0 install precice ^[email protected]

latest Matlab bindings from https://github.com/precice/matlab-bindings/releases/tag/v2.5.0.0

running Matlab with:
LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6 matlab

Happy to share more info

@uekerman
Copy link
Member

I meant the preCICE configuration. What exactly do you run?

@ec2608
Copy link
Author

ec2608 commented Nov 22, 2023

I am running the Solver_U,m or Solver_I.m file (running from matlab) within the tutorial/explicit folder. So the configuration run is the file within that folder.

@uekerman
Copy link
Member

This config file: https://github.com/precice/matlab-bindings/blob/master/tutorial/explicit/precice-config.xml ?

Are you sure you also use the file from the corresponding release?
Which error message do you get exactly?

I don't have Matlab to reproduce the problem, but your error sounds like it has nothing to do with Matlab.

@ec2608
Copy link
Author

ec2608 commented Nov 30, 2023

Yes that is the correct file.
Are you sure you also use the file from the corresponding release? yes the bindings is 2.5.0 and so is the spack installed precise version

Here is the error message:
(0) 12:02:48 [xml::XMLParser]:152 in readXmlFile: �[31mERROR: �[0mXML parser was unable to open configuration file "precice-config.xml"

@ec2608
Copy link
Author

ec2608 commented Nov 30, 2023

Further on the previous this what the terminal reports while Matlab crashes:
*** The MPI_Comm_rank() function was called after MPI_FINALIZE was invoked.
*** This is disallowed by the MPI standard.
*** Your MPI job will now abort.

@uekerman
Copy link
Member

uekerman commented Dec 1, 2023

(0) 12:02:48 [xml::XMLParser]:152 in readXmlFile: �[31mERROR: �[0mXML parser was unable to open configuration file "precice-config.xml"

This basically means that preCICE is not able to find the file. How do you call your solvers? Do you first step into the tutorial/explicit folder?

@ec2608
Copy link
Author

ec2608 commented Dec 1, 2023

I first open the matlab gui, then step in the tutorial/explicit folder and then select to run the main script, Perhaps more intriguingly I got the following word behavior when running the script in Matlab debugging line by line with the 'step' command.
I get the error when I step over this lines : preciceGateway(uint8(0),SolverName,configFileName,int32(solverProcessIndex),int32(solverProcessSize));

but the code works when I use 'step in' instead. This is more weird because Matlab can't really step in within that function so step and step in would practically be identical commands.

@ec2608
Copy link
Author

ec2608 commented Dec 8, 2023

Just a follow up on this.:
I have managed to install Matlab R2021b in WSL2 and there are no errors. I tried this with the bindings for release and the binary package (precise 2.5.0) so whatever is happening is due to the Matlab version.
In Matlab R2021b the examples work fine, they don't in 2023a or 2023b at least in my pc.

@uekerman uekerman changed the title issue during installation Examples crash depending on MatLab version Dec 13, 2023
@uekerman
Copy link
Member

Thanks for following up! Then this sounds like a more intricate problem. Let's re-open.

@uekerman uekerman reopened this Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants