-
Notifications
You must be signed in to change notification settings - Fork 145
CONFIG: add config option for LAPACK compile #352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CONFIG: add config option for LAPACK compile #352
Conversation
badf3f9
to
3126f5d
Compare
Add environment variable and setup.cfg option for compiling against external lapack. Test on travis
3126f5d
to
0da24de
Compare
@matthew-brett - i can check this against mkl later tonight, but if you download miniconda and then |
Value for lapack linking in setup.cfg now has priority over the environment variable.
Alexis - I changed the priority of the setup file and env var - OK now? |
Satra - thanks - please do get back to me if you do get time to test. |
@matthew-brett - current master and this branch still break with mkl. the problem is that numpy's get lapack_info picks up the mkl link library that is only available for developing with mkl. i've posted an issue with continuum. ContinuumIO/anaconda-issues#431 i'll probably still update my pull-request/branch for those who want to install nipy in mkl environments. |
Satra - do you mean that you get a build error when you set external lapack linking on, with the environment variable or the setup.cfg file? I assume nipy builds correctly in the default state (no env var or edits to setup.cfg)? |
@matthew-brett |
Surely calling Satra - what error are you getting? |
in the mkl setting there is an external lapack available as far as numpy is concerned, i.e. mkl. and then it picks up libraries as shown in the continuum issue that cannot be linked against (see error below). i believe @alexis-roche is correct in that if we are to rely on internal lapack, numpy's lapack-info routine should only be called when external lapack or site.cfg says so. gcc -pthread -shared -L/om/user/satra/miniconda/lib -Wl,-rpath=/om/user/satra/miniconda/lib,--no-as-needed build/temp.linux-x86_64-2.7/nipy/labs/bindings/linalg.o -L/om/user/satra/miniconda/lib -L/om/user/satra/miniconda/lib -Lbuild/temp.linux-x86_64-2.7 -lcstat -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lpython2.7 -o build/lib.linux-x86_64-2.7/nipy/labs/bindings/linalg.so
/usr/bin/ld: cannot find -lmkl_lapack95_lp64
collect2: error: ld returned 1 exit status
/usr/bin/ld: cannot find -lmkl_lapack95_lp64
collect2: error: ld returned 1 exit status
error: Command "gcc -pthread -shared -L/om/user/satra/miniconda/lib -Wl,-rpath=/om/user/satra/miniconda/lib,--no-as-needed build/temp.linux-x86_64-2.7/nipy/labs/bindings/linalg.o -L/om/user/satra/miniconda/lib -L/om/user/satra/miniconda/lib -Lbuild/temp.linux-x86_64-2.7 -lcstat -lmkl_lapack95_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lpython2.7 -o build/lib.linux-x86_64-2.7/nipy/labs/bindings/linalg.so" failed with exit status 1 |
My impression is that, whenever numpy's get lapack info is called, the external library linking options are passed on to gcc, resulting in a crash at compilation time. It may not be a problem of python not finding the libs, but rather one of passing undesired options to gcc. Am I correct? |
Satra - are you explicitly asking to link against external lapack here, with the environment variable or nipy setup.cfg file? As far as I can see, the lapack libraries and includes do not get added to the link step if you don't do that. If you do do that, it seems reasonable that this will fail at the link step, if the libraries are not available. |
@matthew-brett - i was using default master or this branch. both had the exact same effect. the default site.cfg was used.
|
these are all the places
|
Trying to sort out compiles with lapack-lite, remove references to lapack info when compiling sub-packages.
I'm just trying, with stripping all lapack references from the setup files (apart from the root nipy/labs one). Compiles / runs OK on my OSX machine, trying now on travis : https://travis-ci.org/matthew-brett/nipy/builds/78460738 |
Those compiles also look OK, so I'm adding these edits to this PR. Log for non-external compile : https://s3.amazonaws.com/archive.travis-ci.org/jobs/78460742/log.txt Log for external lapack compile : https://s3.amazonaws.com/archive.travis-ci.org/jobs/78460745/log.txt Satra - does it work now? If not, can you post the full log somewhere? |
@matthew-brett - this branch works for me now even with MKL, with the default site.cfg and no environmental variable specification - thank you. |
MRG: fix, add config for lapack compile Lapack-lite lite compiling was not working correctly, still trying to link to external lapack even if configured not to, in several places. Fix. Add configuration option to compile against external lapack.
Add environment variable and setup.cfg option for compiling against external
lapack.