summaryrefslogtreecommitdiff
path: root/lib/make/extras/BLAS
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-06-04 16:20:24 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2003-06-04 16:20:24 +0000
commit86de5090514e2a41b29520127654c8ec3edc5bc1 (patch)
treeb21a834909bdab4b15434ad22cd38d745920ffb1 /lib/make/extras/BLAS
parentb5056eb575178131bc9f47cb55a2b27c9daed1e9 (diff)
Jonathan Thornburg's script to configure Cactus with BLAS.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3232 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/make/extras/BLAS')
-rwxr-xr-xlib/make/extras/BLAS/setup.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/make/extras/BLAS/setup.sh b/lib/make/extras/BLAS/setup.sh
new file mode 100755
index 00000000..6af3e03c
--- /dev/null
+++ b/lib/make/extras/BLAS/setup.sh
@@ -0,0 +1,56 @@
+#! /bin/sh
+# /*@@
+# @file setup.sh
+# @date Sat May 31 17:56:34 CEST 2003
+# @author Jonathan Thornburg, borrowing ++heavily from
+# Thomas Radke's LAPACK setup.sh
+# @desc
+# Setup for compilation with the BLAS library system installation
+# See http://www.netlib.org/blas/ for more info on the BLAS.
+# @enddesc
+# @version $Header$
+# @@*/
+
+choose_blas=`echo $BLAS | tr '[:upper:]' '[:lower:]'`
+
+if test "X$choose_blas" = 'Xyes' ; then
+
+ echo 'Configuring with BLAS'
+
+ # Search for BLAS installation
+ if test -z "$BLAS_DIR"; then
+ echo 'BLAS selected but no BLAS_DIR set... Checking some places'
+ CCTK_Search BLAS_DIR '/usr/lib /usr/local/lib' libblas.a
+ if test -z "$BLAS_DIR"; then
+ CCTK_Search BLAS_DIR '/usr/lib /usr/local/lib' libblas.so
+ fi
+ if test -z "$BLAS_DIR"; then
+ echo 'Unable to locate the BLAS library - please set BLAS_DIR'
+ exit 2
+ fi
+ echo "Found a BLAS package in $BLAS_DIR"
+ elif test "$BLAS_DIR" = 'none'; then
+ # user doesn't want the library path added
+ BLAS_DIR=''
+ fi
+
+ if test -z "$BLAS_LIBS"; then
+ BLAS_LIBS='blas blas'
+ fi
+
+ # write the variables out to the header and makefiles
+ CCTK_WriteLine cctk_Extradefs.h '#define CCTK_BLAS 1'
+
+ CCTK_WriteLine make.extra.defn "BLAS_LIBS = $BLAS_LIBS $BLAS_EXTRA_LIBS m"
+ CCTK_WriteLine make.extra.defn "BLAS_LIB_DIRS = $BLAS_DIR $BLAS_EXTRA_LIB_DIRS"
+ CCTK_WriteLine make.extra.defn ''
+ CCTK_WriteLine make.extra.defn 'LIBS += $(BLAS_LIBS)'
+ CCTK_WriteLine make.extra.defn 'LIBDIRS += $(BLAS_LIB_DIRS)'
+
+elif test "X$choose_blas" != 'Xno' -a "X$choose_blas" != 'X'; then
+
+ echo "Don't understand the setting \"BLAS=$BLAS\" !"
+ echo 'Please set it to either "yes" or "no", or leave it blank (same as "no") !'
+ exit 1
+
+fi