Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error in passing CMake flags for CGAL #4

Open
JaroCamphuijsen opened this issue Jan 25, 2021 · 0 comments
Open

Error in passing CMake flags for CGAL #4

JaroCamphuijsen opened this issue Jan 25, 2021 · 0 comments
Assignees

Comments

@JaroCamphuijsen
Copy link
Member

JaroCamphuijsen commented Jan 25, 2021

Currently the readme says:

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants