From 656e3cc6ca7e0c6ad4d7eca423e0ccc19c4d400c Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 27 Jan 2014 10:12:29 +0000 Subject: [PATCH] some more small changes, including bug fix in configure + relative linking in Makefile for spectral solver --- DAMASK_env.sh | 25 ++++++++++++++++--------- code/Makefile | 10 +++++----- configure | 2 +- installation/compile_CoreModule.py | 8 ++++---- 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/DAMASK_env.sh b/DAMASK_env.sh index 7d35e09af..04e46723d 100644 --- a/DAMASK_env.sh +++ b/DAMASK_env.sh @@ -6,6 +6,7 @@ if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == 'linux' ] else STAT=$(stat "`dirname $BASH_SOURCE`") DAMASK_ROOT=${STAT##* } + unset STAT fi if [ -f $HOME/.damask/damask.conf ]; then @@ -14,14 +15,6 @@ else source /etc/damask.conf fi -if [ "x$DAMASK_NUM_THREADS" != "x" ] - then export DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS -fi - -if [ "x$F90" != "x" ] - then export F90=$F90 -fi - # disable output in case of scp if [ ! -z "$PS1" ]; then echo @@ -29,13 +22,27 @@ if [ ! -z "$PS1" ]; then echo Max-Planck-Institut für Eisenforschung, Düsseldorf echo http://damask.mpie.de echo - echo Preparing environment ... + echo Using environment with ... echo "DAMASK installation in $DAMASK_ROOT" echo "DAMASK_NUM_THREADS=$DAMASK_NUM_THREADS" echo "F90=$F90" + echo "FFTW_ROOT=$FFTW_ROOT" + if [ "x$LAPACK_ROOT" != "x" ]; then + echo "LAPACK_ROOT=$LAPACK_ROOT" + fi + if [ "x$ACML_ROOT" != "x" ]; then + echo "ACML_ROOT=$ACML_ROOT" + fi + if [ "x$IMKL_ROOT" != "x" ]; then + echo "IMKL_ROOT=$IMKL_ROOT" + fi + echo "MARC_ROOT=$MARC_ROOT" + echo "HDF5_ROOT=$HDF5_ROOT (future use)" fi ulimit -s unlimited ulimit -c 0 ulimit -v unlimited ulimit -m unlimited export PYTHONPATH=$PYTHONPATH:$DAMASK_ROOT/lib +unset DAMASK_ROOT + diff --git a/code/Makefile b/code/Makefile index 33a881551..51265ccf0 100644 --- a/code/Makefile +++ b/code/Makefile @@ -46,7 +46,7 @@ COMPILERNAME ?= $(F90) INCLUDE_DIRS :=-I../lib LIBRARIES :=-lfftw3 -LIB_DIRS :=-L$(FFTW_ROOT)/lib +LIB_DIRS :=-L$$FFTW_ROOT/lib ifeq "$(FASTBUILD)" "YES" OPENMP := OFF @@ -94,16 +94,16 @@ IMKL_ARCH =_sequential endif ifneq "x$(IMKL_ROOT)" "x" -LIB_DIRS :=-L$(IMKL_ROOT)/lib/intel64 +LIB_DIRS :=-L$$IMKL_ROOT/lib/intel64 INCLUDE_DIRS +=-I$(IMKL_ROOT)/include LIBRARIES +=-lmkl_intel_lp64 -lmkl_core -lmkl$(ACML_ARCH) -lm -lpthread -liomp5 else ifneq "x$(ACML_ROOT)" "x" -LIB_DIRS +=-L$(ACML_ROOT)/$(F90)64$(ACML_ARCH)/lib +LIB_DIRS +=-L$$ACML_ROOT/$(F90)64$(ACML_ARCH)/lib LIBRARIES +=-lacml$(ACML_ARCH) else ifneq "x$(LAPACK_ROOT)" "x" -LIB_DIRS +=-L$(LAPACK_ROOT)/lib64 -L$(LAPACK_ROOT)/lib +LIB_DIRS +=-L$$LAPACK_ROOT/lib64 -L$$LAPACK_ROOT/lib LIBRARIES +=-llapack endif endif @@ -115,7 +115,7 @@ endif #hdf5 ifeq "$(HDF5)" "ON" LIBRARIES +=-lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -LIB_DIRS +=-L$(HDF5ROOT)/lib +LIB_DIRS +=-L$$HDF5ROOT/lib INCLUDE_DIRS +=-I$(HDF5ROOT)/include -DHDF endif diff --git a/configure b/configure index a5ad75f99..fb3ad8605 100755 --- a/configure +++ b/configure @@ -232,7 +232,7 @@ for opt, value in options.__dict__.items(): if opt == 'threads' and value !='': output.append('DAMASK_NUM_THREADS=%s\n'%value) if opt == 'blasType' and value !='': - output.append('%s_ROOT=%s\n'%(blasType,options.blasRoot)) + output.append('%s_ROOT=%s\n'%(options.blasType,options.blasRoot)) for spectralOption in options.spectraloptions: output.append(spectralOption+'\n') diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py index 2897dd734..92cb0a1db 100755 --- a/installation/compile_CoreModule.py +++ b/installation/compile_CoreModule.py @@ -32,11 +32,11 @@ compileCommand = { # see http://cens.ioc.ee/pipermail/f2py-users/2003-December/000621.html if options['IMKL_ROOT'] != '' and options['F90'] != 'gfortran': - lib_lapack = '-L%s/lib/intel64 -I%s/include -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -liomp5'%(options['IMKL_ROOT'],options['IMKL_ROOT']) + lib_lapack = '-L$IMKL_ROOT/lib/intel64 -I%s/include -lmkl_intel_lp64 -lmkl_core -lmkl_sequential -lpthread -lm -liomp5'%options['IMKL_ROOT'] elif options['ACML_ROOT'] != '': - lib_lapack = '-L%s/%s64/lib -lacml'%(options['ACML_ROOT'],options['F90']) + lib_lapack = '-L$ACML/%s64/lib -lacml'%options['F90'] elif options['LAPACK_ROOT'] != '': - lib_lapack = '-L%s/lib -L%s/lib64 -llapack'%(options['LAPACK_ROOT'],options['LAPACK_ROOT']) + lib_lapack = '-L$LAPACK_ROOT/lib -L$LAPACK_ROOT/lib64 -llapack' os.chdir(codeDir) # needed for compilation with gfortran and f2py try: @@ -66,7 +66,7 @@ cmd = 'f2py damask.core.pyf' +\ ' FEsolving.f90'+\ ' mesh.f90'+\ ' core_quit.f90'+\ - ' -L%s/lib -lfftw3'%(options['FFTW_ROOT'])+\ + ' -L$FFTW_ROOT/lib -lfftw3'+\ ' %s'%lib_lapack print('Executing: '+cmd)