NexGenAnalytics / MIT-MUQ

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Eigen: remove internal find, check and build; use find_package with namespace #37

Closed pierrepebay closed 2 months ago

pierrepebay commented 2 months ago

What I did to "build" eigen:

# from MUQ root:
mkdir deps
mkdir deps/eigen
cd deps/eigen
mkdir build install
# we can change this to .tar if needed
wget https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip
unzip eigen-3.3.7.zip
cmake -S eigen-3.3.7/ -B build/ -DCMAKE_INSTALL_PREFIX=/home/plpebay/Develop/MIT-MUQ/deps/eigen/install
cd build
make install

How I used this build with MUQ:

cmake -DCMAKE_C_COMPILER=gcc \
      -DCMAKE_CXX_COMPILER=g++ \
      -S /home/plpebay/Develop/MIT-MUQ/ \
      -B /home/plpebay/Develop/MIT-MUQ/build/ \
      -DMUQ_USE_GTEST=ON \
      -DMUQ_GTEST_DIR=/home/plpebay/Develop/MIT-MUQ/deps/googletest/install \
      -DCMAKE_INSTALL_PREFIX=/home/plpebay/Develop/MIT-MUQ/install \
      -DHDF5_DIR=/home/plpebay/Develop/MIT-MUQ/deps/hdf5/install/share/cmake \
      -DNLopt_DIR=/home/plpebay/Develop/MIT-MUQ/deps/nlopt/install/lib/cmake/nlopt \
      -DBoost_DIR=/home/plpebay/Develop/MIT-MUQ/deps/boost/install/lib/cmake/Boost-1.85.0 \
      -DSUNDIALS_DIR=/home/plpebay/Develop/MIT-MUQ/deps/sundials/install/lib/cmake/sundials \
      -DEigen3_DIR=/home/plpebay/Develop/MIT-MUQ/deps/eigen/install/share/eigen3/cmake
make -j24 && make install
pierrepebay commented 2 months ago

Remark: eigen is header only so doesn't need to be compiled, but the make install step is to generate the cmake configuration file necessary for exporting the eigen namespaces, which we need.

pierrepebay commented 2 months ago

Remark: eigen is header only so doesn't need to be compiled, but the make install step is to generate the cmake configuration file necessary for exporting the eigen namespaces, which we need.

This means that a user must pass a "configured" eigen, and not just the path to the headers as is. My choice to initially support only a "configured" eigen is for the following reasons: