evaleev / libint

Libint: high-performance library for computing Gaussian integrals in quantum mechanics
Other
225 stars 95 forks source link

Unable to find Eigen #172

Open pmott91 opened 4 years ago

pmott91 commented 4 years ago

I am trying to install Libint on Summit. The cmake process keeps derailing when the program tries to find Eigen3. I get the following warning after doing mkdir build, cd build, cmake .. :

**CMake Warning at CMakeLists.txt:88 (find_package): By not providing "FindEigen3.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Eigen3", but CMake did not find one.

Could not find a package configuration file provided by "Eigen3" with any of the following names:

Eigen3Config.cmake
eigen3-config.cmake

Add the installation prefix of "Eigen3" to CMAKE_PREFIX_PATH or set "Eigen3_DIR" to a directory containing one of the above files. If "Eigen3" provides a separate development package or SDK, be sure it has been installed.

CMake Error at CMakeLists.txt:108 (message): C++ API cannot be built without Eigen3; configure (via CMake) and install Eigen3 and add the install prefix to CMAKE_PREFIX_PATH, or add -DREQUIRE_CXX_API=OFF to the CMake command line if the C++ API is not required**

I tried setting the environment variable Eigen3_Dir=/ccs/home/plot/software/Eigen3/cmake where the .cmake files mentioned are installed.

I tried appending /ccs/home/plot/software/Eigen3/cmake/FindEigen3.cmake to the CMAKE_MODULEPATH

I have not been able to figure out how to edit CMAKE_PREFIX_PATH.

Any help in pointing cmake to the location of Eigen3 would be helpful.

Thanks, Paul

evaleev commented 4 years ago

@pmott91 you mentioned /ccs/home/plot/software/Eigen3/cmake contains the aforementioned files I presume you meant it contains FindEigen3.cmake? It needs to find Eigen3Config.cmake or eigen3-config.cmake. Due to nice built-in footguns Eigen's cmake module file (namely, FindEigen3.cmake) is not considered, Libint only accepts Eigen install produced by via cmake configuration. Please let me know if you have installed Eigen yourself, and if yes, whether you used cmake. It should be sufficient to add Eigen's install prefix (the dir specified to CMAKE_INSTALL_PREFIX when configuring Eigen) dir to CMAKE_PREFIX_PATH. E.g. add /ccs/home/evaleev/code/install/eigen to CMAKE_PREFIX_PATH (that dir should be world readable)

pmott91 commented 4 years ago

@evaleev The path does lead to the file FindEigen3.cmake. There is a file called Eigen3Config.cmake.in in that directory as well. But I have not used cmake to install Eigen. My understanding is that Eigen is simply a collection of header files that need to be downloaded. Is a cmake build necessary?

xiki-tempula commented 2 years ago

@evaleev This is how I solve the problem. Yoy don't need to install Eigen3 but you still to cmake it.

For me this means

cd eigen-3.4.0
mkdir build
cd build
cmake ..

which would generate Eigen3Config.cmake in eigen-3.4.0/build. Then you could point -DCMAKE_MODULE_PATH=~/src/eigen-3.4.0/build during the cmake.