You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the intention is to link with biocellion or other codes that require a relocatable library, use:
cmake -DCMAKE_BUILD_TYPE=Release -DCGAL_CXX_FLAGS="-shared -fPIC" .
(This will result in a core dump if the test code below is executed.)
However using
Biocellion v3.1,
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
libcgal version 5.0.2-3 amd64
this results in an error
g++ -std=c++11 -shared -Wl,-soname,libmodel.DP.SPAGENT.so -o libmodel.DP.SPAGENT.so interface_config.o interface_agent.o interface_mech_intrct.o interface_grid.o interface_output.o model_routine_config.o model_routine_grid.o model_routine_agent.o model_routine_mech_intrct.o model_routine_output.o interface_check.o tetra/CMakeFiles/tetra.dir/tetra.cpp.o -lgmp
/usr/bin/ld: tetra/CMakeFiles/tetra.dir/tetra.cpp.o: relocation R_X86_64_TPOFF32 against symbol `_ZGVZN4CGAL30Triangulation_data_structure_3INS_37Triangulation_hierarchy_vertex_base_3INS_37Triangulation_vertex_base_with_info_3INS_7Point_3INS_5EpickEEES4_NS_27Triangulation_vertex_base_3IS4_NS_30Triangulation_ds_vertex_base_3INS0_INS2_IS5_S4_NS6_IS4_NS7_IvEEEEEENS_28Triangulation_ds_cell_base_3IvEENS_14Sequential_tagEEEEEEEEEEESC_SD_E21_insert_in_small_holeIN5boost9container12small_vectorINS_8internal11CC_iteratorINS_17Compact_containerINSB_ISJ_EENS_7DefaultESS_SS_EELb0EEELm32EvvEENSN_ISt4pairISU_iELm32EvvEEEENSP_INSQ_INS1_INS2_IS5_S4_NS6_IS4_NS7_ISJ_EEEEEEEESS_SS_SS_EELb0EEERKT_RKT0_E21vertex_pair_facet_map' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: tetra/CMakeFiles/tetra.dir/tetra.cpp.o: relocation R_X86_64_PC32 against symbol `_ZZN4CGAL26get_static_error_behaviourEvE16_error_behaviour' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
make: *** [Makefile:25: libmodel.DP.SPAGENT.so] Error 1
It can be solved by changing -DCGAL_CXX_FLAGS="-shared -fPIC" to -DCMAKE_CXX_FLAGS="-shared -fPIC" in the Makefile. However this doesn't seem to be the most elegant solution, as it replaces all CXX flags added in the Makefile, rather than adding to these specifically for CGAL. However, for the use in TheCMMC/ABM-microcarriers#4, it seems to work.
The text was updated successfully, but these errors were encountered:
Currently the readme says:
However using
this results in an error
It can be solved by changing
-DCGAL_CXX_FLAGS="-shared -fPIC"
to-DCMAKE_CXX_FLAGS="-shared -fPIC"
in the Makefile. However this doesn't seem to be the most elegant solution, as it replaces all CXX flags added in the Makefile, rather than adding to these specifically for CGAL. However, for the use in TheCMMC/ABM-microcarriers#4, it seems to work.The text was updated successfully, but these errors were encountered: