From 0973a99607f9934137b3efe152c7cd9817a45cae Mon Sep 17 00:00:00 2001 From: schnetter Date: Sun, 22 Nov 2009 04:53:09 +0000 Subject: Add LORENE git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@2 5c1b1641-b641-47ec-b3d9-0f93d4c445ee --- LORENE.sh | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README | 15 ++++++++ configuration.ccl | 9 +++++ dist/LORENE.tar.gz | Bin 0 -> 2277938 bytes dist/README | 10 +++++ dist/darwin.patch | 30 +++++++++++++++ interface.ccl | 3 ++ param.ccl | 1 + schedule.ccl | 1 + src/make.code.defn | 7 ++++ 10 files changed, 182 insertions(+) create mode 100644 LORENE.sh create mode 100644 README create mode 100644 configuration.ccl create mode 100644 dist/LORENE.tar.gz create mode 100644 dist/README create mode 100644 dist/darwin.patch create mode 100644 interface.ccl create mode 100644 param.ccl create mode 100644 schedule.ccl create mode 100644 src/make.code.defn diff --git a/LORENE.sh b/LORENE.sh new file mode 100644 index 0000000..6afd6c3 --- /dev/null +++ b/LORENE.sh @@ -0,0 +1,106 @@ +#! /bin/bash + +################################################################################ +# Prepare +################################################################################ + +# Set up shell +set -x # Output commands +set -e # Abort on errors + +# Set locations +NAME=LORENE +SRCDIR=$(dirname $0) +INSTALL_DIR=${SCRATCH_BUILD} +LORENE_DIR=${INSTALL_DIR}/build-${NAME}/${NAME} + +# Clean up environment +unset LIBS +unset MAKEFLAGS + + + +################################################################################ +# Build +################################################################################ + +( + exec >&2 # Redirect stdout to stderr + set -x # Output commands + set -e # Abort on errors + cd ${INSTALL_DIR} + if [ -e done-${NAME} -a done-${NAME} -nt ${SRCDIR}/dist/${NAME}.tar.gz ]; then + echo "LORENE: The enclosed LORENE library has already been built; doing nothing" + else + echo "LORENE: Building enclosed LORENE library" + + echo "LORENE: Unpacking archive..." + rm -rf build-${NAME} + mkdir build-${NAME} + pushd build-${NAME} + # Should we use gtar or tar? + TAR=$(gtar --help > /dev/null 2> /dev/null && echo gtar || echo tar) + ${TAR} xzf ${SRCDIR}/dist/${NAME}.tar.gz + patch -p0 < ${SRCDIR}/dist/darwin.patch + popd + + echo "LORENE: Configuring..." + pushd build-${NAME}/${NAME} + cat > local_settings <> \$(df).d \$< +DEPDIR = .deps +FFT_DIR = FFT991 +LIB_CXX = ${LIBS} +LIB_LAPACK = ${LAPACK_LIBS} ${BLAS_LIBS} +LIB_PGPLOT = +LIB_GSL = ${GSL_LIBS} +EOF + + echo "LORENE: Building..." + export HOME_LORENE=${LORENE_DIR} + # Note that this builds two versions of the library, a + # "regular" version and a "debug" version. Both are identical + # (since we specified identical build options above), and we + # ignore the "debug" version. + make cpp fortran export + popd + + echo 'done' > done-${NAME} + echo "LORENE: Done." + fi +) + +# TODO: check $? + + + +################################################################################ +# Configure Cactus +################################################################################ + +# Set options +LORENE_INC_DIRS="${LORENE_DIR}/Export/C++/Include ${LORENE_DIR}/C++/Include" +LORENE_LIB_DIRS="${LORENE_DIR}/Lib" +LORENE_LIBS='lorene_export lorene lorenef77' + +# Pass options to Cactus +echo "BEGIN MAKE_DEFINITION" +echo "HAVE_LORENE = 1" +echo "LORENE_DIR = ${LORENE_DIR}" +echo "LORENE_INC_DIRS = ${LORENE_INC_DIRS}" +echo "LORENE_LIB_DIRS = ${LORENE_LIB_DIRS}" +echo "LORENE_LIBS = ${LORENE_LIBS}" +echo 'HOME_LORENE = $(LORENE_DIR)' +echo "END MAKE_DEFINITION" + +echo 'INCLUDE_DIRECTORY $(LORENE_INC_DIRS)' +echo 'LIBRARY_DIRECTORY $(LORENE_LIB_DIRS)' +echo 'LIBRARY $(LORENE_LIBS)' diff --git a/README b/README new file mode 100644 index 0000000..23cfea3 --- /dev/null +++ b/README @@ -0,0 +1,15 @@ +Cactus Code Thorn LORENE +Author(s) : Erik Schnetter +Maintainer(s): Cactus team +Licence : GPL +-------------------------------------------------------------------------- + +1. Purpose + +Distribute the LORENE library; see . + + + +From the web site: + +LORENE is ###TODO### diff --git a/configuration.ccl b/configuration.ccl new file mode 100644 index 0000000..b62db6d --- /dev/null +++ b/configuration.ccl @@ -0,0 +1,9 @@ +# Configuration definitions for thorn LORENE + +PROVIDES LORENE +{ + SCRIPT LORENE.sh + LANG bash +} + +REQUIRES LAPACK BLAS GSL diff --git a/dist/LORENE.tar.gz b/dist/LORENE.tar.gz new file mode 100644 index 0000000..ab27be6 Binary files /dev/null and b/dist/LORENE.tar.gz differ diff --git a/dist/README b/dist/README new file mode 100644 index 0000000..bbb10bb --- /dev/null +++ b/dist/README @@ -0,0 +1,10 @@ +This tarball LORENE.tar.gz is created in the following way: + +1. Check out LORENE from CVS into a directory LORENE. + +2. Do not begin to build LORENE in this directory, as this would + modify the source tree. (It would add additional files.) + +3. Create the tarball from this source tree. + +4. Test whether the patches apply cleanly. diff --git a/dist/darwin.patch b/dist/darwin.patch new file mode 100644 index 0000000..66573ff --- /dev/null +++ b/dist/darwin.patch @@ -0,0 +1,30 @@ +diff -ru /Users/eschnett/src/LORENE/C++/Include/nbr_spx.h LORENE/C++/Include/nbr_spx.h +--- /Users/eschnett/src/LORENE/C++/Include/nbr_spx.h 2007-06-16 17:19:23.000000000 -0500 ++++ LORENE/C++/Include/nbr_spx.h 2009-11-21 17:46:49.000000000 -0600 +@@ -151,6 +151,10 @@ + #include + #define __infinity INFINITY + #else ++#ifdef __x86_64__ ++#include ++#define __infinity INFINITY ++#else + extern double __infinity ; + #endif + #endif +@@ -158,5 +162,6 @@ + #endif + #endif + #endif ++#endif + + #endif +diff -ru /Users/eschnett/src/LORENE/Makefile LORENE/Makefile +--- /Users/eschnett/src/LORENE/Makefile 2004-03-26 08:00:21.000000000 -0600 ++++ LORENE/Makefile 2009-11-21 17:43:37.000000000 -0600 +@@ -29,4 +29,4 @@ + test: + cd Test; $(MAKE) + +- ++.PHONY: all install doc cpp fortran export uninstall test diff --git a/interface.ccl b/interface.ccl new file mode 100644 index 0000000..3dfaaf8 --- /dev/null +++ b/interface.ccl @@ -0,0 +1,3 @@ +# Interface definition for thorn LORENE + +IMPLEMENTS: LORENE diff --git a/param.ccl b/param.ccl new file mode 100644 index 0000000..5501a88 --- /dev/null +++ b/param.ccl @@ -0,0 +1 @@ +# Parameter definitions for thorn LORENE diff --git a/schedule.ccl b/schedule.ccl new file mode 100644 index 0000000..26d1be7 --- /dev/null +++ b/schedule.ccl @@ -0,0 +1 @@ +# Schedule definitions for thorn LORENE diff --git a/src/make.code.defn b/src/make.code.defn new file mode 100644 index 0000000..c108fdb --- /dev/null +++ b/src/make.code.defn @@ -0,0 +1,7 @@ +# Main make.code.defn file for thorn LORENE + +# Source files in this directory +SRCS = + +# Subdirectories containing source files +SUBDIRS = -- cgit v1.2.3