Psi4 runtime Python failure

Hi everyone,

I am building Psi4 in a cluster environment using modules to import the necessary compilers/libraries. I compiled and linked with gcc 5.4.0 without problems. However, tests fail with:

E   ImportError: /global/software/sl-7.x86_64/modules/langs/python/2.7/bin/../lib/ version `CXXABI_1.3.8'     not found (required by /local/scratch/users/jgonthier/psi4_trunk/obj_rel/stage/clusterfs/mhg/jgonthier/psi4_inst/lib/psi4/

The same error appears if I launch python and try “import core” from the staged directory. It’s using the wrong libstdc++ that it takes from the Python 2.7 library. The correct libstdc++ is in the gcc 5.4.0 path. However, the correct library is in my LD_LIBRARY_PATH and I also added it to my PYTHONPATH. Running


gives =>  (0x00007ffd08bdf000) => /usr/lib64/ (0x00002ac413f7f000) => /global/software/sl-7.x86_64/modules/langs/intel/2016.4.072/mkl/lib/intel64/ (0x00002ac414197000) => /usr/lib64/ (0x00002ac41478f000) => /global/software/sl-7.x86_64/modules/gcc/5.4.0/hdf5/1.8.18-gcc-s/lib/ (0x00002ac4149af000) => /usr/lib64/ (0x00002ac414eaf000) => /usr/lib64/ (0x00002ac4150b7000) => /global/software/sl-7.x86_64/modules/langs/gcc/5.4.0/lib64/ (0x00002ac4153bf000) => /global/software/sl-7.x86_64/modules/langs/gcc/5.4.0/lib64/ (0x00002ac4156e7000) => /global/software/sl-7.x86_64/modules/langs/gcc/5.4.0/lib64/ (0x00002ac415927000) => /global/software/sl-7.x86_64/modules/langs/gcc/5.4.0/lib64/ (0x00002ac415ca7000) => /global/software/sl-7.x86_64/modules/langs/gcc/5.4.0/lib64/ (0x00002ac415ecf000) => /usr/lib64/ (0x00002ac4160e7000)
    /lib64/ (0x00002ac407327000)

thus finding the correct library. Does anyone know how do I tell Python which libstdc++ to load when importing a dynamic library?

You can force the correct libs by using LD_PRELOAD
In the past I used a bash script that had this line:

LD_PRELOAD=/somewhere/gcc-4.9.4/lib64/ /psi4_install_path/bin/psi4 $@

1 Like

That was exactly what I needed. I spent some time trying to figure out which environment variable could help me and after trying a few I figured I’d use the forum’s wisdom. My problem is resolved and the tests are passing (for now at least). Thanks a lot!