blob: 9bdbfad3e2b0b4358aed4f49a43bedbfdcbee61c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#! /bin/bash
################################################################################
# Prepare
################################################################################
# Set up shell
set -x # Output commands
set -e # Abort on errors
# Set locations
NAME=gsl-1.12
SRCDIR=$(dirname $0)
INSTALL_DIR=${SCRATCH_BUILD}
GSL_DIR=${INSTALL_DIR}/${NAME}
# Clean up environment
unset LIBS
################################################################################
# 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 "GSL: The enclosed GSL library has already been built; doing nothing"
else
echo "GSL: Building enclosed GSL library"
echo "GSL: 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
popd
echo "GSL: Configuring..."
rm -rf ${NAME}
mkdir ${NAME}
pushd build-${NAME}/${NAME}
./configure --prefix=${GSL_DIR}
echo "GSL: Building..."
make
echo "GSL: Installing..."
make install
popd
: > done-${NAME}
echo "GSL: Done."
fi
)
################################################################################
# Configure Cactus
################################################################################
# Set options
GSL_INC_DIRS="${GSL_DIR}/include"
GSL_LIB_DIRS="${GSL_DIR}/lib"
GSL_LIBS='gsl gslcblas'
# Pass options to Cactus
echo "BEGIN MAKE_DEFINITION"
echo "HAVE_GSL = 1"
echo "GSL_DIR = ${GSL_DIR}"
echo "GSL_INC_DIRS = ${GSL_INC_DIRS}"
echo "GSL_LIB_DIRS = ${GSL_LIB_DIRS}"
echo "GSL_LIBS = ${GSL_LIBS}"
echo "END MAKE_DEFINITION"
echo 'INCLUDE_DIRECTORY $(GSL_INC_DIRS)'
echo 'LIBRARY_DIRECTORY $(GSL_LIB_DIRS)'
echo 'LIBRARY $(GSL_LIBS)'
|