mirror of https://github.com/koide3/small_gicp.git
fix omp_thread_num
This commit is contained in:
parent
61cc0e6051
commit
98f6226fb7
|
|
@ -15,6 +15,7 @@ find_package(OpenMP)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
|
||||||
|
|
||||||
|
option(BUILD_HELPER "Build helper library" ON)
|
||||||
option(BUILD_TESTS "Build test" OFF)
|
option(BUILD_TESTS "Build test" OFF)
|
||||||
option(BUILD_BENCHMARKS "Build benchmarks" OFF)
|
option(BUILD_BENCHMARKS "Build benchmarks" OFF)
|
||||||
option(BUILD_WITH_TBB "Build with TBB" ON)
|
option(BUILD_WITH_TBB "Build with TBB" ON)
|
||||||
|
|
@ -29,21 +30,28 @@ if(BUILD_WITH_MARCH_NATIVE)
|
||||||
set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS}")
|
set(CMAKE_CXX_FLAGS "-march=native ${CMAKE_CXX_FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
#############
|
||||||
|
## Install ##
|
||||||
|
#############
|
||||||
|
install(DIRECTORY include/ DESTINATION include)
|
||||||
|
|
||||||
###########
|
###########
|
||||||
## Build ##
|
## Build ##
|
||||||
###########
|
###########
|
||||||
|
|
||||||
# Helper library
|
# Helper library
|
||||||
add_library(small_gicp SHARED
|
if(BUILD_HELPER)
|
||||||
src/small_gicp/registration/registration.cpp
|
add_library(small_gicp SHARED
|
||||||
src/small_gicp/registration/registration_helper.cpp
|
src/small_gicp/registration/registration.cpp
|
||||||
)
|
src/small_gicp/registration/registration_helper.cpp
|
||||||
target_include_directories(small_gicp PUBLIC
|
)
|
||||||
include
|
target_include_directories(small_gicp PUBLIC
|
||||||
${EIGEN3_INCLUDE_DIR}
|
include
|
||||||
)
|
${EIGEN3_INCLUDE_DIR}
|
||||||
install(DIRECTORY include/ DESTINATION include)
|
)
|
||||||
install(TARGETS small_gicp DESTINATION lib)
|
install(TARGETS small_gicp DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
###############
|
###############
|
||||||
## Benchmark ##
|
## Benchmark ##
|
||||||
|
|
@ -121,6 +129,7 @@ endif()
|
||||||
## Test ##
|
## Test ##
|
||||||
##########
|
##########
|
||||||
if(BUILD_TESTS)
|
if(BUILD_TESTS)
|
||||||
|
find_package(fmt REQUIRED)
|
||||||
find_package(PCL REQUIRED)
|
find_package(PCL REQUIRED)
|
||||||
find_package(TBB REQUIRED)
|
find_package(TBB REQUIRED)
|
||||||
|
|
||||||
|
|
@ -140,7 +149,6 @@ if(BUILD_TESTS)
|
||||||
${PCL_INCLUDE_DIRS}
|
${PCL_INCLUDE_DIRS}
|
||||||
${TBB_INCLUDE_DIRS}
|
${TBB_INCLUDE_DIRS}
|
||||||
${EIGEN3_INCLUDE_DIR}
|
${EIGEN3_INCLUDE_DIR}
|
||||||
${Iridescence_INCLUDE_DIRS}
|
|
||||||
)
|
)
|
||||||
target_link_libraries(${TEST_NAME}
|
target_link_libraries(${TEST_NAME}
|
||||||
small_gicp
|
small_gicp
|
||||||
|
|
@ -148,7 +156,6 @@ if(BUILD_TESTS)
|
||||||
GTest::gtest_main
|
GTest::gtest_main
|
||||||
${PCL_LIBRARIES}
|
${PCL_LIBRARIES}
|
||||||
${TBB_LIBRARIES}
|
${TBB_LIBRARIES}
|
||||||
${Iridescence_LIBRARIES}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
gtest_discover_tests(${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
gtest_discover_tests(${TEST_NAME} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
namespace small_gicp {
|
namespace small_gicp {
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifndef _OPENMP
|
||||||
inline int omp_get_thread_num() {
|
inline int omp_get_thread_num() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@
|
||||||
#include <small_gicp/benchmark/read_points.hpp>
|
#include <small_gicp/benchmark/read_points.hpp>
|
||||||
#include <small_gicp/registration/registration_helper.hpp>
|
#include <small_gicp/registration/registration_helper.hpp>
|
||||||
|
|
||||||
#include <guik/viewer/light_viewer.hpp>
|
|
||||||
|
|
||||||
using namespace small_gicp;
|
using namespace small_gicp;
|
||||||
|
|
||||||
class RegistrationTest : public testing::Test, public testing::WithParamInterface<std::tuple<const char*, const char*>> {
|
class RegistrationTest : public testing::Test, public testing::WithParamInterface<std::tuple<const char*, const char*>> {
|
||||||
|
|
@ -185,7 +183,7 @@ INSTANTIATE_TEST_SUITE_P(
|
||||||
return sst.str();
|
return sst.str();
|
||||||
});
|
});
|
||||||
|
|
||||||
TEST_P(RegistrationTest, EmptyTest) {
|
TEST_P(RegistrationTest, RegistrationTest) {
|
||||||
const std::string factor = std::get<0>(GetParam());
|
const std::string factor = std::get<0>(GetParam());
|
||||||
const std::string reduction = std::get<1>(GetParam());
|
const std::string reduction = std::get<1>(GetParam());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue