Home › Forum › SOFA › Building SOFA › [SOLVED] Failing to build CGAL plugin
Tagged: 64_bits, build, CGAL, GCC, Linux_ubuntu, Plugin_other, SOFA_1912
- This topic has 4 replies, 2 voices, and was last updated 4 years, 7 months ago by Owen.
-
AuthorPosts
-
11 May 2020 at 03:36 #16150OwenBlocked
Hi SOFA community,
SOFA used to work smoothly on my computer but I had to rebuild SOFA today as I upgraded my OS to Ubuntu 20.04. Then I encountered a problem that I cannot build CGAL plugin while the rest of SOFA works fine.
A part of the command line outputs is below:
[13/19] Building CXX object applications/plugins/CGALPlugin/CMakeFiles/CGALPlugin.dir/initCGALPlugin.cpp.o FAILED: applications/plugins/CGALPlugin/CMakeFiles/CGALPlugin.dir/initCGALPlugin.cpp.o /usr/bin/c++ -DCGALPlugin_EXPORTS -DCGAL_MESH_3_VERBOSE=0 -DNDEBUG -Iinclude -I/home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin -I/home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/.. -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/src -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/../SofaSimulationCore/src -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/../SofaDefaultType/src -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/../SofaCore/src -I/home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen -I/home/owen/Softwares/sofa/src/SofaKernel/extlibs/json -I/home/owen/Softwares/sofa/src/extlibs/gtest/include -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaDefaultType/src -I/home/owen/Softwares/sofa/src/SofaKernel/SofaSimulation/../modules -I/home/owen/Softwares/sofa/src/SofaKernel/modules/SofaSimulationCore/src -I/home/owen/Softwares/sofa/src/applications/plugins/CImgPlugin/src -I/home/owen/Softwares/sofa/src/applications/plugins/CImgPlugin/extlibs/CImg/.. -Wall -W -O3 -DNDEBUG -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fPIC -DSOFA_BUILD_CGALPLUGIN -DFRAMEWORK_TEST_RESOURCES_DIR=\"/home/owen/Softwares/sofa/src/SofaKernel/SofaFramework/resources/tests\" -pthread -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -Dcimg_use_tiff -Dcimg_use_jpeg -Dcimg_use_png -DPNG_SKIP_SETJMP_CHECK -Dcimg_no_system_calls -std=gnu++11 -MD -MT applications/plugins/CGALPlugin/CMakeFiles/CGALPlugin.dir/initCGALPlugin.cpp.o -MF applications/plugins/CGALPlugin/CMakeFiles/CGALPlugin.dir/initCGALPlugin.cpp.o.d -o applications/plugins/CGALPlugin/CMakeFiles/CGALPlugin.dir/initCGALPlugin.cpp.o -c /home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/initCGALPlugin.cpp In file included from /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/Core:326, from /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/SparseCore:4, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/src/sofa/helper/StateMask.h:27, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src/sofa/core/behavior/BaseMechanicalState.h:31, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src/sofa/core/behavior/MechanicalState.h:25, from /home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/MeshGenerationFromPolyhedron.h:37, from /home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/initCGALPlugin.cpp:24: /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h: In member function ‘void Eigen::internal::gebp_kernel<LhsScalar, RhsScalar, Index, mr, nr, ConjugateLhs, ConjugateRhs>::operator()(Eigen::internal::gebp_kernel<LhsScalar, RhsScalar, Index, mr, nr, ConjugateLhs, ConjugateRhs>::ResScalar*, Index, const LhsScalar*, const RhsScalar*, Index, Index, Index, Eigen::internal::gebp_kernel<LhsScalar, RhsScalar, Index, mr, nr, ConjugateLhs, ConjugateRhs>::ResScalar, Index, Index, Index, Index, RhsScalar*)’: /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:574:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 574 | if(nr==4) traits.initAcc(C3); | ^~ /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:575:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 575 | traits.initAcc(C4); | ^~~~~~ /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:946:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 946 | if(nr==4) R3 = ploadu<ResPacket>(r3); | ^~ /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:948:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 948 | traits.acc(C0, alphav, R0); | ^~~~~~ /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:951:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] 951 | if(nr==4) traits.acc(C3, alphav, R3); | ^~ /home/owen/Softwares/sofa/src/SofaKernel/extlibs/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h:953:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ 953 | pstoreu(r0, R0); | ^~~~~~~ In file included from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src/sofa/core/BaseMapping.h:27, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src/sofa/core/Mapping.h:25, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/../SofaSimulationCore/src/sofa/simulation/Node.h:51, from /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaHelper/../SofaSimulationCore/src/sofa/simulation/Simulation.h:25, from /home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/MeshGenerationFromPolyhedron.h:39, from /home/owen/Softwares/sofa/src/applications/plugins/CGALPlugin/initCGALPlugin.cpp:24: /home/owen/Softwares/sofa/src/SofaKernel/modules/SofaCore/src/sofa/core/ConstraintParams.h: In member function ‘sofa::core::ConstraintParams& sofa::core::ConstraintParams::setX(sofa::core::ConstMultiVecCoordId)’: ... ninja: build stopped: subcommand failed.
I am using gcc 9.3.0 and ninja to build SOFA. I wanted to use clang but on cmake, an error says “/usr/bin/clang++” is not able to compile a simple test program. Don’t know if it is related to the problem I am having…
This error really frustrates me! Please send help!
Kind regards,
Owen11 May 2020 at 06:20 #16153jnbrunetModeratorHi Owen,
I’m not seeing any error message in your compilation output, only warnings. Did you truncate it?
JN
11 May 2020 at 13:42 #16158OwenBlockedHi JN,
Thank you for your reply.
Yes, the full output seems a bit too long. I just redirected it to a text file. Please find the file in the link: https://drive.google.com/open?id=1sfmqP_7E-r6_ziejZGYV-lICtGFjVBaY
Many thanks,
Owen11 May 2020 at 14:00 #16159jnbrunetModeratorHi Owen,
Looks like the CGAL plugin is compiling with the c++11 standard, whereas the version of CGAL on ubuntu 20.04 (CGAL v5.0) is using c++14 features.
I’m guessing you are using the last stable version of SOFA (19.12)? This version set the c++ standard to c++11. This has changed in the development version, the next stable release of SOFA will be using c++17.
Meanwhile, you could:
1. Install an older version of CGAL (you can look on the CGAL website to learn how to get the source code and build/install it)
2. Or, you can manually specify your compiler to use the c++14 standard by editing the file
sofa/applications/plugins/CGALPlugin/CMakeLists.txt
, and anywhere after theadd_library(${PROJECT_NAME} ...)
(line 94 on the v19.12 source code), add the following :target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14)
JN
11 May 2020 at 14:41 #16160OwenBlockedHi JN,
I tried the first suggestion and it works! You have really made my day. Thanks a million!
Best,
Owen -
AuthorPosts
- You must be logged in to reply to this topic.