CMake error during psi4-core configure step

I am attempting to build Psi4 and encounter several errors related to CMake install(EXPORT “psi4Targets” …) upon reaching psi4-core. I’m rather unfamiliar with CMake and can’t find a simple solution to this. I would really appreciate if anyone can point out where I am going wrong!

[ 32%] Built target pybind11_external
[ 36%] Installing Psi4-detected BLAS/LAPACK
– Install configuration: “Release”
[ 36%] Built target lapack_external
[ 68%] Built target libint_external
[ 72%] Performing configure step for ‘psi4-core’
loading initial cache file /u/sciteam/msalim/psi4/objdir/psi4-core-prefix/tmp/psi4-core-cache-Release.cmake
– Cray Programming Environment 2.5.4 C
– Cray Programming Environment 2.5.4 CXX
– Using LAPACK: /opt/acml/5.3.1/pgi64/lib/libacml.a;…
– Disabled HDF5
– Using pybind11: /u/sciteam/msalim/psi4/objdir/stage/usr/local/psi4/include (version 2.0.0 for Py3.5.1 and -std=c++11)
– Using Python 3.5: /sw/bw/bwpy/0.3.0/python-single/usr/bin/python3.5
– Disabled CheMPS2
– Disabled dkh
– Disabled libefp
– Disabled erd
– Disabled gdma
– Using libint 5: /u/sciteam/msalim/psi4/objdir/stage/usr/local/psi4/lib/libint.a (version 1.1.6)
– Disabled PCMSolver
CMake Warning (dev) at src/CMakeLists.txt:27 (add_library):
ADD_LIBRARY called with SHARED option but the target platform does not
support dynamic linking. Building a STATIC library instead. This may lead
to problems.
This warning is for project developers. Use -Wno-dev to suppress it.

– Psi4 rpath: $ORIGIN/…/
– Configuring done
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “dpd” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “qt” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “adc” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “ccdensity” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “ccenergy” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “cceom” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “cchbar” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “cclambda” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “ccresponse” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “cctransort” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “cctriples” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “dcft” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “detci” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “dfmp2” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “dfocc” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “efp_interface” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “findif” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “fisapt” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “fnocc” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “mcscf” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “mrcc” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “occ” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “optking” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “psimrcc” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “sapt” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “scfgrad” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “thermo” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “gdma_interface” that is not in the export set.
CMake Error: install(EXPORT “psi4Targets” …) includes target “core” which requires target “dmrg” that is not in the export set.
– Generating done
– Build files have been written to: /u/sciteam/msalim/psi4/objdir/psi4-core-prefix/src/psi4-core-build
make[2]: *** [psi4-core-prefix/src/psi4-core-stamp/psi4-core-configure] Error 1
make[1]: *** [CMakeFiles/psi4-core.dir/all] Error 2
make: *** [all] Error 2

Not 100% sure what is going on, but this output looks like you are building in an “old” build directory.
You can try re-building in a completely new build directory, and see if that works for you.

I’m concerned about the warning below that’s triggering on this line.

Are you building this on a Cray (Cray Programming Environment 2.5.4 C)? The message suggests that dynamic libraries are discouraged on Cray and this faintly supports it. Problem is that that’s the line building psi4/core.so which is the C++ guts of the psi4 python module and that must be dynamic, not static. You can try changing that line from SHARED to MODULE. I’m not too hopeful, as module is only a variant on shared.

Yes, I was attempting to build this on a Cray system with the GNU programming environment and default cc/CC compiler wrappers. It may be of note that CMake could not detect the default Cray LibSci math libraries. I had to make symlinks to the libsci.* files, renamed as liblapack.*, and point MATH_ROOT to those links. Also, I am just using a CMake binary from miniconda as the system cmake is too old (version 3.1).

I got the same errors attempting to build from a fresh objdir with the core library changed from SHARED to MODULE, as suggested.

However, I just found that setting CRAYPE_LINK_TYPE=dynamic may enable dynamic linking. Am trying one more time…I’ll let you know how it goes! Thanks!

Besides an unrelated issue with versioner.py (which was solved by loading in a Python 2.7 module), the build was successful. Thanks for pointing out the issue with dynamic linking!

Great! Glad you were able to build Psi4.

Would you mind posting the Python 2.7 module issue?

Oh good, glad it worked. Could you also post your arguments to cmake (or wherever the CRAYPE_LINK_TYPE=dynamic was needed)? They can be added to the docs or perhaps to CMakeLists.txt itself. (And cmake from conda is perfectly fine – it’s what I use, too.)

The issue with versioner.py was identical to the one I found here: Build crash in versioner.py
I just forgot to check the default version of Python – the error was due to 2.6.

To build, I just set the environment variables
CRAYPE_LINK_TYPE=dynamic
CRAY_ADD_RPATH=yes

Without special arguments to cmake. Although I believe the flag -dynamic would work too, as mentioned here: https://bluewaters.ncsa.illinois.edu/compiling

Thanks! Those envvar have been added to a repo to add to a PR to add to the docs.