PyMultiNest icon indicating copy to clipboard operation
PyMultiNest copied to clipboard

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

Open hposborn opened this issue 4 years ago • 2 comments

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.

hposborn avatar Apr 27 '20 17:04 hposborn

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

JohannesBuchner avatar Apr 27 '20 17:04 JohannesBuchner

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

hposborn avatar Apr 27 '20 18:04 hposborn