From b0263a8aab3f4b57626c824ad9582a54e443a0b4 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 1 Feb 2013 12:21:56 +0000 Subject: [PATCH] added possibility to parse options for setup_code.sh and setup_processing.sh + other improvements in setup functionality --- ...ralSovers.py => compile_SpectralSolver.py} | 4 +++- .../{setup_Makefile.py => modify_Files.py} | 21 ++----------------- code/setup/setup_code.sh | 7 +++---- code/setup/symlink_Code.py | 3 ++- lib/pathinfo | 3 +++ processing/setup/compile_CoreModule.py | 5 ++--- processing/setup/setup_processing.sh | 6 ++++-- processing/setup/symLink_Processing.py | 4 +--- 8 files changed, 20 insertions(+), 33 deletions(-) rename code/setup/{compile_SpectralSovers.py => compile_SpectralSolver.py} (97%) rename code/setup/{setup_Makefile.py => modify_Files.py} (96%) mode change 100644 => 100755 diff --git a/code/setup/compile_SpectralSovers.py b/code/setup/compile_SpectralSolver.py similarity index 97% rename from code/setup/compile_SpectralSovers.py rename to code/setup/compile_SpectralSolver.py index d2ac5d8ce..7095126e9 100644 --- a/code/setup/compile_SpectralSovers.py +++ b/code/setup/compile_SpectralSolver.py @@ -1,6 +1,8 @@ #!/usr/bin/env python -import os,string,re,damask + +import os,string from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP +import damask # ----------------------------- class extendedOption(Option): diff --git a/code/setup/setup_Makefile.py b/code/setup/modify_Files.py old mode 100644 new mode 100755 similarity index 96% rename from code/setup/setup_Makefile.py rename to code/setup/modify_Files.py index fe576986b..71183bea8 --- a/code/setup/setup_Makefile.py +++ b/code/setup/modify_Files.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os,string,re,damask - +import os,re +import damask architectures = { 'marc': { @@ -9,7 +9,6 @@ architectures = { }, } - damaskEnv = damask.Environment('../../') # script location relative to root baseDir = damaskEnv.relPath('code/') @@ -45,19 +44,3 @@ for line in content: line = '%sROOT ?= %s\n'%(m.group(1),substitution) makefile.write(line) makefile.close() - - - - - - - - - - - - - - - - diff --git a/code/setup/setup_code.sh b/code/setup/setup_code.sh index e1b55fb0f..479f34e21 100644 --- a/code/setup/setup_code.sh +++ b/code/setup/setup_code.sh @@ -1,6 +1,5 @@ #!/usr/bin/env sh -${DAMASK_ROOT}/code/setup/setup_Makefile.py -${DAMASK_ROOT}/code/setup/compile_SpectralSovers.py -${DAMASK_ROOT}/code/setup/symlink_code.py - +${DAMASK_ROOT}/code/setup/modify_Files.py +${DAMASK_ROOT}/code/setup/compile_SpectralSolver.py $@ +${DAMASK_ROOT}/code/setup/symlink_Code.py diff --git a/code/setup/symlink_Code.py b/code/setup/symlink_Code.py index c92a1ac54..51ae09558 100644 --- a/code/setup/symlink_Code.py +++ b/code/setup/symlink_Code.py @@ -1,5 +1,6 @@ #!/usr/bin/env python -import os,string,re,damask +import os +import damask bin_link = { \ '.' : [ diff --git a/lib/pathinfo b/lib/pathinfo index a056f6a7c..984772469 100644 --- a/lib/pathinfo +++ b/lib/pathinfo @@ -1,4 +1,7 @@ # possible options are MSC, FFTW, IMKL, ACML, LAPACK +# $id$ +# A relative path (like ./fftw/ in this example) starts from $DAMASK_ROOT/lib/ +# Do not add the proceeding /lib/ to the end of the base installation path #IMKL /opt/intel/composerxe/mkl #ACML /opt/acml4.4.0 diff --git a/processing/setup/compile_CoreModule.py b/processing/setup/compile_CoreModule.py index 351e85d70..eef2700e5 100755 --- a/processing/setup/compile_CoreModule.py +++ b/processing/setup/compile_CoreModule.py @@ -68,9 +68,8 @@ damaskEnv = Environment() baseDir = damaskEnv.relPath('processing/') codeDir = damaskEnv.relPath('code/') -if 'imkl' in damaskEnv.pathInfo and damaskEnv.pathInfo['imkl'] != '': - if options.compiler=='gfortran': print 'GNU Fortran is not supported by IKML' - lib_lapack = '-I%s/include -mkl=sequential'%(os.path.join(damaskEnv.pathInfo['imkl'])) +if 'imkl' in damaskEnv.pathInfo and damaskEnv.pathInfo['imkl'] != '' and options.compiler != 'gfortran': + lib_lapack = '-L%s/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm'%(os.path.join(damaskEnv.pathInfo['imkl'])) elif 'acml' in damaskEnv.pathInfo and damaskEnv.pathInfo['acml'] != '': lib_lapack = '-L%s/%s64/lib -lacml'%(os.path.join(damaskEnv.pathInfo['acml']),compiler) elif 'lapack' in damaskEnv.pathInfo and damaskEnv.pathInfo['lapack'] != '': diff --git a/processing/setup/setup_processing.sh b/processing/setup/setup_processing.sh index 183b2310b..0beb002bb 100755 --- a/processing/setup/setup_processing.sh +++ b/processing/setup/setup_processing.sh @@ -1,3 +1,5 @@ #!/usr/bin/env sh -${DAMASK_ROOT}/processing/setup/compile_CoreModule.py -${DAMASK_ROOT}/processing/setup/symLink_Processing.py \ No newline at end of file + +${DAMASK_ROOT}/processing/setup/symLink_Processing.py +${DAMASK_ROOT}/processing/setup/compile_CoreModule.py $@ + diff --git a/processing/setup/symLink_Processing.py b/processing/setup/symLink_Processing.py index a8c8166eb..02cf757eb 100755 --- a/processing/setup/symLink_Processing.py +++ b/processing/setup/symLink_Processing.py @@ -1,10 +1,8 @@ #!/usr/bin/env python # Makes postprocessing routines acessible from everywhere. - -import os,glob,string +import os from damask import Environment -from optparse import OptionParser, Option damaskEnv = Environment() baseDir = damaskEnv.relPath('processing/')