Skip to content

Commit 2e168cf

Browse files
author
Wolfgang Kastaun
committed
RePrimAnd Version 1.3
-Added experimental Einstein Toolkit thorn for building ReprimAnd library -Fixed minor bug affecting some EOS sanity checks
1 parent dac853e commit 2e168cf

File tree

15 files changed

+243
-10
lines changed

15 files changed

+243
-10
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Cactus Code Thorn RePrimAnd
2+
Author(s) : Wolfgang Kastaun
3+
Maintainer(s): Wolfgang Kastaun
4+
Licence : GPL
5+
--------------------------------------------------------------------------
6+
7+
1. Purpose
8+
9+
Distribute the RePrimAnd Library; see
10+
<https://github.com/wokast/RePrimAnd>.
11+
12+
13+
The RePrimAnd library is a support library for general relativistic
14+
magnetohydrodynamics, providing:
15+
An extensible, modular EOS framework (thermal + barotropic)
16+
An algorithm for primitive variable recovery in ideal GRMHD
17+
18+
A link to the library documentation can be found at
19+
https://github.com/wokast/RePrimAnd
20+
21+
The article describing the algorithm is
22+
https://doi.org/10.1103/PhysRevD.103.023018
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Configuration definitions for thorn RePrimAnd
2+
3+
PROVIDES RePrimAnd
4+
{
5+
SCRIPT src/detect.sh
6+
LANG bash
7+
OPTIONS REPRIMAND_DIR REPRIMAND_INSTALL_DIR REPRIMAND_LIBS
8+
}
9+
10+
# Pass configuration options to build script
11+
REQUIRES GSL BOOST HDF5 RePrimAnd
194 KB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Interface definition for thorn RePrimAnd
2+
3+
IMPLEMENTS: RePrimAnd
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Parameter definitions for thorn RePrimAnd
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Schedule definitions for thorn RePrimAnd
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#! /bin/bash
2+
3+
################################################################################
4+
# Build
5+
################################################################################
6+
7+
# Set up shell
8+
if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
9+
set -x # Output commands
10+
fi
11+
set -e # Abort on errors
12+
13+
14+
15+
# Set locations
16+
THORN=RePrimAnd
17+
NAME=RePrimAnd-1.3
18+
SRCDIR="$(dirname $0)"
19+
BUILD_DIR=${SCRATCH_BUILD}/build/${THORN}
20+
if [ -z "${REPRIMAND_INSTALL_DIR}" ]; then
21+
INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN}
22+
else
23+
echo "BEGIN MESSAGE"
24+
echo "Installing REPRIMAND into ${REPRIMAND_INSTALL_DIR} "
25+
echo "END MESSAGE"
26+
INSTALL_DIR=${REPRIMAND_INSTALL_DIR}
27+
fi
28+
DONE_FILE=${SCRATCH_BUILD}/done/${THORN}
29+
REPRIMAND_DIR=${INSTALL_DIR}
30+
31+
# Set up environment
32+
#unset LIBS
33+
#if echo '' ${ARFLAGS} | grep 64 > /dev/null 2>&1; then
34+
# export OBJECT_MODE=64
35+
#fi
36+
37+
echo "REPRIMAND: Preparing directory structure..."
38+
cd ${SCRATCH_BUILD}
39+
mkdir build external done 2> /dev/null || true
40+
rm -rf ${BUILD_DIR} ${INSTALL_DIR}
41+
mkdir ${BUILD_DIR} ${INSTALL_DIR}
42+
43+
echo "REPRIMAND: Unpacking archive..."
44+
pushd ${BUILD_DIR}
45+
${TAR?} xJf ${SRCDIR}/../dist/${NAME}.tar.xz
46+
47+
echo "REPRIMAND: Configuring..."
48+
cd ${NAME}
49+
meson setup mesonbuild --prefix=${REPRIMAND_DIR} --default-library=static --buildtype=debugoptimized -Dbuild_documentation=false -Dbuild_benchmarks=false -Dbuild_tests=false
50+
51+
echo "REPRIMAND: Building..."
52+
ninja -C mesonbuild
53+
54+
echo "REPRIMAND: Installing..."
55+
meson install -C mesonbuild
56+
popd
57+
58+
echo "REPRIMAND: Cleaning up..."
59+
rm -rf ${BUILD_DIR}
60+
61+
date > ${DONE_FILE}
62+
echo "REPRIMAND: Done."
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#! /bin/bash
2+
3+
################################################################################
4+
# Prepare
5+
################################################################################
6+
7+
# Set up shell
8+
if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
9+
set -x # Output commands
10+
fi
11+
set -e # Abort on errors
12+
13+
. $CCTK_HOME/lib/make/bash_utils.sh
14+
15+
# Take care of requests to build the library in any case
16+
REPRIMAND_DIR_INPUT=$REPRIMAND_DIR
17+
if [ "$(echo "${REPRIMAND_DIR}" | tr '[a-z]' '[A-Z]')" = 'BUILD' ]; then
18+
REPRIMAND_BUILD=yes
19+
REPRIMAND_DIR=
20+
else
21+
REPRIMAND_BUILD=
22+
fi
23+
24+
25+
THORN=RePrimAnd
26+
27+
################################################################################
28+
# Build
29+
################################################################################
30+
31+
if [ -n "$REPRIMAND_BUILD" -o -z "${REPRIMAND_DIR}" ]; then
32+
echo "BEGIN MESSAGE"
33+
echo "Using bundled REPRIMAND..."
34+
echo "END MESSAGE"
35+
36+
check_tools "tar"
37+
38+
# Set locations
39+
BUILD_DIR=${SCRATCH_BUILD}/build/${THORN}
40+
if [ -z "${REPRIMAND_INSTALL_DIR}" ]; then
41+
INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN}
42+
else
43+
echo "BEGIN MESSAGE"
44+
echo "Installing REPRIMAND into ${REPRIMAND_INSTALL_DIR} "
45+
echo "END MESSAGE"
46+
INSTALL_DIR=${REPRIMAND_INSTALL_DIR}
47+
fi
48+
REPRIMAND_BUILD=1
49+
REPRIMAND_DIR=${INSTALL_DIR}
50+
REPRIMAND_INC_DIRS="$REPRIMAND_DIR/include"
51+
REPRIMAND_LIB_DIRS="$REPRIMAND_DIR/lib"
52+
REPRIMAND_LIBS="RePrimAnd"
53+
else
54+
REPRIMAND_BUILD=
55+
DONE_FILE=${SCRATCH_BUILD}/done/${THORN}
56+
if [ ! -e ${DONE_FILE} ]; then
57+
mkdir ${SCRATCH_BUILD}/done 2> /dev/null || true
58+
date > ${DONE_FILE}
59+
fi
60+
fi
61+
62+
################################################################################
63+
# Configure Cactus
64+
################################################################################
65+
66+
# Pass configuration options to build script
67+
echo "BEGIN MAKE_DEFINITION"
68+
echo "REPRIMAND_BUILD = ${REPRIMAND_BUILD}"
69+
echo "REPRIMAND_INSTALL_DIR = ${REPRIMAND_INSTALL_DIR}"
70+
echo "END MAKE_DEFINITION"
71+
72+
73+
set_make_vars "REPRIMAND" "$REPRIMAND_LIBS" "$REPRIMAND_LIB_DIRS" "$REPRIMAND_INC_DIRS"
74+
75+
# Pass options to Cactus
76+
echo "BEGIN MAKE_DEFINITION"
77+
echo "REPRIMAND_DIR = ${REPRIMAND_DIR}"
78+
echo "REPRIMAND_INC_DIRS = ${REPRIMAND_INC_DIRS}"
79+
echo "REPRIMAND_LIB_DIRS = ${REPRIMAND_LIB_DIRS}"
80+
echo "REPRIMAND_LIBS = ${REPRIMAND_LIBS}"
81+
echo "END MAKE_DEFINITION"
82+
83+
echo 'INCLUDE_DIRECTORY $(REPRIMAND_INC_DIRS)'
84+
echo 'LIBRARY_DIRECTORY $(REPRIMAND_LIB_DIRS)'
85+
echo 'LIBRARY $(REPRIMAND_LIBS)'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Main make.code.defn file for thorn REPRIMAND
2+
3+
# Source files in this directory
4+
SRCS =
5+
6+
# Subdirectories containing source files
7+
SUBDIRS =
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Main make.code.deps file for thorn RePrimAnd
2+
3+
export REPRIMAND_INSTALL_DIR
4+
5+
$(CCTK_TARGET) $(OBJS) $(SRCS:%=%.d): $(SCRATCH_BUILD)/done/$(THORN)
6+
7+
ifneq ($(REPRIMAND_BUILD),)
8+
$(SCRATCH_BUILD)/done/$(THORN): $(SRCDIR)/build.sh
9+
+$(SRCDIR)/build.sh
10+
endif

0 commit comments

Comments
 (0)