diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-04-10 17:30:49 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2004-04-10 17:30:49 +0000 |
commit | e4bc137d3d91be8ca15cd7a0f56de6051821ae8c (patch) | |
tree | 846fd4947d70ae16932f90f177708236203f747b /lib | |
parent | 05d60e2ba32956256756582e95ef2ca9d4e9d851 (diff) |
Autodetect the FFTW library
git-svn-id: http://svn.cactuscode.org/flesh/trunk@3652 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/make/extras/FFTW/setup.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/lib/make/extras/FFTW/setup.sh b/lib/make/extras/FFTW/setup.sh new file mode 100755 index 00000000..40d026cd --- /dev/null +++ b/lib/make/extras/FFTW/setup.sh @@ -0,0 +1,65 @@ +#! /bin/sh +#/*@@ +# @file setup.sh +# @date Wed 03 Mar 2004 +# @author Erik Schnetter +# @desc +# Setup for an external FFTW installation +# @enddesc +# @@*/ + +choose_fftw=`echo $FFTW | tr '[:upper:]' '[:lower:]'` + +if [ "X$choose_fftw" = 'Xyes' ]; then + +echo 'Configuring with FFTW' + +# Work out FFTW's installation directory +if [ -z "$FFTW_DIR" ]; then + echo ' FFTW selected but no FFTW_DIR set. Checking some places...' + CCTK_Search FFTW_DIR '/usr /usr/local /usr/local/fftw /usr/local/packages/fftw /usr/local/apps/fftw' include/rfftw.h + if [ -z "$FFTW_DIR" ] ; then + echo ' Unable to locate the FFTW directory - please set FFTW_DIR' + exit 2 + fi + echo " Found a FFTW package in $FFTW_DIR" +else + echo " Using FFTW package in $FFTW_DIR" +fi + + +# Set platform-specific libraries +if [ -z "$FFTW_LIBS" ]; then + if test -n "$MPI" -a "$MPI" != 'none' ; then + FFTW_LIBS='rfftw_mpi fftw_mpi $(MPI_LIBS) rfftw fftw m' + else + FFTW_LIBS='rfftw fftw m' + fi +else + echo " Using FFTW libraries '$FFTW_LIBS'" +fi + +# Set the FFTW libs, libdirs and includedirs +FFTW_LIB_DIRS='$(FFTW_DIR)/lib' +FFTW_INC_DIRS='$(FFTW_DIR)/include' + + +# Write the data out to the header and make files. +CCTK_WriteLine cctk_Extradefs.h "#define CCTK_FFTW 1" + +CCTK_WriteLine make.extra.defn "FFTW_DIR = $FFTW_DIR" +CCTK_WriteLine make.extra.defn "FFTW_LIBS = $FFTW_LIBS" +CCTK_WriteLine make.extra.defn "FFTW_LIB_DIRS = $FFTW_LIB_DIRS" +CCTK_WriteLine make.extra.defn "FFTW_INC_DIRS = $FFTW_INC_DIRS" +CCTK_WriteLine make.extra.defn '' +CCTK_WriteLine make.extra.defn 'LIBS += $(FFTW_LIBS)' +CCTK_WriteLine make.extra.defn 'LIBDIRS += $(FFTW_LIB_DIRS)' +CCTK_WriteLine make.extra.defn 'SYS_INC_DIRS += $(FFTW_INC_DIRS)' + +elif [ "X$choose_fftw" != 'Xno' -a "X$choose_fftw" != 'X' ]; then + + echo " Don't understand the setting \"FFTW=$FFTW\" !" + echo ' Please set it to either "yes" or "no", or leave it blank (same as "no") !' + exit 1 + +fi |