Skip to content

Commit 8fac7e2

Browse files
committed
Add nlopt and enable PAGMO_WITH_NLOPT
1 parent 925a214 commit 8fac7e2

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ env:
2626
FUNCTION2_VERSION: "4.2.4"
2727
VTK_VERSION: "v9.4.1"
2828
SCOTCH_VERSION: "v7.0.6"
29+
NLOPT_VERSION: "v2.10.0"
2930
concurrency:
3031
group: release-${{ github.ref }}
3132
cancel-in-progress: true

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ This repo provides the following statically compiled libraries:
2828
- [function2](https://github.com/Naios/function2)
2929
- [VTK](https://gitlab.kitware.com/vtk/vtk)
3030
- [scotch](https://gitlab.inria.fr/scotch/scotch)
31+
- [nlopt](https://github.com/stevengj/nlopt)
3132
- [LLVM](https://llvm.org/) (copied from <https://github.com/spatial-model-editor/sme_deps_llvm>)
3233
- [Qt](https://doc.qt.io/) (copied from <https://github.com/spatial-model-editor/sme_deps_qt>)
3334

build.sh

+26
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ echo "COMBINE_VERSION: ${COMBINE_VERSION}"
3030
echo "FUNCTION2_VERSION: ${FUNCTION2_VERSION}"
3131
echo "VTK_VERSION: ${VTK_VERSION}"
3232
echo "SCOTCH_VERSION: ${SCOTCH_VERSION}"
33+
echo "NLOPT_VERSION: ${NLOPT_VERSION}"
3334

3435
NPROCS=4
3536
echo "NPROCS: ${NPROCS}"
@@ -45,6 +46,30 @@ python --version
4546
which cmake
4647
cmake --version
4748

49+
# build static version of nlopt (required by pagmo)
50+
git clone -b $NLOPT_VERSION --depth 1 https://github.com/stevengj/nlopt.git
51+
cd nlopt
52+
mkdir build
53+
cd build
54+
cmake -GNinja .. \
55+
-DCMAKE_OSX_DEPLOYMENT_TARGET="${MACOSX_DEPLOYMENT_TARGET}" \
56+
-DCMAKE_BUILD_TYPE=Release \
57+
-DBUILD_SHARED_LIBS=OFF \
58+
-DCMAKE_C_FLAGS="-fpic -fvisibility=hidden" \
59+
-DCMAKE_CXX_FLAGS="-fpic -fvisibility=hidden" \
60+
-DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \
61+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
62+
-DNLOPT_FORTRAN=OFF \
63+
-DNLOPT_GUILE=OFF \
64+
-DNLOPT_JAVA=OFF \
65+
-DNLOPT_MATLAB=OFF \
66+
-DNLOPT_OCTAVE=OFF \
67+
-DNLOPT_PYTHON=OFF \
68+
-DNLOPT_SWIG=OFF
69+
time ninja
70+
${SUDO_CMD} ninja install
71+
cd ../../
72+
4873
# install function2 headers
4974
git clone -b $FUNCTION2_VERSION --depth 1 https://github.com/Naios/function2.git
5075
cd function2
@@ -328,6 +353,7 @@ cmake -GNinja .. \
328353
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
329354
-DCMAKE_PREFIX_PATH="$INSTALL_PREFIX" \
330355
-DPAGMO_BUILD_STATIC_LIBRARY=ON \
356+
-DPAGMO_WITH_NLOPT=ON \
331357
-DPAGMO_BUILD_TESTS=OFF
332358
VERBOSE=1 time ninja
333359
${SUDO_CMD} ninja install

0 commit comments

Comments
 (0)