ooguntola / numexpr

Automatically exported from code.google.com/p/numexpr
MIT License
0 stars 0 forks source link

Unable to build on OSX 10.7 when linking with MKL #54

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I don't know if this is an OSX 10.7 problem or a general OSX problem -- I have 
a feeling it is the latter.  Configuration is OSX 10.7.1, llvm-gcc-4.2, Python 
2.7.2, Intel MKL 10.3 Update 5

I have edited the site.cfg file to point to my install of Intel MKL:

[mkl]
library_dirs = /opt/intel/mkl/lib
include_dirs = /opt/intel/mkl/include
mkl_libs = mkl_solver_ilp64, mkl_intel_ilp64,  mkl_intel_thread, mkl_core, iomp5

However, the build fails with:

....
llvm-gcc-4.2: numexpr/interpreter.c
numexpr/interpreter.c: In function ‘NumExpr_run’:
numexpr/interpreter.c:1458: warning: comparison is always false due to limited 
range of data type
numexpr/interpreter.c:1461: warning: comparison is always false due to limited 
range of data type
numexpr/interpreter.c:1679: warning: comparison is always false due to limited 
range of data type
/Developer/usr/bin/llvm-gcc-4.2 -bundle -undefined dynamic_lookup 
-L/opt/local/lib build/temp.macosx-10.7-x86_64-2.7/numexpr/interpreter.o 
-L/opt/intel/mkl/lib 
-L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib 
-L/usr/local/lib -L/usr/lib -L/opt/local/lib -lmkl_solver_ilp64 
-lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -o 
build/lib.macosx-10.7-x86_64-2.7/numexpr/interpreter.so -Xlinker --rpath 
-Xlinker 
/opt/intel/mkl/lib:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/l
ib:/usr/local/lib:/usr/lib:/opt/local/lib
ld: unknown option: --rpath
collect2: ld returned 1 exit status
ld: unknown option: --rpath
collect2: ld returned 1 exit status
error: Command "/Developer/usr/bin/llvm-gcc-4.2 -bundle -undefined 
dynamic_lookup -L/opt/local/lib 
build/temp.macosx-10.7-x86_64-2.7/numexpr/interpreter.o -L/opt/intel/mkl/lib 
-L/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib 
-L/usr/local/lib -L/usr/lib -L/opt/local/lib -lmkl_solver_ilp64 
-lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -o 
build/lib.macosx-10.7-x86_64-2.7/numexpr/interpreter.so -Xlinker --rpath 
-Xlinker 
/opt/intel/mkl/lib:/opt/local/Library/Frameworks/Python.framework/Versions/2.7/l
ib:/usr/local/lib:/usr/lib:/opt/local/lib" failed with exit status 1

....

So It looks like --rpath is not supported on OSX.  Editing setup.py, I changed 
the reference from "--rpath" to "-rpath":

rpath_link = '-Xlinker --rpath -Xlinker %s' % library_dirs     

OSX's gcc can now build interpreter.so, however the relative paths are still 
not included correctly.  The only way numexpr will work is if DYLD_LIBRARY_PATH 
is set to the path where the Intel MKL libs reside.  However, setting 
DYLD_LIBRARY_PATH is definitely not recommended in OSX as it breaks just about 
everything.  

I'm not sure of the recommended solution in OSX for relative paths - but I'm 
sure there must be one.

Original issue reported on code.google.com by jb.black...@gmail.com on 21 Aug 2011 at 9:20

Attachments:

GoogleCodeExporter commented 9 years ago
I'd like to improve the situation for Mac OSX, but I don't have access to MKL 
on a Mac OSX box.  Anybody can offer some additional feedback here?

Original comment by fal...@gmail.com on 29 Apr 2013 at 10:27