more work on new installation
This commit is contained in:
parent
e025ac5952
commit
2262098ed4
|
@ -4,6 +4,7 @@ FFTWROOT=/usr/local
|
|||
LAPACKROOT=/usr
|
||||
ACMLROOT=
|
||||
IMKLROOT=
|
||||
DAMASKFORTRAN=gfortran
|
||||
|
||||
if [ "$OSTYPE" == "linux-gnu" ]
|
||||
then LOCATION=$(readlink -f "`dirname $BASH_SOURCE`")
|
||||
|
@ -27,6 +28,10 @@ if [ "x$IMKLROOT" != "x" ]
|
|||
then export IMKLROOT=${IMKLROOT}
|
||||
fi
|
||||
|
||||
if [ "x$DAMASKFORTRAN" != "x" ]
|
||||
then export F90=$DAMASKFORTRAN
|
||||
fi
|
||||
|
||||
# disable output in case of scp
|
||||
if [ ! -z "$PS1" ]; then
|
||||
echo
|
||||
|
@ -37,6 +42,7 @@ if [ ! -z "$PS1" ]; then
|
|||
echo Preparing environment ...
|
||||
echo "DAMASK_ROOT=$DAMASK_ROOT"
|
||||
echo "DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS"
|
||||
echo "F90=$F90"
|
||||
echo "prepending to LD_LIBRARY_PATH: $LD_NEW"
|
||||
fi
|
||||
ulimit -s unlimited
|
||||
|
|
|
@ -1,16 +1,49 @@
|
|||
#!/usr/bin/env python
|
||||
import os,re,subprocess,sys
|
||||
import damask
|
||||
########################################################
|
||||
# MAIN
|
||||
########################################################
|
||||
|
||||
damaskEnv = damask.Environment() # script location relative to root
|
||||
baseDir = damaskEnv.relPath('code/')
|
||||
parser = OptionParser(option_class=extendableOption, usage='%prog options', description = """
|
||||
Sets up the pre and post processing tools of DAMASK
|
||||
|
||||
# basic idea: try to get the specific locations from:
|
||||
# 1) command line option
|
||||
# 2) envinronment variable
|
||||
# 3) for F90: autodetect
|
||||
""" + string.replace('$Id$','\n','\\n')
|
||||
)
|
||||
|
||||
# then call the respective scripts with their options
|
||||
compilers = ['ifort','gfortran']
|
||||
|
||||
parser.add_option('--F90', dest='compiler', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('--FFTWROOT', dest='fftwroot', type='string', \
|
||||
help='root location of FFTW [%default]')
|
||||
parser.add_option('--LAPACKROOT', dest='lapackroot', type='string', \
|
||||
help='root location of LAPACK [%default]')
|
||||
parser.add_option('--ACMLROOT', dest='acmlroot', type='string', \
|
||||
help='root location of ACML [%default]')
|
||||
parser.add_option('--IMKLROOT', dest='imklroot', type='string', \
|
||||
help='root location of IMKL [%default]')
|
||||
|
||||
parser.set_defaults(compiler = {True:os.getenv('F90'),False:''}\
|
||||
[os.getenv('F90')!=None])
|
||||
parser.set_defaults(fftwroot = {True:os.getenv('FFTWROOT'),False:''}\
|
||||
[os.getenv('FFTWROOT')!=None])
|
||||
parser.set_defaults(lapackroot = {True:os.getenv('LAPACKROOT'),False:''}\
|
||||
[os.getenv('LAPACKROOT')!=None])
|
||||
parser.set_defaults(acmlroot = {True:os.getenv('ACMLROOT'),False:''}\
|
||||
[os.getenv('ACMLROOT')!=None])
|
||||
parser.set_defaults(imklroot = {True:os.getenv('IMKLROOT'),False:''}\
|
||||
[os.getenv('IMKLROOT')!=None])
|
||||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.compiler not in compilers:
|
||||
parser.error('compiler switch "F90" has to be one out of: %s'%(', '.join(compilers)))
|
||||
|
||||
f2py_compiler = {
|
||||
'gfortran': 'gnu95 --f90flags="-fPIC -fno-range-check -xf95-cpp-input -std=f2008 -fall-intrinsics -DSpectral -fdefault-real-8 -fdefault-double-8 -DFLOAT=8 -DINT=4 -I${DAMASK_ROOT}/lib"',
|
||||
'ifort': 'intelem --f90flags="-fPIC -fpp -stand f08 -diag-disable 5268 -assume byterecl -DSpectral -real-size 64 -integer-size 32 -DFLOAT=8 -DINT=4 -I${DAMASK_ROOT}/lib"',
|
||||
}[options.compiler]
|
||||
|
||||
# changing dirs and compiler in makefile
|
||||
compiler ={True:'ifort',False:'gfortran'}[\
|
||||
|
|
|
@ -39,16 +39,28 @@ Sets up the pre and post processing tools of DAMASK
|
|||
|
||||
compilers = ['ifort','gfortran']
|
||||
|
||||
parser.add_option('F90', dest='compiler', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('LAPACKROOT', dest='lapackroot', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('ACMLROOT', dest='acmlroot', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('IMKLROOT', dest='imklroot', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('FFTWROOT', dest='fftwroot', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('--F90', dest='compiler', type='string', \
|
||||
help='name of F90 [%default]')
|
||||
parser.add_option('--FFTWROOT', dest='fftwroot', type='string', \
|
||||
help='root location of FFTW [%default]')
|
||||
parser.add_option('--LAPACKROOT', dest='lapackroot', type='string', \
|
||||
help='root location of LAPACK [%default]')
|
||||
parser.add_option('--ACMLROOT', dest='acmlroot', type='string', \
|
||||
help='root location of ACML [%default]')
|
||||
parser.add_option('--IMKLROOT', dest='imklroot', type='string', \
|
||||
help='root location of IMKL [%default]')
|
||||
|
||||
parser.set_defaults(compiler = {True:os.getenv('F90'),False:''}\
|
||||
[os.getenv('F90')!=None])
|
||||
parser.set_defaults(fftwroot = {True:os.getenv('FFTWROOT'),False:''}\
|
||||
[os.getenv('FFTWROOT')!=None])
|
||||
parser.set_defaults(lapackroot = {True:os.getenv('LAPACKROOT'),False:''}\
|
||||
[os.getenv('LAPACKROOT')!=None])
|
||||
parser.set_defaults(acmlroot = {True:os.getenv('ACMLROOT'),False:''}\
|
||||
[os.getenv('ACMLROOT')!=None])
|
||||
parser.set_defaults(imklroot = {True:os.getenv('IMKLROOT'),False:''}\
|
||||
[os.getenv('IMKLROOT')!=None])
|
||||
|
||||
(options,filenames) = parser.parse_args()
|
||||
|
||||
if options.compiler not in compilers:
|
||||
|
@ -63,10 +75,10 @@ damaskEnv = Environment()
|
|||
baseDir = damaskEnv.relPath('installation/')
|
||||
codeDir = damaskEnv.relPath('code/')
|
||||
|
||||
if options.imklroot= '' and options.compiler != 'gfortran':
|
||||
if options.imklroot != '' and options.compiler != 'gfortran':
|
||||
lib_lapack = '-L%s/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -liomp5 -lpthread -lm'%(options.imklroot)
|
||||
elif options.acmlroot= '':
|
||||
lib_lapack = '-L%s/%s64/lib -lacml'%(options.acmlroot,compiler)
|
||||
elif options.acmlroot != '':
|
||||
lib_lapack = '-L%s/%s64/lib -lacml'%(options.acmlroot,options.compiler)
|
||||
elif options.lapackroot != '':
|
||||
lib_lapack = '-L%s -llapack'%(options.lapack) # see http://cens.ioc.ee/pipermail/f2py-users/2003-December/000621.html
|
||||
|
||||
|
|
Loading…
Reference in New Issue