introduced logic to use gfortran as default if ifort is not found

This commit is contained in:
Martin Diehl 2012-11-13 19:12:00 +00:00
parent 922042d8d5
commit c3926efd93
3 changed files with 12 additions and 11 deletions

View File

@ -38,13 +38,13 @@ SHELL = /bin/sh
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
########################################################################################
#auto values will be set by setup_code.py
FFTWROOT := auto
IMKLROOT := auto
ACMLROOT := auto
LAPACKROOT := auto
#any values will be overwritten by setup_code.py
FFTWROOT ?= auto
IMKLROOT ?= auto
ACMLROOT ?= auto
LAPACKROOT ?= auto
# if F90 empty: ifort if present, otherwise gfortran
ifeq ($(wildcard ifort),)
F90?=gfortran
else

View File

@ -76,13 +76,13 @@ content = makefile.readlines()
makefile.close()
makefile = open(os.path.join(baseDir,'Makefile'),'w')
for line in content:
m = re.match(r'(FFTW|IMKL|ACML|LAPACK)ROOT\s*:?=',line)
m = re.match(r'(FFTW|IMKL|ACML|LAPACK)ROOT\s*\?=',line)
if m:
if m.group(1).lower() in damaskEnv.pathInfo:
substitution = damaskEnv.pathInfo[m.group(1).lower()]
else:
substitution = ''
line = '%sROOT := %s\n'%(m.group(1),substitution)
line = '%sROOT ?= %s\n'%(m.group(1),substitution)
makefile.write(line)
makefile.close()

View File

@ -2,7 +2,7 @@
# Makes postprocessing routines acessible from everywhere.
import os,sys,glob,string
import os,sys,glob,string,subprocess
from damask import Environment
from optparse import OptionParser, Option
@ -41,8 +41,9 @@ compilers = ['intel','ifort','intel32','gfortran','gnu95']
parser.add_option('--F90', '--f90', dest='compiler', type='string', \
help='name of F90 compiler')
parser.set_defaults(compiler = 'ifort')
parser.set_defaults(compiler = {True:'ifort',False:'gfortran'}[\
subprocess.call(['which', 'ifort'],\
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0])
(options,filenames) = parser.parse_args()
if options.compiler not in compilers: