image not found error while running scikits.odes
Closed this issue · 4 comments
Hi,
I am trying to use scikits.odes and managed to successfully install and run at Linux-based Hyak mox supercomputing cluster in University of Washington. Following the same protocol, I installed scikits.odes in my iMac (deleted the relevant words as found in #105). I got confirmation that it got installed properly (Successfully installed scikits.odes-2.4.1.dev0 scipy-1.3.1). However, when I try to run the simple piece of code for solving theVan der Pol oscillator, I get the following error
dlopen(/Users/chowdhury/anaconda2/envs/odes/lib/python3.6/site-packages/scikits/odes/sundials/cvode.cpython-36m-darwin.so, 2): Library not loaded: libsundials_cvode.3.dylib
Referenced from: /Users/chowdhury/anaconda2/envs/odes/lib/python3.6/site-packages/scikits/odes/sundials/cvode.cpython-36m-darwin.so
Reason: image not found
Traceback (most recent call last):
File "test.py", line 11, in
solution = ode('cvode', van_der_pol, old_api=False).solve(np.linspace(t0,500,200), y0)
File "/Users/chowdhury/anaconda2/envs/odes/lib/python3.6/site-packages/scikits/odes/ode.py", line 273, in init
integrator = find_ode_integrator(integrator_name)
File "/Users/chowdhury/anaconda2/envs/odes/lib/python3.6/site-packages/scikits/odes/ode.py", line 486, in find_ode_integrator
raise ValueError('Integrator name %s does not exist' % name)
I was wondering if you have any suggestion regarding this issue. Thanks a lot.
Error is missing sundials library:
dlopen(/Users/chowdhury/anaconda2/envs/odes/lib/python3.6/site-packages/scikits/odes/sundials/cvode.cpython-36m-darwin.so, 2):
Library not loaded: libsundials_cvode.3.dylib
Did you set the sundials install dir correctly, so var $SUNDIALS_INST
as mentioned in https://scikits-odes.readthedocs.io/en/latest/installation.html#id1 ?
Check for libsundials_cvode.3.dylib
on your PC after the sundials install, eg in /usr/local/lib
and make sure $SUNDIALS_INST
points then to the correct dir, in my example /usr/local/
Thank you for replying. I had the installation directory correctly setup, but was still having the error. I found that the error was coming from sundial installation, while using cmake I was getting the following message
CMake Warning (dev):
Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake
--help-policy CMP0042" for policy details. Use the cmake_policy command to
set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
sundials_arkode_shared
sundials_cvode_shared
sundials_cvodes_shared
sundials_ida_shared
sundials_idas_shared
sundials_kinsol_shared
sundials_nvecserial_shared
To bypass this I added the following line in CMakeList.txt file and recompile sundials
SET(CMAKE_MACOSX_RPATH 1)
After that I installed scikits.odes using the standard protocol for Mac and now it works!!! Thanks a lot!
Great you could solve it! Let's hope this write down here helps other people having issues installing sundials on Mac !
This should be fixed in general by merging LLNL/sundials#19, which also sets full RPATH.