NexGenAnalytics / MIT-MUQ

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

StanMath: dependency work #40

Closed pierrepebay closed 2 months ago

pierrepebay commented 2 months ago

What I did to obtain stanmath:

# from MUQ root:
mkdir deps
mkdir deps/stanmath
cd deps/stanmath
# we can change this to .tar if needed
wget https://github.com/stan-dev/math/archive/refs/tags/v2.18.0.zip
unzip v2.18.0.zip

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 \
      -Dstanmath_DIR=/home/plpebay/Develop/MIT-MUQ/deps/stanmath/math-2.18.0
make -j24 && make install
fnrizzi commented 2 months ago

please fix the description which you clearly copied and pasted but some things are not applicable, for example mkdir build and install

fnrizzi commented 2 months ago

Dstanmath_DIR this is not what we talked about , why are you using this rather than a differnt name like we discussed to make it more clear that we want the path to the headers? I am not asking to change this yet, just asking why you did it this way

pierrepebay commented 2 months ago

Dstanmath_DIR this is not what we talked about , why are you using this rather than a differnt name like we discussed to make it more clear that we want the path to the headers? I am not asking to change this yet, just asking why you did it this way

I hesitated doing this, but the main reason is that you must point to the root level of the stanmath source, not the directory where the actual header is:

math-2.18.0
|- ... other dirs
|-stan/
  |-math/
  |-math.hpp

because in MUQ source, using stanmath is done through includes of the form: #include <stan/math/...>. I thought this naming would make it clear to just point to the root of source (math-2.18.0/) and not math-2.18.0/stan. But I am open to using an other name if not clear!