aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2012-10-24 20:59:34 +0000
committereschnett <eschnett@5c1b1641-b641-47ec-b3d9-0f93d4c445ee>2012-10-24 20:59:34 +0000
commit8793f180d6aee6c46a4102cab30b9eb64aa87805 (patch)
tree24d52d267bb380a2da8b593e21197912e389bfd6
parent1dcaddca1babea02f5de4638034e0cc3d235ff6a (diff)
Don't use OpenMP options unless OpenMP is enabled for the build
git-svn-id: http://svn.cactuscode.org/projects/ExternalLibraries/LORENE/trunk@39 5c1b1641-b641-47ec-b3d9-0f93d4c445ee
-rw-r--r--configure.sh45
1 files changed, 31 insertions, 14 deletions
diff --git a/configure.sh b/configure.sh
index 59335a1..7e0bcad 100644
--- a/configure.sh
+++ b/configure.sh
@@ -80,8 +80,25 @@ then
if echo '' ${ARFLAGS} | grep 64 > /dev/null 2>&1; then
export OBJECT_MODE=64
fi
+
+ #######################################################################
+ # determine OPENMP_MODE from the OPENMP option
+ # if this option isn't set, then OPENMP_MODE will default to 'no'
+ OPENMP_MODE='no'
+ if test -n "${OPENMP}"; then
+
+ OPENMP=`echo ${OPENMP} | tr '[:upper:]' '[:lower:]'`
+
+ if test "${OPENMP}" != 'yes' -a "${OPENMP}" != 'no'; then
+ echo 'BEGIN ERROR'
+ echo "configure: error: Didn't recognize setting of OPENMP=\"$OPENMP\" (should be either \"yes\" or \"no\")"
+ echo 'END ERROR'
+ exit 1
+ fi
+ OPENMP_MODE="${OPENMP}"
+ fi
- echo "HDF5: Preparing directory structure..."
+ echo "LORENE: Preparing directory structure..."
mkdir build external done 2> /dev/null || true
rm -rf ${BUILD_DIR} ${INSTALL_DIR}
mkdir ${BUILD_DIR} ${INSTALL_DIR}
@@ -99,12 +116,12 @@ then
# exit code. So we use this patch to test for this
${PATCH?} -p0 < ${SRCDIR}/dist/patchtest.patch
if [ ! -e Lorene/.patch_tmp ]; then
- echo 'BEGIN ERROR'
- echo 'The version of patch is too old to understand this patch format.'
- echo 'Please set the PATCH environment variable to a more recent '
- echo 'version of the patch command.'
- echo 'END ERROR'
- exit 1
+ echo 'BEGIN ERROR'
+ echo 'The version of patch is too old to understand this patch format.'
+ echo 'Please set the PATCH environment variable to a more recent '
+ echo 'version of the patch command.'
+ echo 'END ERROR'
+ exit 1
fi
rm -f Lorene/.patch_tmp
# Prevent overly long lines
@@ -127,11 +144,11 @@ then
export HOME_LORENE=${BUILD_DIR}/${NAME}
cat > local_settings <<EOF
CXX = ${CXX}
-CXXFLAGS = ${CXXFLAGS} ${CPPFLAGS} ${CPP_OPENMP_FLAGS}
-CXXFLAGS_G = ${CXXFLAGS} ${CPPFLAGS}
+CXXFLAGS = ${CXXFLAGS} ${CPPFLAGS} $(test x${OPENMP_MODE} = xyes && echo ${CXX_OPENMP_FLAGS} ${CPP_OPENMP_FLAGS})
+CXXFLAGS_G = ${CXXFLAGS} ${CPPFLAGS} $(test x${OPENMP_MODE} = xyes && echo ${CXX_OPENMP_FLAGS} ${CPP_OPENMP_FLAGS})
F77 = ${F77}
-F77FLAGS = ${F77FLAGS} ${FIXEDF77FLAGS}
-F77FLAGS_G = ${F77FLAGS} ${FIXEDF77FLAGS}
+F77FLAGS = ${F77FLAGS} ${FIXEDF77FLAGS} $(test x${OPENMP_MODE} = xyes && echo ${F77_OPENMP_FLAGS})
+F77FLAGS_G = ${F77FLAGS} ${FIXEDF77FLAGS} $(test x${OPENMP_MODE} = xyes && echo ${F77_OPENMP_FLAGS})
INC = -I\$(HOME_LORENE)/C++/Include -I\$(HOME_LORENE)/C++/Include_extra \$(addprefix -I,${GSL_INC_DIRS})
RANLIB = ${RANLIB}
# We don't need dependencies since we always build from scratch
@@ -154,7 +171,7 @@ EOF
# (since we specified identical build options above), and we
# ignore the "debug" version.
${MAKE} cpp fortran export
-
+
echo "LORENE: Installing..."
mv ${BUILD_DIR}/${NAME}/Lib ${INSTALL_DIR}
mkdir ${INSTALL_DIR}/C++
@@ -163,10 +180,10 @@ EOF
mkdir ${INSTALL_DIR}/Export/C++
mv ${BUILD_DIR}/${NAME}/Export/C++/Include ${INSTALL_DIR}/Export/C++
popd
-
+
echo "LORENE: Cleaning up..."
rm -rf ${BUILD_DIR}
-
+
date > ${DONE_FILE}
echo "LORENE: Done."