-
Notifications
You must be signed in to change notification settings - Fork 2
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
run.sh fails on fresh 12.04 Ubuntu #3
Comments
Ah! The README should be updated to explain this. If blas and lapack are installed on the system, then numpy will be configured with blas and lapack support. That adds a required link dependency on those libraries. Edit run.sh and you'll find a variable named requiredBlasLibrary. For macosx, it is set to a default value, but for linux it is empty. You have to fill that in for your system. I just tested it on Ubuntu 14, and here is the value that worked for me:
By the way, in run.sh you can comment out the lines at the bottom so that the script only re-runs the linking, and that way you don't have to re-compile python and numpy each time you run the script. So it would look like:
For more information about linkage, see: http://stackoverflow.com/questions/9000164/how-to-check-blas-lapack-linkage-in-numpy-scipy You can also check the dynamic linkage on the compiled numpy modules in the build output directory, for example:
Other libraries you might need to add are /usr/lib/libcblas.a and /usr/lib/libatlas.a, and note that the order that .a library files are listed does matter. |
Another project you may be interested in is Slither. Whereas this project, NumpyBuiltinExample attempts to provide the minimal example, Slither is an automated tool to help you build frozen programs with numpy: https://github.com/bfroehle/slither |
Oh wait. Reading your error message, it looks like you don't have the init_dotblas symbol, and that means you don't have blas and lapack installed, so numpy was configured without it. You probably don't have this file either: build/numpy-1.6.2/build/lib.linux-x86_64-2.7/numpy/core/_dotblas.so So, you can either install blas and then re-run the build, or you can remove the reference to init_dotblas from |
Thanks for the updates. I have looked over the slither project, which also looks very interesting. However, in the interest of completing my test with NumpyBuiltinExample, I also went ahead with some of your suggestions, so if it is of use to you to continue supporting! I installed blas and lapack, and also gfortran.
I checked that my requiredBlasLibrary libs exist:
Unfortunately I got a similar result:
I also tried with the dotblas references commented out in the numpy_builtin.h as suggested, with this result:
|
Also, I tried to look at the linking dependencies, but there is no _dotblas.so generated in build. I studied the output of run.sh, and found this section which may be of interest:
|
Comment out lines using //, not #. |
Wow, did I do that? Obviously forgot I was editing a cpp header. :( Anyway, yes, commenting out those header lines does the job, and I can build hello and helloFrozen, run the test.py and confirm that the module loading is as expected. Also interesting to see that the statically linked interpreter is only 37Mb. Not too bad. I will keep trying with Blas and Laplack I think, as I may need them for the libraries I'm trying to get working statically. I am also going to have to try this with Scipy, which I read from the slither pages is harder, then after that I'll be trying to get it all working on Windows. |
After installing blas and lapack, did you rm the build directory completely before running run.sh again? The run.sh script might not remove anything, so maybe it did not cleanly re-configure numpy to find blas. |
Yes I thought of that and removed build. |
Perhaps it has changed in newer versions of numpy, but in the included version numpy 1.6.2 I see this comment in numpy/core/setup.py: dotblas needs ATLAS, Fortran compiled blas will not be sufficient. So try also installing libatlas-dev and then removing build and run run.sh one more time. |
I tried as you suggested, and still have the same issue with the dotblas.so not being generated. The numpy build process does seem to find a blas library:
|
The static atlas libraries are in libatlas-base-dev. I installed that, and now the _dotblas.so gets generated, but there follows some more undefined symbol stuff with the lapack stuff, which I am going to try to work through. First few:
|
Hi,
Thanks for your efforts, I really hope I can get further with your work as it looks promising.
I get the following error. I have tried installing some blas related libraries with apt (groping in the dark? Openblas and libblass stuff), but can't get past this:
/tmp/ccBgO7xE.o: In function
add_numpy_builtin': hello.c:(.text+0x5f): undefined reference to
init_dotblas'collect2: ld returned 1 exit status
I also gave it a shot having installed numpy via pip, with the same result.
Thanks,
James
The text was updated successfully, but these errors were encountered: