removed debug statements from symlink_Code.py, added autodetection for fortran compiler and disabled compiling on default

This commit is contained in:
Martin Diehl 2013-02-13 18:45:49 +00:00
parent 1496c62258
commit d715ec769b
3 changed files with 8 additions and 12 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
import os,string import os,string,subprocess
from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP from optparse import OptionParser, OptionGroup, Option, SUPPRESS_HELP
import damask import damask
@ -33,10 +33,12 @@ parser.add_option('-c', '--compile', dest='spectralCompile', action='store_true'
help='compiles the spectral solver [%default]') help='compiles the spectral solver [%default]')
parser.add_option('-o', '--options', dest='makeOptions', action='extend', type='string', \ parser.add_option('-o', '--options', dest='makeOptions', action='extend', type='string', \
metavar="KEY=VALUE", \ metavar="KEY=VALUE", \
help='comma-separated list of options passed to Makefile when compiling spectral code %default') help='comma-separated list of options passed to Makefile when compiling spectral code')
parser.set_defaults(spectralCompile = True)
parser.set_defaults(makeOptions = ['F90=ifort'])
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]])
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
damaskEnv = damask.Environment('../../') # script location relative to root damaskEnv = damask.Environment('../../') # script location relative to root

View File

@ -13,17 +13,11 @@ baseDir = damaskEnv.relPath('code/')
for dir in bin_link: for dir in bin_link:
for file in bin_link[dir]: for file in bin_link[dir]:
print baseDir
print dir
print file
src = os.path.abspath(os.path.join(baseDir,dir,file)) src = os.path.abspath(os.path.join(baseDir,dir,file))
print src
os.path.exists(src)
if os.path.exists(src): if os.path.exists(src):
sym_link = os.path.abspath(os.path.join(damaskEnv.binDir(),\ sym_link = os.path.abspath(os.path.join(damaskEnv.binDir(),\
{True: dir, {True: dir,
False:os.path.splitext(file)[0]}[file == ''])) False:os.path.splitext(file)[0]}[file == '']))
if os.path.lexists(sym_link): if os.path.lexists(sym_link): os.remove(sym_link)
os.remove(sym_link)
os.symlink(src,sym_link) os.symlink(src,sym_link)
print sym_link,'-->',src print sym_link,'-->',src

View File

@ -40,7 +40,7 @@ Sets up the pre and post processing tools of DAMASK
compilers = ['intel','ifort','intel32','gfortran','gnu95'] compilers = ['intel','ifort','intel32','gfortran','gnu95']
parser.add_option('--F90', '--f90', dest='compiler', type='string', \ parser.add_option('--F90', '--f90', dest='compiler', type='string', \
help='name of F90 compiler') help='name of F90 [%default]')
parser.set_defaults(compiler = {True:'ifort',False:'gfortran'}[\ parser.set_defaults(compiler = {True:'ifort',False:'gfortran'}[\
subprocess.call(['which', 'ifort'],\ subprocess.call(['which', 'ifort'],\
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0]) stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0])