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

Can't find MPI libraries #224

Closed
jenniferyee opened this issue Nov 14, 2022 · 7 comments
Closed

Can't find MPI libraries #224

jenniferyee opened this issue Nov 14, 2022 · 7 comments

Comments

@jenniferyee
Copy link

When I try to run MultiNest with MPI, I get the following error:

problem: libmpi_usempi.so.40: cannot open shared object file: No such file or d
irectory

ERROR: Could not load MultiNest library: libmpi_usempi.so.40
ERROR: You have to build MultiNest,
ERROR: and point the LD_LIBRARY_PATH environment variable to it!
ERROR: manual: http://johannesbuchner.github.com/PyMultiNest/install.html

In reviewing my install logs from make, I find that MultiNest successfully found libmpi_usempi.so (no .40), and there were no other errors.

Where in the MultiNest code does it call libmpi_usempi.so.40 and is it a problem if I just change this to libmpi_usempi.so? More generally, how to I control the paths that MultiNest uses to look for external libraries?

@JohannesBuchner
Copy link
Owner

Try rebuilding Multinest from scratch and make sure you have a MPI compiler (mpifortran). The compiler / environment used by cmake/make must be consistent with the environment you run with.

@JohannesBuchner
Copy link
Owner

the linker assigns paths, and ldd can list them.

@jenniferyee
Copy link
Author

Rebuilding from scratch didn't work. I am guessing that the error is a hard-coded bug looking for some specific version of libmpi_usempi. But I can't figure out what part of the code produces this error message. As far as I can tell, it comes from the a call to run._load_library(), but the only instances I can find that invokes this method are at Line 52 and 58, which check for 'libmultinest' and 'libmulitnest_mpi', respectively, NOT 'libmpi_usempi'.

@JohannesBuchner
Copy link
Owner

See #223 for how to rebuild (read also the readme in build/) and build verbosely.

There is no hard-coded path. You may want to read up on linkers and dynamic libraries for understanding how to interpret ldd outputs. https://www.howtoforge.com/linux-ldd-command/

@JohannesBuchner
Copy link
Owner

@jenniferyee
Copy link
Author

This was indeed a problem with the path to my fortran libraries in my linker. Because this was not a problem with the MultiNest build or path (as stated in the error message), I suggest changing the error message to something like:

ERROR: Could not load MultiNest library dependency: libmpi_usempi.so.40
ERROR: Make sure that the LD_LIBRARY_PATH environment variable
ERROR: includes the path to both MultiNest and your fortran libraries.
ERROR: Use "ldd" on libmultinest_mpi.so to check that all dependent libraries
ERROR: are properly linked.

@jenniferyee
Copy link
Author

This was, indeed, a problem with my LD_LIBRARY_PATH.

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

2 participants