From 21a8299caae4d2331551b757fa39de739ea64c45 Mon Sep 17 00:00:00 2001 From: Wolfgang Hess Date: Thu, 18 Jun 2020 14:44:58 +0200 Subject: [PATCH] Add Ubuntu 20.04 to the install scripts, CI, docs. (#1706) Signed-off-by: Wolfgang Hess --- .travis.yml | 1 + Dockerfile.focal | 32 +++++++++++++++++++ .../2d/tsdf_range_data_inserter_2d_test.cc | 4 +-- cmake/modules/FindGMock.cmake | 19 +++++++++++ docs/source/index.rst | 4 +-- scripts/install_debs_cmake.sh | 16 ++++++++-- 6 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 Dockerfile.focal diff --git a/.travis.yml b/.travis.yml index 35aa102..5ebfb69 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,6 +24,7 @@ cache: env: - LSB_RELEASE=xenial DOCKER_CACHE_FILE=/home/travis/docker/xenial-cache.tar.gz CC=gcc CXX=g++ - LSB_RELEASE=bionic DOCKER_CACHE_FILE=/home/travis/docker/bionic-cache.tar.gz CC=gcc CXX=g++ + - LSB_RELEASE=focal DOCKER_CACHE_FILE=/home/travis/docker/focal-cache.tar.gz CC=gcc CXX=g++ - LSB_RELEASE=jessie DOCKER_CACHE_FILE=/home/travis/docker/jessie-cache.tar.gz CC=gcc CXX=g++ - LSB_RELEASE=stretch DOCKER_CACHE_FILE=/home/travis/docker/stretch-cache.tar.gz CC=gcc CXX=g++ diff --git a/Dockerfile.focal b/Dockerfile.focal new file mode 100644 index 0000000..c443c18 --- /dev/null +++ b/Dockerfile.focal @@ -0,0 +1,32 @@ +# Copyright 2020 The Cartographer Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +FROM ubuntu:focal + +ARG cc +ARG cxx + +# Set the preferred C/C++ compiler toolchain, if given (otherwise default). +ENV CC=$cc +ENV CXX=$cxx + +# This base image doesn't ship with sudo, apt-utils. tzdata is installed here to avoid hanging later +# when it would wait for user input. +RUN apt-get update && apt-get install -y sudo apt-utils tzdata && rm -rf /var/lib/apt/lists/* + +COPY scripts/install_debs_cmake.sh cartographer/scripts/ +RUN cartographer/scripts/install_debs_cmake.sh && rm -rf /var/lib/apt/lists/* +COPY . cartographer +RUN cartographer/scripts/install_cartographer_cmake.sh && rm -rf cartographer diff --git a/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc b/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc index 4db939a..7e59508 100644 --- a/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc +++ b/cartographer/mapping/2d/tsdf_range_data_inserter_2d_test.cc @@ -27,7 +27,7 @@ namespace { class RangeDataInserterTest2DTSDF : public ::testing::Test { protected: RangeDataInserterTest2DTSDF() - : tsdf_(MapLimits(1., Eigen::Vector2d(0., 7.), CellLimits(8, 1)), 2.0, + : tsdf_(MapLimits(1., Eigen::Vector2d(1., 7.), CellLimits(8, 1)), 2.0, 10.0, &conversion_tables_) { auto parameter_dictionary = common::MakeDictionary( "return { " @@ -346,4 +346,4 @@ TEST_F(RangeDataInserterTest2DTSDF, InsertPointsWithDistanceCellToHit) { } // namespace } // namespace mapping -} // namespace cartographer \ No newline at end of file +} // namespace cartographer diff --git a/cmake/modules/FindGMock.cmake b/cmake/modules/FindGMock.cmake index 952679e..76cea16 100644 --- a/cmake/modules/FindGMock.cmake +++ b/cmake/modules/FindGMock.cmake @@ -30,6 +30,25 @@ if(NOT GMock_FOUND) PATHS /usr ) + if(GMOCK_LIBRARIES) + find_library(GMOCK_LIBRARY + NAMES gmock + HINTS + ENV GMOCK_DIR + PATH_SUFFIXES lib + PATHS + /usr + ) + find_library(GTEST_LIBRARY + NAMES gtest + HINTS + ENV GMOCK_DIR + PATH_SUFFIXES lib + PATHS + /usr + ) + list(APPEND GMOCK_LIBRARIES ${GMOCK_LIBRARY} ${GTEST_LIBRARY}) + endif() # Find system-wide gtest header. find_path(GTEST_INCLUDE_DIRS gtest/gtest.h diff --git a/docs/source/index.rst b/docs/source/index.rst index e466331..bdb8621 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -93,8 +93,8 @@ on systems that meet the following requirements: * 64-bit, modern CPU (e.g. 3rd generation i7) * 16 GB RAM -* Ubuntu 16.04 (Xenial), 18.04 (Bionic) -* gcc version 4.8.4, 5.4.0, 7.5.0 +* Ubuntu 16.04 (Xenial), 18.04 (Bionic), 20.04 (Focal) +* gcc version 4.8.4, 5.4.0, 7.5.0, 9.3.0 Known Issues ------------ diff --git a/scripts/install_debs_cmake.sh b/scripts/install_debs_cmake.sh index 00d72d6..fe71846 100755 --- a/scripts/install_debs_cmake.sh +++ b/scripts/install_debs_cmake.sh @@ -45,11 +45,23 @@ sudo apt-get install -y \ libgoogle-glog-dev \ liblua5.2-dev \ libsuitesparse-dev \ - ninja-build \ - python-sphinx + ninja-build + +if [[ "$(lsb_release -sc)" = "focal" ]] +then + sudo apt-get install -y python3-sphinx libgmock-dev +else + sudo apt-get install -y python-sphinx +fi # Install Ceres Solver on Ubuntu Bionic. No need to build it ourselves. if [[ "$(lsb_release -sc)" = "bionic" ]] then sudo apt-get install -y libceres-dev fi + +# Install Ceres Solver and Protocol Buffers support on Ubuntu Focal. No need to build it ourselves. +if [[ "$(lsb_release -sc)" = "focal" ]] +then + sudo apt-get install -y libceres-dev protobuf-compiler +fi