NexGenAnalytics / MIT-MUQ

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

Nanoflann: remove internal find, check and build; use find_package with namespace #38

Closed pierrepebay closed 2 months ago

pierrepebay commented 2 months ago

What I did to "build" nanoflann:

# from MUQ root:
mkdir deps
mkdir deps/nanoflann
cd deps/nanoflann
mkdir build install
# we can change this to .tar if needed
wget https://github.com/jlblancoc/nanoflann/archive/refs/tags/v1.5.5.zip
unzip v1.5.5.zip
cmake -S nanoflann-1.5.5/ -B build/
    -DCMAKE_INSTALL_PREFIX=~/Develop/MIT-MUQ/deps/nanoflann/install \
    -DNANOFLANN_BUILD_EXAMPLES=OFF \
    -DNANOFLANN_BUILD_TESTS=OFF
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 \
      -Dnanoflann_DIR=/home/plpebay/Develop/MIT-MUQ/deps/nanoflann/install/share/cmake/nanoflann/
make -j24 && make install
pierrepebay commented 2 months ago

A couple notes: