Skip to content

Commit

Permalink
- add cpp test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergmann committed May 2, 2024
1 parent 49a5a50 commit 3e78261
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@
/dev/copasi-dependencies
/dev/em-build-copasi
/dev/em-build-dependencies
/dev/cpp-build-copasi
/dev/cpp-dependencies
/dev/cpp-build-dependencies
/dev/libuuid*
/dev/em-dependencies

/dist-node/
/dist-web/
/em-build/
/cpp-build/

.DS_Store
14 changes: 14 additions & 0 deletions dev/cpp-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

export BUILD_DIR="${BUILD_DIR:-cpp-build}"
export COPASIJS_DEPENDENCY_DIR="${COPASIJS_DEPENDENCY_DIR:-dev/cpp-dependencies}"
export BUILD_TYPE="${BUILD_TYPE:-Release}"
export INSTALL_PREFIX="${INSTALL_PREFIX:-dist-$ENVIRONMENT}"

cmake -B $BUILD_DIR \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DCOPASIJS_DEPENDENCY_DIR=$COPASIJS_DEPENDENCY_DIR \
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX \
-DCOPASIJS_INCLUDE_EXAMPLE_FILES=ON

cmake --build $BUILD_DIR --config $BUILD_TYPE
cmake --install $BUILD_DIR --config $BUILD_TYPE
70 changes: 70 additions & 0 deletions dev/cpp-dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

# change into this directory
pushd "$(dirname "$0")"


# build uuid lib if it doesn't exist
# if [ ! -f cpp-dependencies/lib/libuuid.a ]; then

# # download if not already downloaded
# if [ ! -f libuuid-1.0.3.tar.gz ]; then
# curl -L -O http://downloads.sourceforge.net/libuuid/libuuid-1.0.3.tar.gz
# tar -zxf libuuid-1.0.3.tar.gz
# fi
# cd libuuid-1.0.3
# ./configure --prefix=$PWD/../cpp-dependencies --disable-dependency-tracking --with-pic --enable-static=yes --enable-shared=no CFLAGS='-fPIC'
# make
# make install
# cd ..
# rm cpp-dependencies/lib/libuuid.la
# fi

# checkout and build copasi-dependencies if they dont exist
if [ ! -f cpp-dependencies/lib/libCombine-static.a ]; then
if [ ! -d copasi-dependencies ]; then
git clone https://github.com/copasi/copasi-dependencies
fi

cmake -G Ninja -B cpp-build-dependencies -S copasi-dependencies \
-DCMAKE_INSTALL_PREFIX=cpp-dependencies \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_UI_DEPS=OFF \
-DBUILD_zlib=ON \
-DBUILD_archive=OFF \
-DBUILD_NativeJIT=OFF \
-DBUILD_clapack=ON \
-DCMAKE_PREFIX_PATH=cpp-dependencies
cmake --build cpp-build-dependencies --config=Release
fi

# build COPASI SE if it doesn't exist
if [ ! -f cpp-dependencies/lib/libcopasise-static.a ]; then
if [ ! -d COPASI ]; then
git clone https://github.com/copasi/COPASI
cd COPASI && gitTools/UpdateCopasiVersion --force && cd ..
cd COPASI && git checkout release/Version-4.43 && cd ..
fi

cp COPASI/copasi/lapack/f2c.h cpp-dependencies/include
cp COPASI/copasi/lapack/blaswrap.h cpp-dependencies/include

cmake -G Ninja -B cpp-build-copasi -S COPASI \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_GUI=OFF \
-DENABLE_JIT:BOOL=OFF \
-DDATAVALUE_NEEDS_SIZE_T_MEMBERS=1 \
-DCOPASI_INSTALL_C_API=ON \
-DCMAKE_INSTALL_PREFIX=cpp-dependencies \
-DCOPASI_DEPENDENCY_DIR=cpp-dependencies \
-DCMAKE_PREFIX_PATH=cpp-dependencies \
-DDISABLE_STACK_PROTECTOR=ON \
-DF2C_INTEGER=int \
-DF2C_LOGICAL=int

cmake --build cpp-build-copasi --config=Release
cmake --install cpp-build-copasi --config=Release
fi

popd

0 comments on commit 3e78261

Please sign in to comment.