code setup now takes BLAS in order of precedence from IKML, ACML, and LAPACK.

Leave pathinfo blank for BLAS-options that are not available (like IKML typically)
This commit is contained in:
Philip Eisenlohr 2011-12-20 10:58:51 +00:00
parent 8be14ef72e
commit b0ba5f7ba3
2 changed files with 19 additions and 8 deletions

View File

@ -60,15 +60,14 @@ DEBUG5 =-stand std03/std95
######################################################################################## ########################################################################################
#auto values will be set by setup_code.py #auto values will be set by setup_code.py
FFTWROOT := auto FFTWROOT :=
ACMLROOT := auto IKMLROOT :=
ACMLROOT :=
LAPACKROOT :=
F90 ?= ifort F90 ?= ifort
COMPILERNAME ?= $(F90) COMPILERNAME ?= $(F90)
OPENMP ?= ON OPENMP ?= ON
OPTIMIZATION ?= DEFENSIVE OPTIMIZATION ?= DEFENSIVE
ifeq "$(OPTIMIZATION)" "OFF" ifeq "$(OPTIMIZATION)" "OFF"
@ -115,12 +114,19 @@ endif
LIBRARIES += -lfftw3$(FFTWPREC) LIBRARIES += -lfftw3$(FFTWPREC)
LIB_DIRS += -L$(FFTWROOT)/lib LIB_DIRS += -L$(FFTWROOT)/lib
ifdef IKMLROOT
LIBRARIES += -mkl
else
ifdef ACMLROOT ifdef ACMLROOT
LIB_DIRS += -L$(ACMLROOT)/$(F90)64$(ACML_ARCH)/lib LIB_DIRS += -L$(ACMLROOT)/$(F90)64$(ACML_ARCH)/lib
LIBRARIES += -lacml$(ACML_ARCH) LIBRARIES += -lacml$(ACML_ARCH)
else else
ifdef LAPACKROOT
LIB_DIRS += -L$(LAPACKROOT)/lib -L$(LAPACKROOT)/lib64
LIBRARIES += -llapack LIBRARIES += -llapack
endif endif
endif
endif
OPTIMIZATION_OFF_ifort :=-O0 OPTIMIZATION_OFF_ifort :=-O0

View File

@ -43,9 +43,14 @@ 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|ACML)ROOT\s*:?=',line) m = re.match(r'(FFTW|IKML|ACML|LAPACK)ROOT\s*:?=',line)
if m: line = '%sROOT := %s\n'%(m.group(1),damaskEnv.pathInfo[m.group(1).lower()]) if m:
makefile.writelines(line) 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)
makefile.write(line)
makefile.close() makefile.close()
# compiling spectral code # compiling spectral code