From a6dac1eceb0c3d24035c7087c824d0d44a2e9886 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 24 Jan 2014 13:15:01 +0000 Subject: [PATCH] fixed lib to use new config file --- installation/compile_CoreModule.py | 2 +- lib/damask/environment.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py index 2042b6737..2897dd734 100755 --- a/installation/compile_CoreModule.py +++ b/installation/compile_CoreModule.py @@ -22,7 +22,7 @@ for option in ['IMKL_ROOT','ACML_ROOT','LAPACK_ROOT','FFTW_ROOT','F90']: compilers = ['ifort','gfortran'] if options['F90'] not in compilers: sys.exit('compiler "F90" (in installation/options or as Shell variable) has to be one out of: %s'%(', '.join(compilers))) -print 'Argument List:', str(sys.argv) + compileCommand = { '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%s/lib"'%damaskEnv.rootDir(), diff --git a/lib/damask/environment.py b/lib/damask/environment.py index 460036963..558a2c9f1 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -19,9 +19,12 @@ class Environment(): def rootDir(self): return os.path.normpath(os.path.join(os.path.realpath(__file__),'../../../')) - def get_options(self): - with open(self.relPath('installation/options')) as file: + if os.path.isfile(os.path.join(os.getenv('HOME'),'.damask/damask.conf')): + configFile = os.path.join(os.getenv('HOME'),'.damask/damask.conf') + else: + configFile = '/etc/damask.conf' + with open(self.relPath(configFile)) as file: for line in file: l = line.strip() if not (l.startswith('#') or l == ''):