aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@043a8217-7a68-40fe-abfd-36aa7d4fa6a8>2011-12-19 14:42:06 +0000
committereschnett <eschnett@043a8217-7a68-40fe-abfd-36aa7d4fa6a8>2011-12-19 14:42:06 +0000
commitc9ca4538978121d953d3d07f94a73ce3fef6cc74 (patch)
tree9c2028286ca64f37ae85bd6cfd6c968573f2560e
parentbe6041417469371b3731e8cb76f7ccf5a15e0322 (diff)
Don't overwrite OPENMPI_INC_DIRS and OPENMPI_LIB_DIRS.
Also reformat configure.sh to look similar to the other ExternalThorns. git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/MPI/trunk@6 043a8217-7a68-40fe-abfd-36aa7d4fa6a8
-rw-r--r--configuration.ccl2
-rw-r--r--configure.sh57
2 files changed, 35 insertions, 24 deletions
diff --git a/configuration.ccl b/configuration.ccl
index 1536fc5..7289990 100644
--- a/configuration.ccl
+++ b/configuration.ccl
@@ -4,5 +4,5 @@ PROVIDES MPI
{
SCRIPT configure.sh
LANG bash
- OPTIONS MPI OPENMPI_DIR OPENMPI_INSTALL_DIR OPENMPI_INC_DIRS OPENMPI_LIB_DIRS OPENMPI_LIBS
+ OPTIONS MPI OPENMPI_DIR OPENMPI_INC_DIRS OPENMPI_LIB_DIRS OPENMPI_LIBS OPENMPI_INSTALL_DIR
}
diff --git a/configure.sh b/configure.sh
index a1a7ec3..7a507a2 100644
--- a/configure.sh
+++ b/configure.sh
@@ -5,7 +5,9 @@
################################################################################
# Set up shell
-set -x # Output commands
+if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
+ set -x # Output commands
+fi
set -e # Abort on errors
@@ -16,7 +18,7 @@ set -e # Abort on errors
if [ -n "${MPI}" ]; then
echo 'BEGIN ERROR'
- echo "Setting the option \"MPI\" is incompatible with the OpenMPI thorn. Please remove the option MPI = ${MPI}."
+ echo "Setting the option \"MPI\" is incompatible with the OpenMPI thorn. Please remove the option MPI=${MPI}."
echo 'END ERROR'
exit 1
fi
@@ -64,9 +66,11 @@ fi
# Build
################################################################################
-if [ -z "${OPENMPI_DIR}" -o "${OPENMPI_DIR}" = 'BUILD' ]; then
+if [ -z "${OPENMPI_DIR}" \
+ -o "$(echo "${OPENMPI_DIR}" | tr '[a-z]' '[A-Z]')" = 'BUILD' ]
+then
echo "BEGIN MESSAGE"
- echo "Building OpenMPI..."
+ echo "Using bundled OpenMPI..."
echo "END MESSAGE"
# Set locations
@@ -84,20 +88,26 @@ if [ -z "${OPENMPI_DIR}" -o "${OPENMPI_DIR}" = 'BUILD' ]; then
fi
DONE_FILE=${SCRATCH_BUILD}/done/${THORN}
OPENMPI_DIR=${INSTALL_DIR}
- OPENMPI_INC_DIRS=${OPENMPI_DIR}/include
- OPENMPI_LIB_DIRS=${OPENMPI_DIR}/lib
-
-(
- exec >&2 # Redirect stdout to stderr
- set -x # Output commands
- set -e # Abort on errors
- cd ${SCRATCH_BUILD}
+
if [ -e ${DONE_FILE} -a ${DONE_FILE} -nt ${SRCDIR}/dist/${NAME}.tar.gz \
-a ${DONE_FILE} -nt ${SRCDIR}/configure.sh ]
then
- echo "OpenMPI: The enclosed OpenMPI library has already been built; doing nothing"
+ echo "BEGIN MESSAGE"
+ echo "OpenMPI has already been built; doing nothing"
+ echo "END MESSAGE"
else
- echo "OpenMPI: Building enclosed OpenMPI library"
+ echo "BEGIN MESSAGE"
+ echo "Building OpenMPI"
+ echo "END MESSAGE"
+
+ # Build in a subshell
+ (
+ exec >&2 # Redirect stdout to stderr
+ if [ "$(echo ${VERBOSE} | tr '[:upper:]' '[:lower:]')" = 'yes' ]; then
+ set -x # Output commands
+ fi
+ set -e # Abort on errors
+ cd ${SCRATCH_BUILD}
# Set up environment
if [ "${F90}" = "none" ]; then
@@ -142,16 +152,17 @@ if [ -z "${OPENMPI_DIR}" -o "${OPENMPI_DIR}" = 'BUILD' ]; then
date > ${DONE_FILE}
echo "OpenMPI: Done."
+
+ )
+
+ if (( $? )); then
+ echo 'BEGIN ERROR'
+ echo 'Error while building OpenMPI. Aborting.'
+ echo 'END ERROR'
+ exit 1
+ fi
fi
-)
-
- if (( $? )); then
- echo 'BEGIN ERROR'
- echo 'Error while building OpenMPI. Aborting.'
- echo 'END ERROR'
- exit 1
- fi
-
+
fi