PHCpack icon indicating copy to clipboard operation
PHCpack copied to clipboard

recompile with -fPIC in Debian

Open bruno066 opened this issue 6 years ago • 3 comments

During the installation process, I followed step 1 to 6 of: http://homepages.math.uic.edu/~jan/phcpy_doc_html/welcome.html

and ended up with the following issue while running make phcpy2c2.so: /opt/GNAT/2018/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.3.1/ld: phcpy2c2.a(verify_solution_maps.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /opt/GNAT/2018/bin/../libexec/gcc/x86_64-pc-linux-gnu/7.3.1/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status makefile_unix:3553: recipe for target 'phcpy2c2.so' failed make[1]: *** [phcpy2c2.so] Error 1

So I should recompile using -fPIC, but what?

Please note several points/discrepancies:

  • step 1: after the installation of the gnu-ada compiler from https://www.adacore.com/download, gcc -v returns for GNAT Community and not for GNAT GPL
  • step 2: (qd libraries) has been run using -fPIC flag then make and make install
  • step 3: make phc didn't return issues

bruno066 avatar Aug 09 '18 23:08 bruno066

Thanks for reporting the updated message for gcc -v with the latest version of the gnu-ada compiler.

janverschelde avatar Aug 14 '18 22:08 janverschelde

I'm unsure to understand, is this causing the problem? What should I do? (I probably forgot many important informations for you to help me, have no hesitation to ask whatever is relevant)

bruno066 avatar Aug 15 '18 06:08 bruno066

I had the same problem and I found a way to fix it. If you did the make phc test in step 3 then try make clean in the Object directory and do make phcpy2c3.so directly (as I am using python 3.8) so in your case make phcpy2c2.so should work. I don't know why but this solved my problem.

IsayamaYoomi avatar May 13 '21 15:05 IsayamaYoomi