diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bc27d9..b18abd8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,10 @@ endif() if(MSVC) add_compile_definitions(_USE_MATH_DEFINES) - # add_compile_options(/openmp:llvm) + add_compile_options(/bigobj) + if(BUILD_WITH_OPENMP) + add_compile_options(/openmp:llvm) + endif() endif() ############## @@ -247,6 +250,12 @@ if(BUILD_EXAMPLES) TBB::tbbmalloc PCL::PCL ) + if(MSVC) + set_target_properties(${EXAMPLE_NAME} + PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY + "${CMAKE_SOURCE_DIR}" + ) + endif() endforeach() endif() @@ -273,6 +282,13 @@ if(BUILD_TESTS) ) gtest_discover_tests(${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + + if(MSVC) + set_target_properties(${TEST_NAME} + PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY + "${CMAKE_SOURCE_DIR}" + ) + endif() endforeach() endif() diff --git a/include/small_gicp/pcl/pcl_registration.hpp b/include/small_gicp/pcl/pcl_registration.hpp index 57c14ec..fb452b4 100644 --- a/include/small_gicp/pcl/pcl_registration.hpp +++ b/include/small_gicp/pcl/pcl_registration.hpp @@ -99,8 +99,8 @@ class RegistrationPCL : public pcl::Registration>> target_tree_; ///< KdTree for target point cloud. - std::shared_ptr>> source_tree_; ///< KdTree for source point cloud. + std::shared_ptr>> target_tree_; ///< KdTree for target point cloud. + std::shared_ptr>> source_tree_; ///< KdTree for source point cloud. std::shared_ptr target_voxelmap_; ///< VoxelMap for target point cloud. std::shared_ptr source_voxelmap_; ///< VoxelMap for source point cloud. diff --git a/include/small_gicp/pcl/pcl_registration_impl.hpp b/include/small_gicp/pcl/pcl_registration_impl.hpp index 315ff67..feac506 100644 --- a/include/small_gicp/pcl/pcl_registration_impl.hpp +++ b/include/small_gicp/pcl/pcl_registration_impl.hpp @@ -44,7 +44,7 @@ void RegistrationPCL::setInputSource(const PointCloudS } pcl::Registration::setInputSource(cloud); - source_tree_ = std::make_shared>>(input_, KdTreeBuilderOMP(num_threads_)); + source_tree_ = std::make_shared>>(input_, KdTreeBuilderOMP(num_threads_)); source_covs_.clear(); source_voxelmap_.reset(); } @@ -56,7 +56,7 @@ void RegistrationPCL::setInputTarget(const PointCloudT } pcl::Registration::setInputTarget(cloud); - target_tree_ = std::make_shared>>(target_, KdTreeBuilderOMP(num_threads_)); + target_tree_ = std::make_shared>>(target_, KdTreeBuilderOMP(num_threads_)); target_covs_.clear(); target_voxelmap_.reset(); } @@ -214,7 +214,7 @@ void RegistrationPCL::computeTransformation(PointCloud estimate_covariances_omp(target_proxy, *target_tree_, k_correspondences_, num_threads_); } - Registration registration; + small_gicp::Registration registration; registration.criteria.rotation_eps = rotation_epsilon_; registration.criteria.translation_eps = transformation_epsilon_; registration.reduction.num_threads = num_threads_; diff --git a/include/small_gicp/registration/reduction_omp.hpp b/include/small_gicp/registration/reduction_omp.hpp index 8c11267..ef53c49 100644 --- a/include/small_gicp/registration/reduction_omp.hpp +++ b/include/small_gicp/registration/reduction_omp.hpp @@ -7,7 +7,11 @@ namespace small_gicp { #ifndef _OPENMP +#ifdef _WIN32 +#pragma message(__FILE__, " OpenMP is not available.Parallel reduction will be disabled.") +#else #warning "OpenMP is not available. Parallel reduction will be disabled." +#endif inline int omp_get_thread_num() { return 0; }