Home › Forum › SOFA › Building SOFA › [SOLVED] CGALPlugin install CMake
Tagged: 64_bits, GCC, MacOS, Plugin_other, SkeletonPlugin CGALPluging CMake, SOFA_2006
- This topic has 13 replies, 4 voices, and was last updated 4 years, 7 months ago by Star war.
-
AuthorPosts
-
22 April 2020 at 14:51 #15906MFitBlocked
Dear SOFA-forum,
I am trying to build the SkeletonPlugin. As I only have a pre-build version of SOFA, I tried my hand at installing SOFA through CMake. This works fine, both for the v19.12 and master version. However, ones I try to configure the CGALPlugin (which is required by the SkeletonPlugin), I get the following error:
Install prefix: /Users/mfit/sofa/build/master_experiment/install SofaDenseSolver not found, disabling HexahedronCompositeFEMForceFieldAndMass compilation. Adding collection SofaComponentAll SofaTest: optional dependency SofaPython NOT found, Python_test won't be built Adding module SofaExporter SofaPython disabled, will not compile python bindings. Adding module SofaSparseSolver -- metis was not found, SparseLDLSolver won't be built -- csparse was found, SparseLUSolver and SparseCholeskySolver will be built Adding module SofaPreconditioner Adding module SofaHaptics Adding module SofaDenseSolver Adding module SofaOpenglVisual Adding plugin CImgPlugin CImgPlugin: TIFF Image Format enabled CImgPlugin: JPEG Image Format enabled CImgPlugin: PNG Image Format enabled Adding plugin SofaMiscCollision SofaMiscModule: build all maintained sofa components. SofaMiscCollision: optional dependency SofaSphFluid not found de-activing: <SpatialGridPointModel> Adding plugin CGALPlugin CGAL VERSION = 4.7.1000 CGALPlugin: could not find image, won't build MeshGenerationFromImage_test -- PSL is an experimental feature, use it at your own risk. Adding application runSofa Write Plugin list at /Users/mfit/sofa/build/master_experiment/lib/plugin_list.conf.default CMake Deprecation Warning at CMakeLists.txt:311 (message): Deprecated components are activated (SOFA_WITH_DEPRECATED_COMPONENTS variable is ON) Configuring done
For some reason the CGALPlugin doesn’t seem to recognize the CGAL install, which I have set in the CGAL_DIR parameter in CMake. Do you have any tips on how to go further? As seen in the error message, I installed the CGAL 4.7 version. I am running MacOS, and have an UpToDate XCode install and GClang .
Thanks in advance,
MFit22 April 2020 at 15:35 #15907GuillaumeKeymasterHi,
There is no error in your output.
“CGALPlugin: could not find image, won’t build MeshGenerationFromImage_test”
This means that CGALPlugin tried to find another plugin called “image”. The plugin “image” is present in SOFA and can be activated in CMake-GUI. It is a soft dependency though, used only by the component MeshGenerationFromImage, so it shouldn’t prevent you from building and using CGALPlugin (you just won’t have MeshGenerationFromImage).To understand how this soft dependency works, see this portion of CGALPlugin CMakeLists.
Guillaume.
22 April 2020 at 15:36 #15908HugoKeymaster22 April 2020 at 17:00 #15912MFitBlockedHi @Guillaume and @Hugo,
Thanks for the feedback. I installed cgal4.7 with homebrew, seems to work fine.
I tried installing the skeleton plugin without the CGALPlugin earlier and just now, and there were no errors in configuration and generation. However, when I make the build (on top of a clean build) in the terminal I get the following error:
/Users/mfit/sofa/PlugIn/SofaSkeletonPlugin/SkeletonPlugin/initSkeletonPlugin.cpp:22:10: fatal error: 'SkeletonPlugin/config.h' file not found #include <SkeletonPlugin/config.h> ^~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. make[2]: *** [external_directories/SofaSkeletonPlugin/SkeletonPlugin/CMakeFiles/SkeletonPlugin.dir/initSkeletonPlugin.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... /Users/mfit/sofa/PlugIn/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.cpp:30:10: fatal error: 'SkeletonPlugin/config.h' file not found #include <SkeletonPlugin/config.h>
The external location of the plugin folder of Skeleton plugin is recognized (I think) and the CMakeLists.txt is opened. The config.h file is not found, giving me the impression that I am missing a crucial step in the configuration fase in CMake.
Any idea’s on continuing? The Skeleton plugin looks very promising.
Thanks again,
MFit22 April 2020 at 21:55 #15916HugoKeymasterThe file config.h.in is strange.
Try renaming it in config.hLet us know if it helps
Hugo
23 April 2020 at 08:57 #15923MFitBlockedI fixed it, with your help!
So indeed the config.h.in file needed to be renamed to config.h. That was problem 1 solved. Then I got the following error:
/usr/local/include/mpfr.h:326:42: note: expanded from macro 'MPFR_DEPRECATED' # define MPFR_DEPRECATED __attribute__ ((deprecated)) ^ In file included from /Users/mfit/SOFA_PlugIn/SkeletonPlugin/MeshSkeletonization.cpp:31: In file included from /Users/mfit/SOFA_PlugIn/SkeletonPlugin/MeshSkeletonization.inl:31: In file included from /Users/mfit/SOFA_PlugIn/SkeletonPlugin/MeshSkeletonization.h:52: In file included from /Users/mfit/Downloads/CGAL-4.7/include/CGAL/extract_mean_curvature_flow_skeleton.h:30: In file included from /Users/mfit/Downloads/CGAL-4.7/include/CGAL/Mean_curvature_flow_skeletonization.h:54: In file included from /Users/mfit/Downloads/CGAL-4.7/include/CGAL/Delaunay_triangulation_3.h:37: In file included from /Users/mfit/Downloads/CGAL-4.7/include/CGAL/Triangulation_3.h:47: In file included from /Users/mfit/Downloads/CGAL-4.7/include/CGAL/spatial_sort.h:25: /Users/mfit/Downloads/CGAL-4.7/include/CGAL/hilbert_sort.h:54:9: error: no member named 'random_shuffle' in namespace 'std'; did you mean simply 'random_shuffle'? std::random_shuffle(begin,end, rng); ^~~~~~~~~~~~~~~~~~~
Indicating to me that there was something wrong with the CGAL install. Instead of using the CGAL4.7 installed at /usr/locaal/Cellar/cgal4.7, it used the one in my download file. CGAL_DIR is specified in the cmake file. I removed all previous installations or and files of CGAL, and brew installed CGAL 5.0.2. This did the trick.
Should I inform the author of the Skeleton plugin about this?
Thanks again!
23 April 2020 at 09:14 #15924HugoKeymasterThis is a purely CGAL error, linked to the C++ version.
Please see github issue here. This has been solved but only in newer versions of CGAL.You did well to upgrade your CGAL.
Yes please, do not hesitate to notice him so that he can update the README or make a PR on the README 😉Hugo
23 April 2020 at 09:16 #1592523 April 2020 at 09:41 #15926MFitBlockedYes its working correctly!
23 April 2020 at 11:17 #15929Star warBlockedHi,
I have built the SkeletonPlugin successfully with Win10 and VS2017, and put them into the plugin file. I also add the plugin name and version in
plugin_list.conf.default
. But it failed to load this plugin in the runsofa frame. Did I miss some crucial steps?Thank you!
23 April 2020 at 11:41 #1593023 April 2020 at 12:44 #15931Star warBlockedIn the console of runsofa, I got
[PluginManager] Plugin loading failed (E:/Tools/sofa19.06-exe/plugins/SkeletonPlugin/bin/SkeletonPlugin.dll): ~
28 April 2020 at 11:45 #15968Star warBlockedI tried this plugin in Macos. And I get some errors when run “make” command.
here is the output:make:
Scanning dependencies of target SkeletonPlugin [ 33%] Building CXX object CMakeFiles/SkeletonPlugin.dir/initSkeletonPlugin.cpp.o [ 66%] Building CXX object CMakeFiles/SkeletonPlugin.dir/MeshSkeletonization.cpp.o In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.cpp:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.inl:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.h:32: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/Vec.h:27: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:27: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/vector.h:37: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/Messaging.h:81: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/MessageDispatcher.h:30: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/Message.h:38: /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:57:17: error: function definition does not declare parameters const char *filename {nullptr}; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:58:9: error: function definition does not declare parameters int line {0}; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:59:37: error: member initializer 'filename' does not name a non-static data member or base class FileInfo(const char *f, int l): filename(f), line(l) {} ^~~~~~~~~~~ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:59:50: error: member initializer 'line' does not name a non-static data member or base class FileInfo(const char *f, int l): filename(f), line(l) {} ^~~~~~~ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:62:17: error: member initializer 'filename' does not name a non-static data member or base class FileInfo(): filename(s_unknownFile), line(0) {} ^~~~~~~~~~~~~~~~~~~~~~~ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:62:42: error: member initializer 'line' does not name a non-static data member or base class FileInfo(): filename(s_unknownFile), line(0) {} ^~~~~~~ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:71:9: error: use of undeclared identifier 'filename' filename = tmp ; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:72:9: error: use of undeclared identifier 'line' line = l ; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:78:9: error: use of undeclared identifier 'filename' filename = tmp ; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:79:9: error: use of undeclared identifier 'line' line = l ; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:83:12: error: use of undeclared identifier 'filename' if(filename) ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/FileInfo.h:84:20: error: use of undeclared identifier 'filename' delete filename ; ^ In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.cpp:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.inl:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.h:32: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/Vec.h:27: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:27: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/vector.h:37: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/Messaging.h:81: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/logging/MessageDispatcher.h:32: /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/system/SofaOStream.h:136:29: error: function definition does not declare parameters logging::FileInfo::SPtr m_fileInfo {helper::logging::EmptyFileInfo}; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/system/SofaOStream.h:117:62: error: use of undeclared identifier 'm_fileInfo'; did you mean 'fileInfo'? const logging::FileInfo::SPtr& fileInfo() const { return m_fileInfo; } ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/system/SofaOStream.h:117:36: note: 'fileInfo' declared here const logging::FileInfo::SPtr& fileInfo() const { return m_fileInfo; } ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/system/SofaOStream.h:125:9: error: use of undeclared identifier 'm_fileInfo' m_fileInfo = helper::logging::EmptyFileInfo; ^ In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.cpp:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.inl:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.h:32: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/Vec.h:27: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:27: /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/helper/vector.h:100:23: error: no template named 'initializer_list' in namespace 'std' vector(const std::initializer_list<T>& t) : std::vector<T,Alloc>(t) {} ~~~~~^ In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.cpp:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.inl:31: In file included from /Users/steven/Code/sofa/sofa/v19.06/SofaSkeletonPlugin/SkeletonPlugin/MeshSkeletonization.h:32: In file included from /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/Vec.h:27: /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:1295:1: error: expected expression { ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:1297:2: error: expected a type }; ^ /Applications/runSofa.app/Contents/MacOS/include/SofaFramework/sofa/defaulttype/DataTypeInfo.h:1297:2: error: expected '{' after base class list fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. make[2]: *** [CMakeFiles/SkeletonPlugin.dir/MeshSkeletonization.cpp.o] Error 1 make[1]: *** [CMakeFiles/SkeletonPlugin.dir/all] Error 2 make: *** [all] Error 2
I succeed in running ‘cmake’, but I get a lot of errors when running ‘make’ to generate the Library. I use the latest version of Sofa 19.12 and also try to use the old version of Sofa 19.06, but when I build it by “make install or make”, I get the same errors above.
I hope to receive the instruction according to these logs. Thank you!
28 April 2020 at 14:33 #15971Star warBlockedOh, it builds successfully in C++14.
-
AuthorPosts
- You must be logged in to reply to this topic.