From 72418f7b603b445d1289d9bc97c5297285590123 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Mon, 25 Feb 2013 18:46:36 +0000 Subject: [PATCH] removed -c from options to compile_spectralSolver and added functionality to remove "-c" or "--compile" from command line arguments befor calling compile_spectralSolver --- code/setup/compile_SpectralSolver.py | 12 ++++-------- code/setup/setup_code.sh | 17 ++++++++++++++++- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/code/setup/compile_SpectralSolver.py b/code/setup/compile_SpectralSolver.py index 592ac12e5..09c93d806 100755 --- a/code/setup/compile_SpectralSolver.py +++ b/code/setup/compile_SpectralSolver.py @@ -29,13 +29,10 @@ Writes version specific files for different MARC releases, adjustes the make fil """ + string.replace('$Id$','\n','\\n') ) -parser.add_option('-c', '--compile', dest='spectralCompile', action='store_true', \ - help='compiles the spectral solver [%default]') parser.add_option('-o', '--options', dest='makeOptions', action='extend', type='string', \ metavar="KEY=VALUE", \ help='comma-separated list of options passed to Makefile when compiling spectral code') -parser.set_defaults(spectralCompile = False) parser.set_defaults(makeOptions = ['F90='+{True:'ifort',False:'gfortran'}[\ subprocess.call(['which', 'ifort'],\ stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0]]) @@ -46,8 +43,7 @@ baseDir = damaskEnv.relPath('code/') # compiling spectral code -if (options.spectralCompile): - print 'base directory:', baseDir - os.system('make --directory %s clean'%(baseDir)) - print 'make options:',' '.join(options.makeOptions) - os.system('make --directory %s %s'%(baseDir,' '.join(options.makeOptions))) \ No newline at end of file +print 'base directory:', baseDir +os.system('make --directory %s clean'%(baseDir)) +print 'make options:',' '.join(options.makeOptions) +os.system('make --directory %s %s'%(baseDir,' '.join(options.makeOptions))) diff --git a/code/setup/setup_code.sh b/code/setup/setup_code.sh index 479f34e21..970469612 100755 --- a/code/setup/setup_code.sh +++ b/code/setup/setup_code.sh @@ -1,5 +1,20 @@ #!/usr/bin/env sh ${DAMASK_ROOT}/code/setup/modify_Files.py -${DAMASK_ROOT}/code/setup/compile_SpectralSolver.py $@ +#remove -c or --compile from args an in case call compile spectral solver +compile=0 +myArgs='' +for args +do + if [ "$args" = "-c" -o "$args" = "--compile" ] + then compile=1 + else + myArgs="$myArgs $args" + fi +done +echo $myArgs +if [ "$compile" = 1 ] + then echo 'Compiling spectral solver' + ${DAMASK_ROOT}/code/setup/compile_SpectralSolver.py $myArgs +fi ${DAMASK_ROOT}/code/setup/symlink_Code.py