summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-11-23 16:37:57 +0100
committerAnton Khirnov <anton@khirnov.net>2022-11-23 16:37:57 +0100
commit0f05d85afec066c821c5c4652b1ae4b210aac827 (patch)
tree5a3c44c828523285261f0e1b62e3c7f44b954fe7
parent5d06b61aa280bdbe98c5c7ff6fbbc66576130266 (diff)
contrib/critical_collapse: add build instructions
-rw-r--r--contrib/critical_collapse/build_instructions.txt45
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/critical_collapse/build_instructions.txt b/contrib/critical_collapse/build_instructions.txt
new file mode 100644
index 0000000..1c5b6cd
--- /dev/null
+++ b/contrib/critical_collapse/build_instructions.txt
@@ -0,0 +1,45 @@
+# this is a guideline, not a script - do not execute directly
+# start in the source dir root
+SOURCE_DIR=$PWD
+
+# create the build dir, only do this once for the entire source dir
+BUILD_DIR="${SOURCE_DIR}/build"
+mkdir "$BUILD_DIR" && cd "$BUILD_DIR" && "${SOURCE_DIR}/configure"
+
+# from now on work in the build dir
+cd "$BUILD_DIR"
+
+# create configuration, called 'cc' in this document
+make cc PROMPT=
+
+# copy the thorn list for the configuration
+cp "${SOURCE_DIR}/contrib/critical_collapse/ThornList" configs/cc
+
+# the following external libraries are needed
+LIBS="brilldata teukolskydata mg2d lapacke gfortran"
+# library object dir
+LIBDIR="<library location>"
+# header dir
+INCDIR="<header location>"
+
+export PKG_CONFIG_PATH="${LIBDIR}/pkg_config"
+
+# compiler flags
+CFLAGS="-g -std=gnu99 -I${INCDIR}"
+C_OPTIMISE_FLAGS="-O3"
+C_OPENMP_FLAGS="-fopenmp"
+CXXFLAGS="-g -std=c++11"
+CXX_OPTIMISE_FLAGS="-O3"
+CXX_OPENMP_FLAGS="-fopenmp"
+F90FLAGS="-fallow-argument-mismatch"
+
+# set build parameters
+make cc-reconfig \
+ OPENMP=yes VECTORISE=yes \
+ MPI_DIR=/usr LIBS="$LIBS" LDFLAGS="$LDFLAGS" \
+ C_OPTIMISE_FLAGS="$C_OPTIMISE_FLAGS" CXX_OPTIMISE_FLAGS="$CXX_OPTIMISE_FLAGS" \
+ C_OPENMP_FLAGS="$C_OPENMP_FLAGS" CXX_OPENMP_FLAGS="$CXX_OPENMP_FLAGS" \
+ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" F90FLAGS="$F90FLAGS"
+
+# build
+make cc -j8