Plugin with TargetLAPACK cannot find -lsvml during linking

I’m trying to compile my plugin which links to TargetLAPACK. I got linking error “cannot find -lsvml”. Can someone help me understand what’s going on? Thanks a lot!

some relevant lines in CMakeLists.txt:
find_package(TargetLAPACK)
list(APPEND LIBC_INTERJECT tgt::lapack)
target_link_libraries(v2rdm_casscf_private PRIVATE ${LIBC_INTERJECT})

My Psi4 is the nightly built developer version from conda. (1.3a2.dev342, built from something like conda install psi4 psi4-dev -c psi4/label/dev)

The bottom part of /CMakeFiles/v2rdm_casscf_private.dir/link.txt reads
-L/gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/lib -Wl,-rpath,/gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/lib/python3.7/site-packages/psi4:/gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/lib: /gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/lib/python3.7/site-packages/psi4/core.cpython-37m-x86_64-linux-gnu.so /gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/lib/libiomp5.so -Wl,–as-needed /gpfs/home/rli2/Packages/anaconda3/envs/psi4_nightly_dev/x86_64-conda_cos6-linux-gnu/sysroot/lib/libgomp.so -lpthread -lmkl_rt -Wl,-Bstatic -lsvml -Wl,-Bdynamic -lgfortran -lquadmath

What compiler are you using? This is Linux, yes? Getting the omp libraries right (consistent btwn psi4 and plugin) is very important (and tricky since you’re not controlling all parts of the build). psi4 --plugin-compile should be doing it right. The fact that libgomp is in your link line is very bad; only libiomp5 is allowed. The svml, iirc, is a Intel/MKL related library. MKL and OMP are tightly bound in the build system.

Hit something similar myself. You must have the conda env with psi4 in it active when running the cmake line from --plugin-compile w/i v2rdm repo.