NexGenAnalytics / MIT-MUQ

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

NLopt: remove internal find and build; use find_package with namespace #32

Closed pierrepebay closed 2 months ago

pierrepebay commented 3 months ago

What I did to build nlopt:

# from MUQ root:
mkdir deps
mkdir deps/nlopt
cd deps/nlopt
mkdir build install
# we can change this to .tar if needed
wget https://github.com/stevengj/nlopt/archive/refs/tags/v2.8.0.zip
unzip v2.8.0
cmake -S nlopt-2.8.0/ -B build/ -DCMAKE_INSTALL_PREFIX=~/Develop/MIT-MUQ/deps/nlopt/install/
cd build
make -j24 && 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 \
      -DNLopt_DIR=/home/plpebay/Develop/MIT-MUQ/deps/nlopt/install/lib/cmake/nlopt \
      -DHDF5_DIR=/home/plpebay/Develop/MIT-MUQ/deps/hdf5/install/share/cmake
make -j24 && make install
pierrepebay commented 3 months ago

The version used for the internal build of NLopt is 2.4.2, which doesn't use CMake for the build process (uses a configure); so I use the most recent version of NLopt, which builds and passes tests with MUQ.

fnrizzi commented 3 months ago

The version used for the internal build of NLopt is 2.4.2, which doesn't use CMake for the build process (uses a configure); so I use the most recent version of NLopt, which builds and passes tests with MUQ.

what version did you use? ah nevermind, 2.8.0

fnrizzi commented 2 months ago

please also resolve conflicts

pierrepebay commented 2 months ago

Rebased; updated the top comment for build instructions as we now need to point to both HDF5 and NLopt