-
Notifications
You must be signed in to change notification settings - Fork 107
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
mkl error - Cannot load neither libmkl_mc3.so nor libmkl_def.so #261
Comments
My guess is that you are using g++ with MKL? I tried that on one of my systems and I couldn't figure out how to get it to work correctly. Basically got the same error you are getting. However, installing with CXX=icpc (for both galsim and tmv) did work. So I think the icpc linking step must be setting up some linking information in the libraries that g++ doesn't (by default), so at run time, it can't find the right libraries. |
Yes, I was using g++ - that may not be the best idea indeed. I reinstalled TMV with ICPC and use it to install GalSim.
I opened an issue on that: |
So do I understand correctly that with icpc, you are still getting linking errors when you do:
|
Yes, that's right. now linking looks like this:
Can we somehow traceback the import procedure in python? |
I ran all possible TMV tests and all were passed successfully. Some more debug info about that. it looks like TMV has problems loading libraries.. but why do the TMV tests work, but not in GalSim?
|
Could you please post the full output from |
Actually, this might be harder than I thought. I googled the error you were having and found a thread that ends with this comment:
I'm not sure what they mean about using static libraries though, since python usually can't handle static libraries. |
Another possibly relevant post from googling suggests adding the library mkl_mc. So maybe also try: scons EXTRA_LIBS=mkl_mc and see if that works? |
I think I fixed this on branch #261. Please try it out. Bob found a computer here at Penn with the same behavior, so I worked on it there, and I managed to fix it on that system, so hopefully it will work for you too. It turns out that there are extra libraries necessary for loading MKL from a module rather than loading from an executable. In my case it was mkl_base. The post I mentioned above suggested mkl_mc for a different system. But Intel actually make this easier starting with MKL 10.3 (which I have on mine, but not sure if you do too). They made mkl_rt (for "run time" I presume) which is supposed to include all the necessary libraries for your system, so you don't have to try a bunch of different combinations anymore. Not that you had to, but the TMV installation process tries about 15 different combinations looking for a combination that works. In the next version, I'll have it try mkl_rt first, since that should usually work. Anyway, in this branch, I added a test to the SConstruct file that checks if TMV can be loaded as a python module rather than just as an executable. If it fails, then I try adding mkl_rt (and then the other two options if that doesn't work). So if it doesn't work, it will find out much earlier in the process, rather than at run-time after compiling everything. But I think it shouldn't fail for you anymore, so please try it and let me know. |
That looks great! I am having some problems re-creating the error now, my installation is failing again. As soon as I manage to compile again I will try it. |
If the installation is failing on this branch, please post the output. It might be due to the changes I made, since I now have it check for the kind of run-time error you were seeing during the installation rather than leave you to find it afterwards. So if what I did didn't fix it for you, then it should manifest as a failed installation now. |
I managed to recreate the situation on the master branch, then I switched to #261 and got this:
config_log:
Somehow I don't have mkl_rt on my system. |
Can you tell me what |
Sure,
|
OK, it looks like you have mkl_mc. This was the next library that should have been tried after mkl_base. But you cut off the config.log for that. What happened for that attempt? (i.e. What's in config.log after what you posted above?) |
It looked fine, so I didn't include it. I see what is happening, indeed it's trying now mkl_mc.
|
That last one is the relevant test that SCons says is failing. It looks like it's linking fine, but apparently the execution is failing. Can you please run /home/kacprzak/local/bin/python2.7 < .sconf_temp/conftest_15 and post the output. |
We get the familiar error.
|
OK, I think it's because I put the mkl_mc at the beginning rather than the end. Before I make the change to the SConstruct file, try this directly, and let's see if it works. icpc -o .sconf_temp/conftest_14_mod/check_tmv.so -openmp -shared .sconf_temp/conftest_14.os -ltmv_symband -lfftw3 -ltmv -lmkl_intel_lp64 -lmkl_core -lmkl_intel_thread -lguide -lpthread -lmkl_mc Then again /home/kacprzak/local/bin/python2.7 < .sconf_temp/conftest_15 If that doesn't work, try moving mkl_mc before guide and pthread. Sometimes the libraries are finicky in where they get placed. |
I am afraid that it didn't help..
|
Can you try it without all those -L flags? They shouldn't be necessary, and it's possible they are messing up icpc's normal search path. Also, let's try linking mkl_mc3 rather than mkl_mc. Maybe that's the one your system requires. |
I think it might be it. I added mkl_mc3. It didn't matter if I put it at the beginning, before guide and pthread or at the end.
|
Great! I added that as a tested library, so try the current '#261' branch and see if it works for you. It should, but let's just make sure before we merge the changes to master. |
'import galsim' works! Thanks very much Mike! |
Great. I merged the changes into master. Closing this issue. |
As before, I am running Scientific Linux SL release 5.4 (Boron) with python 2.7.1 and mkl 11.1 046 and no root privileges (UCL Starlink).
Scons installs galsim fine.
Then when I want to import GalSim I get:
It seems that mkl libraries are missing, or were wrongly linked.
Is anyone familiar with this kind of situation?
The text was updated successfully, but these errors were encountered: