HiGHS icon indicating copy to clipboard operation
HiGHS copied to clipboard

Compiling with -fPIC flag required for highspy package?

Open bpampel opened this issue 3 years ago • 2 comments

Hello,

I'm a newcomer to HiGHS and just tried to get the highspy python interface working after compilation of the library (following the steps in the README.md file, you can also find my bash script here).

When building the highspy module, (using python3 setup.py build on the highspy folder with the appropriate packages installed in a virtual environment) I encountered the following error:

relocation R_X86_64_PC32 against symbol can not be used when making a shared object when fPIC was already used; recompile with -fPIC

Indeed, adding export CXXFLAGS="-fPIC" to my install script and recompiling HiGHS has solved the issue.

Because I am not an expert at cmake and do not understand the underlying issue, I am not sure if this is specific to my system, or indeed some bug. So this is mostly feedback for the developers, feel free to directly close this or ask for further details.

Greetings Benjamin Pampel

bpampel avatar Nov 14 '22 11:11 bpampel

Thanks for this @bpampel, perhaps it will be valuable for @galabovaa

jajhall avatar Nov 14 '22 13:11 jajhall

Hi @bpampel, would you please check if our latest updated fixed this?

galabovaa avatar May 27 '23 13:05 galabovaa

The build of highspy has been updated, with a pre-release version already on PyPi and an official release coming up very soon.

"pip install . " already works from the "latest" branch and the code and new tagged version will be in master very soon too.

Please check it out and if you run into any further problems, open a new issue!

galabovaa avatar Mar 11 '24 15:03 galabovaa