OpenMP library linking problem

#1

Hello, I realized the psi4 I’ve been using has openmp library set up in a questionable way, and I’m wondering how I should do it correctly.

Symptoms 1: (gcc, ubuntu, psi4_1.3.1stable):
a). Psi4 is linked to both gomp and iomp5 (as shown in objdir/psi4-core-prefix/src/psi4-core-build/src/CMakeFiles/core.dir/link.txt. i.e. at the bottom, it shows
-lmkl_rt /home/rain/miniconda3/envs/p4dev_20190425/lib/libiomp5.so -Wl,–as-needed /home/rain/miniconda3/envs/p4dev_20190425/x86_64-conda_cos6-linux-gnu/sysroot/lib/libgomp.so -lpthread /home/rain/miniconda3/envs/p4dev_20190425/lib/libhdf5.so /usr/lib/x86_64-linux-gnu/librt.so -lpthread /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/x86_64-linux-gnu/libdl.so -lm)
b). v2rdm_casscf plugin is linked to both gomp and iomp5

Symptoms 2: (intel, ubuntu, psi4 from March 8):
a) Psi4 is linked to iomp5 only (as gomp does not appear in objdir/psi4-core-prefix/src/psi4-core-build/src/CMakeFiles/core.dir/link.txt)
b) plugin has cmake problem because when I use find_package(TargetLAPACK):
Cannot generate a safe runtime search path for target v2rdm_casscf_private
because files in some directories may conflict with libraries in implicit
directories:
runtime library [libiomp5.so] in /my/intel/compiler/lib/intel64_lin may be hidden by files in:
/my/conda/envs/p4dev/lib
Some of these libraries may not be found correctly.

What I did:
Download source files and installed with the conda dependencies I just downloaded. Activate conda while compiling psi4 and the plugin. Use psi4-path-advisor and psi4 --plugin-compile’ for compiling. I also tried the following on the cmake line when compiling psi4, didn’t help with the double linking.
-DLAPACK_LIBRARIES="${CONDA_PREFIX}/lib/libmkl_rt.so"
-DLAPACK_INCLUDE_DIRS="${CONDA_PREFIX}/include"
-DOpenMP_LIBRARY_DIRS="${CONDA_PREFIX}/lib" \

#2

symptoms 1 sounds bad to have both gomp and iomp5. symptoms 2 is just a warning and is safe to ignore.

#3

Thanks! But I thought conda p4dev dependencies and psi4-path-advisor should take care of symptom 1 already. How should I fix it?

#4

judge by ldd -v, not link.txt