diff --git a/Dockerfile.trusty b/Dockerfile.trusty index c830d56..3a03254 100644 --- a/Dockerfile.trusty +++ b/Dockerfile.trusty @@ -19,5 +19,7 @@ COPY scripts/install_ceres.sh cartographer/scripts/ RUN cartographer/scripts/install_ceres.sh && rm -rf ceres-solver COPY scripts/install_proto3.sh cartographer/scripts/ RUN cartographer/scripts/install_proto3.sh && rm -rf protobuf +COPY scripts/install_grpc.sh cartographer/scripts/ +RUN cartographer/scripts/install_grpc.sh && rm -rf grpc COPY . cartographer -RUN cartographer/scripts/install_cartographer.sh && rm -rf cartographer +RUN cartographer/scripts/install_cartographer_with_grpc.sh && rm -rf cartographer diff --git a/scripts/install_cartographer_with_grpc.sh b/scripts/install_cartographer_with_grpc.sh new file mode 100755 index 0000000..14f650f --- /dev/null +++ b/scripts/install_cartographer_with_grpc.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Copyright 2017 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. + +set -o errexit +set -o verbose + +# Build and install Cartographer. +cd cartographer +mkdir build +cd build +cmake .. -DBUILD_GRPC=ON -G Ninja +ninja +ninja test +sudo ninja install diff --git a/scripts/install_grpc.sh b/scripts/install_grpc.sh new file mode 100755 index 0000000..9e02cde --- /dev/null +++ b/scripts/install_grpc.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Copyright 2017 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. + +set -o errexit +set -o verbose + +VERSION="v1.7.2" + +# Build and install gRPC. +git clone -b ${VERSION} https://github.com/grpc/grpc +cd grpc +git submodule update --init +make +sudo make install diff --git a/scripts/install_proto3.sh b/scripts/install_proto3.sh index 0fce4ac..ef82711 100755 --- a/scripts/install_proto3.sh +++ b/scripts/install_proto3.sh @@ -26,6 +26,7 @@ git checkout tags/${VERSION} mkdir build cd build cmake -G Ninja \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ -DCMAKE_BUILD_TYPE=Release \ -Dprotobuf_BUILD_TESTS=OFF \ ../cmake