CQMP / Maxent

GNU General Public License v2.0
16 stars 14 forks source link

Maxent fails to find Eigen3 #22

Closed galexv closed 7 years ago

galexv commented 7 years ago

I have Eigen3 installed. I see this:

$ cmake .. -DEIGEN3_INCLUDE_DIR=/usr/local/eigen/eigen_3.3.1/include
-- A library with BLAS API found.
-- A library with LAPACK API found.
-- Finding packages, please stand by...
-- Using GSL from /usr
CMake Error at cmake/FindEigen3.cmake:33 (file):
  file failed to open for reading (No such file or directory):

    /usr/local/eigen/eigen_3.3.1/include/Eigen/src/Core/util/Macros.h
Call Stack (most recent call first):
  cmake/FindEigen3.cmake:59 (_eigen3_check_version)
  CMakeLists.txt:26 (find_package)
[...]
-- Configuring incomplete, errors occurred!
See also "/home/galexv/Work/UMich/ALPSCore/cqmp/Maxent/000build/CMakeFiles/CMakeOutput.log".
See also "/home/galexv/Work/UMich/ALPSCore/cqmp/Maxent/000build/CMakeFiles/CMakeError.log".

The cmake script looks at a wrong place: on my system it is ${EIGEN3_INCLUDE_DIR}/eigen3/Eigen/src/Core/util/Macros.h rather than ${EIGEN3_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h.

We should probably better use Eigen3's own Eigen3Config.cmake file.

iskakoff commented 7 years ago

I think, better submit an issue to CMake or Eigen to get it fixed.

galexv commented 7 years ago

I meant that the problem is Maxent's own cmake/FindEigen3.cmake.

If i remove it, and also remove the version requirement in CMakeLists.txt (that is, use find_package (Eigen3 REQUIRED)), then Eigen3 is found and Maxent is built successfully.

I will re-add version check and make the patch.

ryanlevy commented 7 years ago

If I code up a C++ file and use the equivalent -I${EIGEN3_INCLUDE_DIR} (omitting the eigen3 part), the compiler can't find the headers. Is there something in the Eigen3 documentation that allows for the eigen3/ folder?

ryanlevy commented 7 years ago

Looks like in some update since I uploaded the file, they've include changed how it finds the path. We can remove it if you trust that cmake comes with FindEigen3.cmake, or just update it to the latest version

galexv commented 7 years ago

IMHO, it is not CMake that comes with the file. Like in the case of ALPSCore, one needs to set export Eigen3_DIR=/where/eigen3/installed, and then find_package(Eigen3) will find it (or, if Eigen3 is installed in "system" directories, even setting the variable is not needed).

galexv commented 7 years ago

Sorry for spamming with PRs. :) (Request https://github.com/CQMP/Maxent/pull/24)

egull commented 7 years ago

I think this is done – seems to work. Any reason to keep it open?