forked from wokast/RePrimAnd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-Added experimental Einstein Toolkit thorn for building ReprimAnd library -Fixed minor bug affecting some EOS sanity checks
- Loading branch information
Wolfgang Kastaun
committed
Jul 25, 2021
1 parent
dac853e
commit 2e168cf
Showing
15 changed files
with
243 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Cactus Code Thorn RePrimAnd | ||
Author(s) : Wolfgang Kastaun | ||
Maintainer(s): Wolfgang Kastaun | ||
Licence : GPL | ||
-------------------------------------------------------------------------- | ||
|
||
1. Purpose | ||
|
||
Distribute the RePrimAnd Library; see | ||
<https://github.com/wokast/RePrimAnd>. | ||
|
||
|
||
The RePrimAnd library is a support library for general relativistic | ||
magnetohydrodynamics, providing: | ||
An extensible, modular EOS framework (thermal + barotropic) | ||
An algorithm for primitive variable recovery in ideal GRMHD | ||
|
||
A link to the library documentation can be found at | ||
https://github.com/wokast/RePrimAnd | ||
|
||
The article describing the algorithm is | ||
https://doi.org/10.1103/PhysRevD.103.023018 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Configuration definitions for thorn RePrimAnd | ||
|
||
PROVIDES RePrimAnd | ||
{ | ||
SCRIPT src/detect.sh | ||
LANG bash | ||
OPTIONS REPRIMAND_DIR REPRIMAND_INSTALL_DIR REPRIMAND_LIBS | ||
} | ||
|
||
# Pass configuration options to build script | ||
REQUIRES GSL BOOST HDF5 RePrimAnd |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Interface definition for thorn RePrimAnd | ||
|
||
IMPLEMENTS: RePrimAnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Parameter definitions for thorn RePrimAnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Schedule definitions for thorn RePrimAnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! /bin/bash | ||
|
||
################################################################################ | ||
# Build | ||
################################################################################ | ||
|
||
# Set up shell | ||
if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then | ||
set -x # Output commands | ||
fi | ||
set -e # Abort on errors | ||
|
||
|
||
|
||
# Set locations | ||
THORN=RePrimAnd | ||
NAME=RePrimAnd-1.3 | ||
SRCDIR="$(dirname $0)" | ||
BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} | ||
if [ -z "${REPRIMAND_INSTALL_DIR}" ]; then | ||
INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} | ||
else | ||
echo "BEGIN MESSAGE" | ||
echo "Installing REPRIMAND into ${REPRIMAND_INSTALL_DIR} " | ||
echo "END MESSAGE" | ||
INSTALL_DIR=${REPRIMAND_INSTALL_DIR} | ||
fi | ||
DONE_FILE=${SCRATCH_BUILD}/done/${THORN} | ||
REPRIMAND_DIR=${INSTALL_DIR} | ||
|
||
# Set up environment | ||
#unset LIBS | ||
#if echo '' ${ARFLAGS} | grep 64 > /dev/null 2>&1; then | ||
# export OBJECT_MODE=64 | ||
#fi | ||
|
||
echo "REPRIMAND: Preparing directory structure..." | ||
cd ${SCRATCH_BUILD} | ||
mkdir build external done 2> /dev/null || true | ||
rm -rf ${BUILD_DIR} ${INSTALL_DIR} | ||
mkdir ${BUILD_DIR} ${INSTALL_DIR} | ||
|
||
echo "REPRIMAND: Unpacking archive..." | ||
pushd ${BUILD_DIR} | ||
${TAR?} xJf ${SRCDIR}/../dist/${NAME}.tar.xz | ||
|
||
echo "REPRIMAND: Configuring..." | ||
cd ${NAME} | ||
meson setup mesonbuild --prefix=${REPRIMAND_DIR} --default-library=static --buildtype=debugoptimized -Dbuild_documentation=false -Dbuild_benchmarks=false -Dbuild_tests=false | ||
|
||
echo "REPRIMAND: Building..." | ||
ninja -C mesonbuild | ||
|
||
echo "REPRIMAND: Installing..." | ||
meson install -C mesonbuild | ||
popd | ||
|
||
echo "REPRIMAND: Cleaning up..." | ||
rm -rf ${BUILD_DIR} | ||
|
||
date > ${DONE_FILE} | ||
echo "REPRIMAND: Done." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#! /bin/bash | ||
|
||
################################################################################ | ||
# Prepare | ||
################################################################################ | ||
|
||
# Set up shell | ||
if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then | ||
set -x # Output commands | ||
fi | ||
set -e # Abort on errors | ||
|
||
. $CCTK_HOME/lib/make/bash_utils.sh | ||
|
||
# Take care of requests to build the library in any case | ||
REPRIMAND_DIR_INPUT=$REPRIMAND_DIR | ||
if [ "$(echo "${REPRIMAND_DIR}" | tr '[a-z]' '[A-Z]')" = 'BUILD' ]; then | ||
REPRIMAND_BUILD=yes | ||
REPRIMAND_DIR= | ||
else | ||
REPRIMAND_BUILD= | ||
fi | ||
|
||
|
||
THORN=RePrimAnd | ||
|
||
################################################################################ | ||
# Build | ||
################################################################################ | ||
|
||
if [ -n "$REPRIMAND_BUILD" -o -z "${REPRIMAND_DIR}" ]; then | ||
echo "BEGIN MESSAGE" | ||
echo "Using bundled REPRIMAND..." | ||
echo "END MESSAGE" | ||
|
||
check_tools "tar" | ||
|
||
# Set locations | ||
BUILD_DIR=${SCRATCH_BUILD}/build/${THORN} | ||
if [ -z "${REPRIMAND_INSTALL_DIR}" ]; then | ||
INSTALL_DIR=${SCRATCH_BUILD}/external/${THORN} | ||
else | ||
echo "BEGIN MESSAGE" | ||
echo "Installing REPRIMAND into ${REPRIMAND_INSTALL_DIR} " | ||
echo "END MESSAGE" | ||
INSTALL_DIR=${REPRIMAND_INSTALL_DIR} | ||
fi | ||
REPRIMAND_BUILD=1 | ||
REPRIMAND_DIR=${INSTALL_DIR} | ||
REPRIMAND_INC_DIRS="$REPRIMAND_DIR/include" | ||
REPRIMAND_LIB_DIRS="$REPRIMAND_DIR/lib" | ||
REPRIMAND_LIBS="RePrimAnd" | ||
else | ||
REPRIMAND_BUILD= | ||
DONE_FILE=${SCRATCH_BUILD}/done/${THORN} | ||
if [ ! -e ${DONE_FILE} ]; then | ||
mkdir ${SCRATCH_BUILD}/done 2> /dev/null || true | ||
date > ${DONE_FILE} | ||
fi | ||
fi | ||
|
||
################################################################################ | ||
# Configure Cactus | ||
################################################################################ | ||
|
||
# Pass configuration options to build script | ||
echo "BEGIN MAKE_DEFINITION" | ||
echo "REPRIMAND_BUILD = ${REPRIMAND_BUILD}" | ||
echo "REPRIMAND_INSTALL_DIR = ${REPRIMAND_INSTALL_DIR}" | ||
echo "END MAKE_DEFINITION" | ||
|
||
|
||
set_make_vars "REPRIMAND" "$REPRIMAND_LIBS" "$REPRIMAND_LIB_DIRS" "$REPRIMAND_INC_DIRS" | ||
|
||
# Pass options to Cactus | ||
echo "BEGIN MAKE_DEFINITION" | ||
echo "REPRIMAND_DIR = ${REPRIMAND_DIR}" | ||
echo "REPRIMAND_INC_DIRS = ${REPRIMAND_INC_DIRS}" | ||
echo "REPRIMAND_LIB_DIRS = ${REPRIMAND_LIB_DIRS}" | ||
echo "REPRIMAND_LIBS = ${REPRIMAND_LIBS}" | ||
echo "END MAKE_DEFINITION" | ||
|
||
echo 'INCLUDE_DIRECTORY $(REPRIMAND_INC_DIRS)' | ||
echo 'LIBRARY_DIRECTORY $(REPRIMAND_LIB_DIRS)' | ||
echo 'LIBRARY $(REPRIMAND_LIBS)' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Main make.code.defn file for thorn REPRIMAND | ||
|
||
# Source files in this directory | ||
SRCS = | ||
|
||
# Subdirectories containing source files | ||
SUBDIRS = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Main make.code.deps file for thorn RePrimAnd | ||
|
||
export REPRIMAND_INSTALL_DIR | ||
|
||
$(CCTK_TARGET) $(OBJS) $(SRCS:%=%.d): $(SCRATCH_BUILD)/done/$(THORN) | ||
|
||
ifneq ($(REPRIMAND_BUILD),) | ||
$(SCRATCH_BUILD)/done/$(THORN): $(SRCDIR)/build.sh | ||
+$(SRCDIR)/build.sh | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters