Built error by know bug of fast-lio
Closed this issue · 1 comments
My error:
[ 23%] Built target ImMesh_generate_messages [ 26%] Building CXX object ImMesh/CMakeFiles/ImMesh_mapping.dir/src/voxel_mapping.cpp.o /home/ibox/inmesh_ws/src/ImMesh/src/voxel_mapping.cpp: In function ‘void BuildResidualListOMP(const std::unordered_map<VOXEL_LOC, OctoTree*>&, double, double, int, const std::vector<Point_with_var>&, std::vector<ptpl>&, std::vector<Eigen::Matrix<double, 3, 1> >&)’: <command-line>: error: invalid conversion from ‘const char*’ to ‘int’ [-fpermissive] /home/ibox/inmesh_ws/src/ImMesh/src/voxel_mapping.cpp:167:26: note: in expansion of macro ‘MP_PROC_NUM’ 167 | omp_set_num_threads( MP_PROC_NUM ); | ^~~~~~~~~~~ In file included from /usr/include/eigen3/Eigen/Core:266, from /usr/include/pcl-1.10/pcl/pcl_macros.h:75, from /usr/include/pcl-1.10/pcl/pcl_base.h:46, from /usr/include/pcl-1.10/pcl/filters/filter.h:42, from /usr/include/pcl-1.10/pcl/filters/voxel_grid.h:43, from /home/ibox/inmesh_ws/src/ImMesh/src/voxel_mapping.hpp:43, from /home/ibox/inmesh_ws/src/ImMesh/src/voxel_mapping.cpp:41: /usr/lib/gcc/x86_64-linux-gnu/9/include/omp.h:111:34: note: initializing argument 1 of ‘void omp_set_num_threads(int)’ 111 | extern void omp_set_num_threads (int) __GOMP_NOTHROW; | ^~~ make[2]: *** [ImMesh/CMakeFiles/ImMesh_mapping.dir/build.make:102: ImMesh/CMakeFiles/ImMesh_mapping.dir/src/voxel_mapping.cpp.o] Error 1
Although , the fix of PROC_NUM=2 in cmakelist.txt , didn't work for me
I use x86 4cores and have FastLIo and derivates already working in the same computer without issue.
thanks!
Changed this part of the cmakelist.txt and it looks is working
message("Current CPU archtecture: ${CMAKE_SYSTEM_PROCESSOR}") if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)" ) include(ProcessorCount) ProcessorCount(N) message("Processer number: ${N}") if(N GREATER 4) add_definitions(-DMP_EN) add_definitions(-DMP_PROC_NUM=3) message("core for MP: 3") elseif(N GREATER 3) add_definitions(-DMP_EN) add_definitions(-DMP_PROC_NUM=2) message("core for MP: 2") else() add_definitions(-DMP_PROC_NUM=1) endif() else() add_definitions(-DMP_PROC_NUM=1) endif()