added openblas as possible BLAS option

This commit is contained in:
Philip Eisenlohr 2015-11-10 16:02:20 +00:00
parent aefd8fa390
commit 7370c68936
1 changed files with 14 additions and 10 deletions

24
configure vendored
View File

@ -52,7 +52,7 @@ if compiler == None:
else 'gfortran' else 'gfortran'
#--- default option values -------------------------------------------------------------------------- #--- default option values --------------------------------------------------------------------------
BLAS_order = ['IMKL','ACML','LAPACK'] BLAS_order = ['IMKL','ACML','LAPACK','OPENBLAS']
defaults={'DAMASK_BIN':'depending on access rights', defaults={'DAMASK_BIN':'depending on access rights',
'F90':compiler, 'F90':compiler,
@ -60,11 +60,13 @@ defaults={'DAMASK_BIN':'depending on access rights',
'MSC_ROOT' :'/msc', 'MSC_ROOT' :'/msc',
'DAMASK_NUM_THREADS':4, 'DAMASK_NUM_THREADS':4,
'blasType':'LAPACK', 'blasType':'LAPACK',
'blasRoot':{'LAPACK':'/usr', 'blasRoot':{'LAPACK' :'/usr',
'ACML' :'/opt/acml5.3.1', 'ACML' :'/opt/acml6.1.0',
'IMKL' :{True:os.getenv('MKLROOT'), False:'/opt/intel/composerxe/mkl'}\ 'IMKL' : os.getenv('MKLROOT') if os.getenv('MKLROOT') else '/opt/intel/composerxe/mkl',
[os.getenv('MKLROOT') != None]}, 'OPENBLAS' :'/usr',
'spectralOptions':{}} },
'spectralOptions':{},
}
@ -113,7 +115,7 @@ parser.add_option('--with-OMP-threads','--with-omp-threads',
help='number of openMP threads [%default]') help='number of openMP threads [%default]')
parser.add_option('--with-BLAS-type','--with-blas-type', parser.add_option('--with-BLAS-type','--with-blas-type',
dest='blasType', type='string', metavar='string', dest='blasType', type='string', metavar='string',
help='type of BLAS/LAPACK library [%default]') help='type of BLAS/LAPACK library [%default] {{{}}}'.format(','.join(BLAS_order)))
parser.add_option('--with-BLAS-dir','--with-blas-dir', parser.add_option('--with-BLAS-dir','--with-blas-dir',
dest='blasRoot', type='string', metavar='string', dest='blasRoot', type='string', metavar='string',
help='root directory of BLAS/LAPACK library [%default]') help='root directory of BLAS/LAPACK library [%default]')
@ -153,6 +155,7 @@ options.blasRoot = os.path.normpath(options.blasRoot)
locations = { locations = {
'FFTW' : [os.path.join(options.fftwRoot,'lib64'),os.path.join(options.fftwRoot,'lib')], 'FFTW' : [os.path.join(options.fftwRoot,'lib64'),os.path.join(options.fftwRoot,'lib')],
'LAPACK' : [os.path.join(options.blasRoot,'lib64'),os.path.join(options.blasRoot,'lib')], 'LAPACK' : [os.path.join(options.blasRoot,'lib64'),os.path.join(options.blasRoot,'lib')],
'OPENBLAS': [os.path.join(options.blasRoot,'lib64'),os.path.join(options.blasRoot,'lib')],
'ACML' : [os.path.join(options.blasRoot,'%s64/lib'%options.compiler)], 'ACML' : [os.path.join(options.blasRoot,'%s64/lib'%options.compiler)],
'ACML_mp' : [os.path.join(options.blasRoot,'%s64_mp/lib'%options.compiler)], 'ACML_mp' : [os.path.join(options.blasRoot,'%s64_mp/lib'%options.compiler)],
'IMKL' : [os.path.join(options.blasRoot,'lib/intel64')], 'IMKL' : [os.path.join(options.blasRoot,'lib/intel64')],
@ -166,6 +169,9 @@ libraries = {
'LAPACK' : [ 'LAPACK' : [
'liblapack.so','liblapack.a','liblapack.dylib', 'liblapack.so','liblapack.a','liblapack.dylib',
], ],
'OPENBLAS' : [
'libopenblas.so','libopenblas.a','libopenblas.dylib',
],
'ACML' : [ 'ACML' : [
'libacml.so','libacml.a', 'libacml.so','libacml.a',
], ],
@ -194,13 +200,11 @@ if not os.path.isdir(options.mscRoot):
filePresent(locations['FFTW'],libraries['FFTW'],warning=True) filePresent(locations['FFTW'],libraries['FFTW'],warning=True)
if options.blasType == 'LAPACK': if options.blasType in ['LAPACK','OPENBLAS','IMKL']:
filePresent(locations[options.blasType],libraries[options.blasType],warning=True) filePresent(locations[options.blasType],libraries[options.blasType],warning=True)
elif options.blasType == 'ACML': elif options.blasType == 'ACML':
filePresent(locations[options.blasType],libraries[options.blasType],warning=True) filePresent(locations[options.blasType],libraries[options.blasType],warning=True)
filePresent(locations[options.blasType+'_mp'],libraries[options.blasType+'_mp'],warning=True) filePresent(locations[options.blasType+'_mp'],libraries[options.blasType+'_mp'],warning=True)
elif options.blasType == 'IMKL':
filePresent(locations[options.blasType],libraries[options.blasType],warning=True)
else: else:
print('Error: Unknown BLAS/LAPACK library: %s'%options.blasType) print('Error: Unknown BLAS/LAPACK library: %s'%options.blasType)
sys.exit(1) sys.exit(1)