diff --git a/installation/mods_MarcMentat/2010.2/Marc_tools/run_h_marc b/installation/mods_MarcMentat/2010.2/Marc_tools/run_h_marc index 6ceaf6085..9479a9e4c 100644 --- a/installation/mods_MarcMentat/2010.2/Marc_tools/run_h_marc +++ b/installation/mods_MarcMentat/2010.2/Marc_tools/run_h_marc @@ -1856,8 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" @@ -2835,7 +2836,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3129,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3421,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/2010.2/Marc_tools/run_marc b/installation/mods_MarcMentat/2010.2/Marc_tools/run_marc index 45ae396f5..0d62ba016 100644 --- a/installation/mods_MarcMentat/2010.2/Marc_tools/run_marc +++ b/installation/mods_MarcMentat/2010.2/Marc_tools/run_marc @@ -1856,8 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" @@ -2835,7 +2836,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3129,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3421,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/2010.2/Marc_tools/run_mp_marc b/installation/mods_MarcMentat/2010.2/Marc_tools/run_mp_marc index 4933d94f7..c785f5fd1 100644 --- a/installation/mods_MarcMentat/2010.2/Marc_tools/run_mp_marc +++ b/installation/mods_MarcMentat/2010.2/Marc_tools/run_mp_marc @@ -1856,8 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" @@ -2835,7 +2836,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3129,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3421,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/2010/Marc_tools/run_h_marc b/installation/mods_MarcMentat/2010/Marc_tools/run_h_marc index 5d8a3ae39..12225cbb8 100644 --- a/installation/mods_MarcMentat/2010/Marc_tools/run_h_marc +++ b/installation/mods_MarcMentat/2010/Marc_tools/run_h_marc @@ -1817,8 +1817,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" then @@ -2770,7 +2771,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3061,7 +3063,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3351,7 +3354,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" diff --git a/installation/mods_MarcMentat/2010/Marc_tools/run_marc b/installation/mods_MarcMentat/2010/Marc_tools/run_marc index df8263815..66881c8db 100644 --- a/installation/mods_MarcMentat/2010/Marc_tools/run_marc +++ b/installation/mods_MarcMentat/2010/Marc_tools/run_marc @@ -1817,8 +1817,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" @@ -2771,7 +2772,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3062,7 +3064,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3352,7 +3355,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" diff --git a/installation/mods_MarcMentat/2010/Marc_tools/run_mp_marc b/installation/mods_MarcMentat/2010/Marc_tools/run_mp_marc index 2f7551b5e..7f12e0984 100644 --- a/installation/mods_MarcMentat/2010/Marc_tools/run_mp_marc +++ b/installation/mods_MarcMentat/2010/Marc_tools/run_mp_marc @@ -1817,8 +1817,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" then @@ -2770,7 +2771,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3061,7 +3063,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" @@ -3351,7 +3354,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS || \ { echo "$0: link failed for ${user:+$userobj }$objs" diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_h_marc b/installation/mods_MarcMentat/2011/Marc_tools/run_h_marc index bd5394d47..86b1285f6 100644 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_h_marc +++ b/installation/mods_MarcMentat/2011/Marc_tools/run_h_marc @@ -1856,8 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS" + FFTW="%FFTW" if test "$user" @@ -2835,7 +2836,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3129,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3421,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_marc b/installation/mods_MarcMentat/2011/Marc_tools/run_marc index aa07ebb59..2678eea82 100644 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_marc +++ b/installation/mods_MarcMentat/2011/Marc_tools/run_marc @@ -1856,9 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" - +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" then @@ -2835,7 +2835,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3128,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3420,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/2011/Marc_tools/run_mp_marc b/installation/mods_MarcMentat/2011/Marc_tools/run_mp_marc index fbc7126f6..255ecf571 100644 --- a/installation/mods_MarcMentat/2011/Marc_tools/run_mp_marc +++ b/installation/mods_MarcMentat/2011/Marc_tools/run_mp_marc @@ -1856,8 +1856,9 @@ fi # # user subroutine used # -# add BLAS options for linking (taken from ACML, AMD CORE MATH LIBRARY) - AMD_BLAS=" -L %ACMLDIR%/ifort64_mp/lib -lacml_mp" +# add BLAS and FFTW options for linking + BLAS="%BLAS%" + FFTW="%FFTW%" if test "$user" @@ -2835,7 +2836,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3127,7 +3129,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { @@ -3418,7 +3421,8 @@ then $TKLIBS \ $MRCLIBS \ $METISLIBS \ - $AMD_BLAS \ + $BLAS \ + $FFTW \ $SYSLIBS \ $SECLIBS || \ { diff --git a/installation/mods_MarcMentat/apply_DAMASK_modifications b/installation/mods_MarcMentat/apply_DAMASK_modifications index 5968cb655..717b9e755 100755 --- a/installation/mods_MarcMentat/apply_DAMASK_modifications +++ b/installation/mods_MarcMentat/apply_DAMASK_modifications @@ -32,21 +32,58 @@ done INSTALLDIR=${INSTALLDIR%/} # remove trailing slash echo "MSC installation path: $INSTALLDIR" -ACMLDIR='' +BLASDIR='' +FFTWDIR='' if [ -f $WORKINGDIR/../../lib/pathinfo ]; then + IKMLDIR=`grep ikml $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'` ACMLDIR=`grep acml $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'` -fi -while [ ! -d "$ACMLDIR" ] || [ -z "$ACMLDIR" ] -do - echo "Input path of ACML installation: [${DEFAULT_ACMLDIR}]" - read ACMLDIR - if [ -z $ACMLDIR ]; then - ACMLDIR=${DEFAULT_ACMLDIR} + LAPACKDIR=`grep lapack $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'` + FFTWDIR=`grep fftw $WORKINGDIR/../../lib/pathinfo | head -n1 | awk 'BEGIN { FS = "[ \t]+" } ; { print $2 }'` + if [ -d "$IKMLDIR" ] + BLASDIR=$IKMLDIR + BLASTYPE='IKML' + elif [ -d "$ACMLDIR" ] + BLASDIR=$ACMLDIR + BLASTYPE='ACML' + elif [ -d "$LAPACKDIR" ] + BLASDIR=$LAPACKDIR + BLASTYPE='LAPACK' fi +fi + +while [ ! -d "$BLASDIR" ] || [ -z "$BLASDIR" ] +do + echo "Input path of BLAS installation:" + read BLASDIR + echo "Input path of BLAS installation [IKML | ACML | LAPACK]:" + read BLASTYPE done -ACMLDIR=${ACMLDIR%/} # remove trailing slash -echo "ACML installation path: $ACMLDIR" +if [ ! -d "$FFTWDIR" ] + echo "error, FFTW must be installed and specified in DAMASK_ROOT/lib/pathinfo" + exit +fi + +BLASDIR=${BLASDIR%/} # remove trailing slash +FFTWDIR=${FFTWDIR%/} # remove trailing slash + +case $BLASTYPE in + IKML | ikml) + BLAS=" -mkl" + ;; + ACML | acml) + BLAS=" -L $BLASDIR/ifort64_mp/lib -lacml_mp" + ;; + LAPACK | lapack) + BLAS=" -L $BLASDIR/lib -llapack" + ;; + *) + echo "error, BLAS type must be IKML, ACML, or LAPACK" + exit + ;; +esac + +FFTW=" -L${FFTWDIR}/lib -lfftw3_threads -lfftw3" # tools echo '' @@ -61,8 +98,9 @@ for filename in 'comp_user' \ 'include_linux64'; do cp $WORKINGDIR/$VERSION/Marc_tools/$filename $theDIR echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g" - echo $theDIR/$filename | xargs perl -pi -e "s:%ACMLDIR%:${ACMLDIR}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g" + echo $theDIR/$filename | xargs perl -pi -e "s:%BLAS%:${BLAS}:g" + echo $theDIR/$filename | xargs perl -pi -e "s:%FFTW%:${FFTW}:g" echo $filename done @@ -76,7 +114,6 @@ for filename in 'edit_window' \ 'submit3'; do cp $WORKINGDIR/$VERSION/Mentat_bin/$filename $theDIR echo $theDIR/$filename | xargs perl -pi -e "s:%INSTALLDIR%:${INSTALLDIR}:g" - echo $theDIR/$filename | xargs perl -pi -e "s:%ACMLDIR%:${ACMLDIR}:g" echo $theDIR/$filename | xargs perl -pi -e "s:%VERSION%:${VERSION}:g" echo $filename done