From 447c1e01d27ca99abc3cece7212578bfa87cee29 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Wed, 24 Jun 2020 12:18:38 +0200 Subject: [PATCH 1/4] silence warnings in 3rd party libs (pangolin, opengv, ros) --- src/calibration/calibraiton_helper.cpp | 4 ++++ src/utils/keypoints.cpp | 4 ++++ thirdparty/CMakeLists.txt | 10 ++++++++++ thirdparty/ros/CMakeLists.txt | 8 ++++++-- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/calibration/calibraiton_helper.cpp b/src/calibration/calibraiton_helper.cpp index 4a2879f..c96c74b 100644 --- a/src/calibration/calibraiton_helper.cpp +++ b/src/calibration/calibraiton_helper.cpp @@ -46,8 +46,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include #include +#pragma GCC diagnostic pop #include diff --git a/src/utils/keypoints.cpp b/src/utils/keypoints.cpp index 8625996..b66c08e 100644 --- a/src/utils/keypoints.cpp +++ b/src/utils/keypoints.cpp @@ -43,7 +43,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include +#pragma GCC diagnostic pop namespace basalt { diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 24bcf5d..f715be7 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -79,6 +79,16 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION target_compile_options(pangolin PRIVATE "-Wno-defaulted-function-deleted") endif() +# fix pangolin: clang >= 10.0 +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.0) + target_compile_options(pangolin PRIVATE "-Wno-deprecated-copy") +endif() + +# fix pangolin: GCC >= 9.0 +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) + target_compile_options(pangolin PRIVATE "-Wno-stringop-truncation;-Wno-deprecated-copy") +endif() + # check here the directories for the pangolin and opengv targets, and # confirm that the eigen-related include dirs match. foreach(_target opengv pangolin) diff --git a/thirdparty/ros/CMakeLists.txt b/thirdparty/ros/CMakeLists.txt index 7709a5f..f684b89 100644 --- a/thirdparty/ros/CMakeLists.txt +++ b/thirdparty/ros/CMakeLists.txt @@ -1,8 +1,12 @@ cmake_minimum_required(VERSION 3.2) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wno-unused-parameter -Wno-deprecated-declarations") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wno-deprecated-declarations") + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-catch-value") +endif() #find_package(catkin REQUIRED COMPONENTS cpp_common roscpp_serialization roscpp_traits rostime roslz4) find_package(Boost REQUIRED COMPONENTS date_time filesystem program_options regex) From 4034f136d7d578ceb81ccd600fa81f1fb5258330 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Wed, 24 Jun 2020 12:19:26 +0200 Subject: [PATCH 2/4] address some maybe-uninitialized warnings (GCC9) --- src/calibration/calibraiton_helper.cpp | 4 +++- src/calibration/cam_calib.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/calibration/calibraiton_helper.cpp b/src/calibration/calibraiton_helper.cpp index c96c74b..323f26d 100644 --- a/src/calibration/calibraiton_helper.cpp +++ b/src/calibration/calibraiton_helper.cpp @@ -69,7 +69,9 @@ bool estimateTransformation( for (size_t i = 0; i < corners.size(); i++) { Eigen::Vector4d tmp; - cam_calib.unproject(corners[i], tmp); + if (!cam_calib.unproject(corners[i], tmp)) { + continue; + } Eigen::Vector3d bearing = tmp.head<3>(); Eigen::Vector3d point = aprilgrid_corner_pos_3d[corner_ids[i]].head<3>(); bearing.normalize(); diff --git a/src/calibration/cam_calib.cpp b/src/calibration/cam_calib.cpp index da21587..b70f402 100644 --- a/src/calibration/cam_calib.cpp +++ b/src/calibration/cam_calib.cpp @@ -486,7 +486,8 @@ void CamCalib::initCamIntrinsics() { for (size_t j = 0; j < vio_dataset->get_num_cams(); j++) { if (!cam_initialized[j]) { std::vector pinhole_corners; - int w, h; + int w = 0; + int h = 0; for (size_t i = 0; i < vio_dataset->get_image_timestamps().size(); i += inc) { @@ -507,6 +508,8 @@ void CamCalib::initCamIntrinsics() { h = img_vec[j].img->h; } + BASALT_ASSERT(w > 0 && h > 0); + Eigen::Vector4d init_intr; bool success = CalibHelper::initializeIntrinsicsPinhole( From f039b3cc4475fb32663c19cb4d3c54fe905f1458 Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Wed, 24 Jun 2020 12:19:55 +0200 Subject: [PATCH 3/4] fix cmake typo and completely silence indentation warning (eigen) --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6c4683..e3f5c27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10) # These are disabled to avoid lot's of warnings in Eigen code with clang 10 - set(BASALT_CXX_FLAGS "${BASALT_HEADERS_CXX_FLAGS} -Wno-error=misleading-indentation -Wno-error=deprecated-copy") + set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-misleading-indentation -Wno-error=deprecated-copy") endif() # - Added TBB_USE_GLIBCXX_VERSION macro to specify the version of GNU @@ -121,7 +121,7 @@ else() if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9) # These are disabled to avoid lot's of warnings in Eigen code with gcc-9 - set(BASALT_CXX_FLAGS "${BASALT_HEADERS_CXX_FLAGS} -Wno-error=deprecated-copy") + set(BASALT_CXX_FLAGS "${BASALT_CXX_FLAGS} -Wno-error=deprecated-copy") endif() endif() From 2c07e1d660546c0b33957faf6a1c67dc69ce37ff Mon Sep 17 00:00:00 2001 From: Nikolaus Demmel Date: Wed, 24 Jun 2020 12:21:17 +0200 Subject: [PATCH 4/4] ci: add catalina jobs --- .gitlab-ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5340804..a2f7377 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -211,6 +211,24 @@ mojave-relwithdebinfo-compile: variables: BUILD_TYPE: CiRelWithDebInfo +catalina-relwithdebinfo-compile: + <<: *compile_test_definition + tags: [macos, "10.15"] + only: + - master + variables: + BUILD_TYPE: CiRelWithDebInfo + +catalina-brewclang-relwithdebinfo-compile: + <<: *compile_test_definition + tags: [macos, "10.15"] + only: + - master + variables: + BUILD_TYPE: CiRelWithDebInfo + CC: /usr/local/opt/llvm/bin/clang + CXX: /usr/local/opt/llvm/bin/clang++ + # check if clang-format would make any changes clang-format: tags: @@ -416,4 +434,4 @@ focal-repository-check: <<: *repository_check_definition variables: GIT_STRATEGY: none - REPO_NAME: focal \ No newline at end of file + REPO_NAME: focal