From 986591682cb24f7fc6e577bf024a86f512fd6a1d Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Thu, 30 Jan 2014 13:07:44 +0000 Subject: [PATCH] remove equals sign in rpath definition to work with mac, changed linker options in compile_CoreModule to work with linux again, please let me know if mac doesn't work anymore (it should) --- code/Makefile | 10 +++++----- installation/compile_CoreModule.py | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/code/Makefile b/code/Makefile index e8b82791b..9ed25d11b 100644 --- a/code/Makefile +++ b/code/Makefile @@ -46,7 +46,7 @@ COMPILERNAME ?= $(F90) INCLUDE_DIRS :=-I../lib LIBRARIES :=-lfftw3 LIB_DIRS :=-L$(FFTW_ROOT)/lib -RUN_PATH :=-Wl,-rpath=$(FFTW_ROOT)/lib +RUN_PATH :=-Wl,-rpath,$(FFTW_ROOT)/lib ifeq "$(FASTBUILD)" "YES" OPENMP := OFF @@ -101,18 +101,18 @@ endif ifneq "x$(IMKL_ROOT)" "x" LIB_DIRS :=-L$(IMKL_ROOT)/lib/intel64 -RUN_PATH +=$(RUN_PATH),-rpath=$(IMKL_ROOT)/lib/intel64 +RUN_PATH +=$(RUN_PATH),-rpath,$(IMKL_ROOT)/lib/intel64 INCLUDE_DIRS +=-I$(IMKL_ROOT)/include LIBRARIES +=-lmkl_$(IMKL_COMPILER_$(F90))_lp64 -lmkl_core -lmkl_$(IMKL_ARCH) -lm -lpthread -liomp5 else ifneq "x$(ACML_ROOT)" "x" LIB_DIRS +=-L$(ACML_ROOT)/$(F90)64$(ACML_ARCH)/lib -RUN_PATH +=$(RUN_PATH),-rpath=$(ACML_ROOT)/$(F90)64$(ACML_ARCH)/lib +RUN_PATH +=$(RUN_PATH),-rpath,$(ACML_ROOT)/$(F90)64$(ACML_ARCH)/lib LIBRARIES +=-lacml$(ACML_ARCH) else ifneq "x$(LAPACK_ROOT)" "x" LIB_DIRS +=-L$(LAPACK_ROOT)/lib64 -L$(LAPACK_ROOT)/lib -RUN_PATH +=$(RUN_PATH),-rpath=$(LAPACK_ROOT)/lib64,-rpath=$(LAPACK_ROOT)/lib +RUN_PATH +=$(RUN_PATH),-rpath,$(LAPACK_ROOT)/lib64,-rpath,$(LAPACK_ROOT)/lib LIBRARIES +=-llapack endif endif @@ -122,7 +122,7 @@ endif ifeq "$(HDF5)" "ON" LIBRARIES +=-lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 LIB_DIRS +=-L$(HDF5_ROOT)/lib -RUN_PATH +=$(RUN_PATH),-rpath=$(HDF5_ROOT)/lib +RUN_PATH +=$(RUN_PATH),-rpath,$(HDF5_ROOT)/lib INCLUDE_DIRS +=-I$(HDF5_ROOT)/include -DHDF endif diff --git a/installation/compile_CoreModule.py b/installation/compile_CoreModule.py index 845e22a49..a17267398 100755 --- a/installation/compile_CoreModule.py +++ b/installation/compile_CoreModule.py @@ -45,8 +45,10 @@ compiler = { compileOptions = ' -DSpectral -DFLOAT=8 -DINT=4 -I%s/lib'%damaskEnv.rootDir() #--- this saves the path of libraries to core.so, hence it is known during runtime ---------------- -LDFLAGS = ' -undefined dynamic_lookup' # solved error: Undefined symbols for architecture x86_64: "_PyArg_ParseTupleAndKeywords" as found on https://lists.macosforge.org/pipermail/macports-dev/2013-May/022735.html -LDFLAGS += ' -shared -Wl,-rpath,%s/lib,-rpath,%s/lib64'%(options['FFTW_ROOT'],options['FFTW_ROOT']) +LDFLAGS = '-Wl,-rpath,%s/lib,-rpath,%s/lib64'%(options['FFTW_ROOT'],options['FFTW_ROOT']) +if options['F90'] == 'gfortran': + LDFLAGS += ' -shared -Wl,-undefined,dynamic_lookup' # solved error: Undefined symbols for architecture x86_64: "_PyArg_ParseTupleAndKeywords" as found on https://lists.macosforge.org/pipermail/macports-dev/2013-May/022735.html + # see http://cens.ioc.ee/pipermail/f2py-users/2003-December/000621.html if options['IMKL_ROOT']: