Closed oleg-alexandrov closed 3 years ago
After compiling s2p with pip, it could not find the libraries.
I guess the compilation also fails, then? In that case, shouldn't you also add the custom paths to the headers and to the libraries so that they can be found by the compiler? (variables LIBRARY_PATH and CPATH)
Actually there have been both compile-time and run-time errors. The compile-time error can be fixed by either modifying the makefiles, or by setting CFLAGS and LDFLAGS before running the pip compilation job.
Unfortunately, even after s2p gets compiled, it still can't find the libraries when it runs. That's why LD_LIBRARY_PATH is necessary.
That is expected, I believe, because at compile time the linking is done, but the obtained executables do not record where the library they linked to was, and at loading it it tries to look it up again.
Yes, this is the normal behavior. Typically, if you install a library in a custom location, you have to add it to the three paths; because compilation, linking and runtime dynamic linking are independent steps, and each step needs to find the library.
I'll try to edit your pull request to add this information.
Sounds good. So here is for the record what I do at compile time (I had added just a hint before in the previous pull request):
export CFLAGS="-I/custom/location/include" export LDFLAGS='-L/custom/location/lib' pip install s2p
Then at run-time is the thing I wrote before.
Up to you how much detail the user may want.
I see your new changes. Thanks.
I installed the s2p dependencies with conda as I don't have root access to my system and pip cannot install libfftw3 on its own. After compiling s2p with pip, it could not find the libraries.
Then s2p throws error 127 which can be a bit mystifying. I added a note saying that one should set for the current call LD_LIBRARY_PATH.
I know this is not an ideal solution, but I don't know any better way.