corrected help text; tidy up; changed (corrected?) environment variable "MSC" to "MSCROOT"

This commit is contained in:
Philip Eisenlohr 2014-01-14 14:12:35 +00:00
parent db18b3c77f
commit 5b0f844e30
1 changed files with 40 additions and 39 deletions

79
configure vendored
View File

@ -34,52 +34,53 @@ Sets up the pre and post processing tools of DAMASK
)
compilers = ['ifort','gfortran']
blastypes = ['LAPACK','ACML','IMKL']
parser.add_option('--with-fc', dest='compiler', type='string', \
help='name of F90 [%default]')
parser.add_option('--with-fftw-dir', dest='fftwroot', type='string', \
help='root location of FFTW [%default]')
parser.add_option('--with-blas-lapack-dir', dest='blasdir', type='string', \
help='root location of lapack [%default]')
parser.add_option('--with-marc-dir', dest='marcdir', type='string', \
help='root location of MSC.Marc [%default]')
parser.add_option('--with-blas-type', dest='blastype', type='string', \
help='root location of LAPACK [%default]')
parser.add_option('--with-spectral-options', dest='spectraloptions', type='string', \
help='root location of LAPACK [%default]')
parser.add_option('--with-fc', dest='compiler', type='string',
help='F90 compiler [%default]')
parser.add_option('--with-marc-dir', dest='marcdir', type='string',
help='root directory of MSC.Marc [%default]')
parser.add_option('--with-fftw-dir', dest='fftwdir', type='string',
help='root directory of FFTW [%default]')
parser.add_option('--with-blas-lapack-dir', dest='blasdir', type='string',
help='root directory of LAPACK [%default]')
parser.add_option('--with-blas-type', dest='blastype', type='string',
help='type of BLAS/LAPACK library [%default]')
parser.add_option('--with-spectral-options', dest='spectraloptions', type='string',
help='options for spectral solver [%default]')
compiler = os.getenv('F90')
if compiler == None: compiler ={True:'ifort',False:'gfortran'}[\
subprocess.call(['which', 'ifort'],\
stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0]
parser.set_defaults(compiler=compiler)
parser.set_defaults(blastype='LAPACK')
parser.set_defaults(fftwroot="/usr/local")
parser.set_defaults(blasdir="/usr")
parser.set_defaults(marcdir="/msc")
parser.set_defaults(compiler = compiler)
parser.set_defaults(blastype = 'LAPACK')
parser.set_defaults(fftwdir = "/usr/local")
parser.set_defaults(blasdir = "/usr")
parser.set_defaults(marcdir = "/msc")
(options,filenames) = parser.parse_args()
options.blastype=options.blastype.upper()
options.compiler=options.compiler.lower()
blastypes=['LAPACK','ACML','IMKL']
compilers=['gfortran','ifort']
options.blastype = options.blastype.upper()
options.compiler = options.compiler.lower()
if options.blastype not in blastypes: print('Unknown BLAS type selected')
if options.compiler not in compilers: print('Unknown compiler type selected')
f=open('installation/options','r')
f2=open('installation/options.tmp','w')
for line in f.readlines():
if line[0:8]=='FFTWROOT': line='FFTWROOT='+options.fftwroot+'\n'
if line[0:3]=='MSC': line='MSC='+options.marcdir+'\n'
if line[0:3]=='F90': line='F90='+options.compiler+'\n'
if options.blastype == 'LAPACK':
if line[0:10]=='LAPACKROOT': line='LAPACKROOT='+options.blasdir+'\n'
if options.blastype == 'ACML':
if line[0:8]=='ACMLROOT': line='ACMLROOT='+options.blasdir+'\n'
if options.blastype == 'IMKL':
if line[0:8]=='IMKLROOT': line='IMKLROOT='+options.blasdir+'\n'
f2.write(line)
for spectralOption in options.spectraloptions.split():
f2.write(spectralOption+'\n')
f.close()
f2.close()
os.rename('installation/options.tmp','installation/options')
output = []
with open('installation/options','r') as f:
for line in f:
items = re.split('[= ]',line)
if items[0] == 'F90': line = '%s=%s\n'%(items[0],options.compiler)
if items[0] == 'FFTWROOT': line = '%s=%s\n'%(items[0],options.fftwdir)
if items[0] == 'MSCROOT': line = '%s=%s\n'%(items[0],options.marcdir)
for type in blastypes:
if options.blastype == type and items[0] == '%sROOT'%type:
line = '%s=%s\n'%(items[0],options.blasdir)
output.append(line)
with open('installation/options','w') as f:
for line in output:
f.write(line)