reaktoro icon indicating copy to clipboard operation
reaktoro copied to clipboard

compilation error: libReaktoroDatabases.a no created as Position Independent Code

Open specmicp opened this issue 4 years ago • 2 comments

When compiling Reaktoro (main branch, gcc 11.2.1), I'm running into the following issue:

/usr/bin/ld: ../databases/libReaktoroDatabases.a(lib.cpp.o): relocation R_X86_64_32 against .bss' can not be used when making a shared object; recompile with -fPIC `

Setting set_target_properties(.... PROPERTIES POSITION_INDEPENDENT_CODE ON) on the target would make it work... but I'm not sure yet about the resource library stuff to know where it would be best suited

specmicp avatar Mar 04 '22 11:03 specmicp

Interesting. Are you following exactly the procedure outlined here:

https://reaktoro.org/installation/installation-using-cmake.html

Does your fix above completely resolves the issue?

allanleal avatar Mar 04 '22 12:03 allanleal

No, I only have miniconda install, and conda-devenv doesn't seems to work the same way in a non-base environment

I did these steps:

conda env create -f environment.yml
conda activate reaktoro
cmake -S . -B build
cmake --build build --parallel

My solution was to add -fPIC to the flags... so it should probably not be done., but compilation works

I have no error on the c++ tests (and examples), but the python tests fails (as explained on gitter)

specmicp avatar Mar 04 '22 12:03 specmicp