Hi Surya,
Besides the option Mark suggested, the standard method for letting a program know where its libraries are at runtime, if they are not in standard system locations, is to set the LD_LIBRARY_PATH environment variable. For example, you would run
LD_LIBRARY_PATH=/usr/local/sundials python example_diffusion.py
If you want to install Sundials into a directory that should be on the default library search path, I’d suggest using /usr/local
as the PREFIX when building Sundials (which is likely the default anyway). Then, you probably won’t even need to specify paths for it when building either Cantera or Ember.
Regards,
Ray
Hi Surya,
The settings you have for cantera
and sundials
in your ember.conf
file don’t make sense. These should be set to the directories that contain the corresponding lib
and include
directories, which in this case would just be /usr/local
. However, /usr/local
is almost certainly part of the default search path for your compiler, so you can just delete these settings from ember.conf
.
I missed from your earlier message that you are now getting an error arising from just trying to import cantera
. In this case, can you provide the output of running scons build
for Cantera, after first running scons clean
?
Regards,
Ray
Hi Surya,
Thanks for the additional details. I believe from the logs that you’re installing Sundials version 5.7.0, which is the latest version that Cantera has been tested with, so that’s a good choice. I don’t think there is a version 2.5.7.
I am confused by the error importing the Cantera Python module, though. The symbol that it’s complaining about should be defined in the “sundials_cvodes” library, which is being specified on the linker command line when the Python module is being built. The only thing I can think of is that you actually have another (older?) copy of Sundials installed somewhere, and that’s being picked up instead of Sundials 5.7. Can you provide the output of building Cantera with the command scons build debug_linker_flags=-Wl,--verbose
? I’d also be interested in the output from the following commands (after running scons install
):
ldd /usr/local/lib/python3.6/dist-packages/cantera/_cantera.cpython-36m-x86_64-linux-gnu.so
nm /usr/local/lib/libsundials_cvodes.so.5.7.0 | grep CVSpils
Lastly, can you let us know what your operating system is, e.g. the Linux distribution and version number?
Regards,
Ray
Hi Surya,
It looks like you have an old (Sundials 2.x, perhaps) installation in the system library directories. You can either uninstall that old version or do as Hasan suggests and set LD_LIBRARY_PATH before running Python, e.g.
export LD_LIBRARY_PATH=/usr/local/lib
python ...
Regards,
Ray