introduced logic to use gfortran as default if ifort is not found
This commit is contained in:
parent
922042d8d5
commit
c3926efd93
|
@ -38,13 +38,13 @@ SHELL = /bin/sh
|
||||||
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
|
# STANDARD_CHECK = checking for Fortran 2008, compiler dependend
|
||||||
########################################################################################
|
########################################################################################
|
||||||
|
|
||||||
#auto values will be set by setup_code.py
|
#any values will be overwritten by setup_code.py
|
||||||
FFTWROOT := auto
|
FFTWROOT ?= auto
|
||||||
IMKLROOT := auto
|
IMKLROOT ?= auto
|
||||||
ACMLROOT := auto
|
ACMLROOT ?= auto
|
||||||
LAPACKROOT := auto
|
LAPACKROOT ?= auto
|
||||||
|
|
||||||
|
|
||||||
|
# if F90 empty: ifort if present, otherwise gfortran
|
||||||
ifeq ($(wildcard ifort),)
|
ifeq ($(wildcard ifort),)
|
||||||
F90?=gfortran
|
F90?=gfortran
|
||||||
else
|
else
|
||||||
|
|
|
@ -76,13 +76,13 @@ content = makefile.readlines()
|
||||||
makefile.close()
|
makefile.close()
|
||||||
makefile = open(os.path.join(baseDir,'Makefile'),'w')
|
makefile = open(os.path.join(baseDir,'Makefile'),'w')
|
||||||
for line in content:
|
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:
|
||||||
if m.group(1).lower() in damaskEnv.pathInfo:
|
if m.group(1).lower() in damaskEnv.pathInfo:
|
||||||
substitution = damaskEnv.pathInfo[m.group(1).lower()]
|
substitution = damaskEnv.pathInfo[m.group(1).lower()]
|
||||||
else:
|
else:
|
||||||
substitution = ''
|
substitution = ''
|
||||||
line = '%sROOT := %s\n'%(m.group(1),substitution)
|
line = '%sROOT ?= %s\n'%(m.group(1),substitution)
|
||||||
makefile.write(line)
|
makefile.write(line)
|
||||||
makefile.close()
|
makefile.close()
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Makes postprocessing routines acessible from everywhere.
|
# Makes postprocessing routines acessible from everywhere.
|
||||||
|
|
||||||
import os,sys,glob,string
|
import os,sys,glob,string,subprocess
|
||||||
from damask import Environment
|
from damask import Environment
|
||||||
from optparse import OptionParser, Option
|
from optparse import OptionParser, Option
|
||||||
|
|
||||||
|
@ -41,8 +41,9 @@ 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 compiler')
|
||||||
|
parser.set_defaults(compiler = {True:'ifort',False:'gfortran'}[\
|
||||||
parser.set_defaults(compiler = 'ifort')
|
subprocess.call(['which', 'ifort'],\
|
||||||
|
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0])
|
||||||
(options,filenames) = parser.parse_args()
|
(options,filenames) = parser.parse_args()
|
||||||
|
|
||||||
if options.compiler not in compilers:
|
if options.compiler not in compilers:
|
||||||
|
|
Loading…
Reference in New Issue