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

Installation guide for Mac/OS X needs to include reference to DYLD_LIBRARY_PATH #160

Open
hposborn opened this issue Apr 27, 2020 · 2 comments

Comments

@hposborn
Copy link
Contributor

hposborn commented Apr 27, 2020

I've been trying to get PyMultiNest working on my Mac all morning. I managed to successfully install PyMultiNest - first through pip and then, after the pip-installed version failed, manually through git along with normal MultiNest. This was particularly difficult because the install page suggests if you google for “MultiNest Mac OSX” or “PyMultiNest Mac OSX” you will find installation instructions but the only google results were either that exact install page, or a page from astrobetter which is unfortunately so outdated as to no longer work for newer OS X versions.

However, with either install, I could not run pymultinest for some convoluted reason that google failed to help me with. The error print out is:
File "pymultinest_demo.py", line 27, in <module> n_dims=n_params, outputfiles_basename=prefix, verbose=True) File "/Users/hosborn/python/PyMultiNest/pymultinest/solve.py", line 71, in solve run(**kwargs) File "/Users/hosborn/python/PyMultiNest/pymultinest/run.py", line 254, in run lib.run(*args_converted) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 377, in __getattr__ func = self.__getitem__(name) File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ctypes/__init__.py", line 382, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: dlsym(RTLD_DEFAULT, run): symbol not found

In testing run.py I found that libname = find_library(libname) was producing None.
Eventually I figured out that on OSX ctypes.find_library doesn't look for paths in LD_LIBRARY_PATHS (which the install page requests we update with the location of the MultiNest install), but instead only looks in DYLD_LIBRARY_PATH.

So I request that the install page include reference to that environment variable for OS X, and save other users my 3 hour rabbit-hole.

@JohannesBuchner
Copy link
Owner

Could you edit doc/install.rst so it is more helpful?

You can get it from https://raw.githubusercontent.com/JohannesBuchner/PyMultiNest/master/doc/install.rst

@hposborn
Copy link
Contributor Author

Ok, good idea. I did that and created a pull request for you. Thanks!

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