cartographer-project / cartographer

Cartographer is a system that provides real-time simultaneous localization and mapping (SLAM) in 2D and 3D across multiple platforms and sensor configurations.
Apache License 2.0
7.03k stars 2.24k forks source link

build with docker #1947

Open ttied opened 5 months ago

ttied commented 5 months ago

Hi, I'm trying to compile cartographer with grpc in a docker container.

Here is some system info:

gcc --version
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0

 uname -r
5.15.133.1-microsoft-standard-WSL2

I tried to use the existing Dockerfile.bionic.grpc

docker build --progress=plain -t cartographer_bionic_grpc -f Dockerfile.bionic.grpc`

When this did not work, i commented out the RUN lines and executed the scripts manually in the docker container

The first three scripts run successfully: cartographer/scripts/install_debs_cmake.sh cartographer/scripts/install_abseil.sh cartographer/scripts/install_proto3.sh

When trying to run cartographer/scripts/install_async_grpc.sh I get the following output:

`root@6b07de585388:/cartographer/scripts# ./install_grpc.sh

VERSION="v1.10.0"
# Digest: 474c5950686e3962bd339c93d27e369bf64f568f

# Build and install gRPC.
git clone --branch ${VERSION} --depth 1 https://github.com/grpc/grpc
fatal: destination path 'grpc' already exists and is not an empty directory.
root@6b07de585388:/cartographer/scripts# rm -r grpc
root@6b07de585388:/cartographer/scripts# ./install_grpc.sh

VERSION="v1.10.0"
# Digest: 474c5950686e3962bd339c93d27e369bf64f568f

# Build and install gRPC.
git clone --branch ${VERSION} --depth 1 https://github.com/grpc/grpc
Cloning into 'grpc'...
remote: Enumerating objects: 9369, done.
remote: Counting objects: 100% (9369/9369), done.
remote: Compressing objects: 100% (5996/5996), done.
remote: Total 9369 (delta 2358), reused 6924 (delta 1686), pack-reused 0
Receiving objects: 100% (9369/9369), 14.04 MiB | 18.59 MiB/s, done.
Resolving deltas: 100% (2358/2358), done.
Note: checking out '474c5950686e3962bd339c93d27e369bf64f568f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

cd grpc
git submodule update --init
Submodule 'third_party/abseil-cpp' (https://github.com/abseil/abseil-cpp) registered for path 'third_party/abseil-cpp'
Submodule 'third_party/benchmark' (https://github.com/google/benchmark) registered for path 'third_party/benchmark'
Submodule 'third_party/bloaty' (https://github.com/google/bloaty.git) registered for path 'third_party/bloaty'
Submodule 'third_party/boringssl' (https://github.com/google/boringssl.git) registered for path 'third_party/boringssl'
Submodule 'third_party/boringssl-with-bazel' (https://github.com/google/boringssl.git) registered for path 'third_party/boringssl-with-bazel'
Submodule 'third_party/cares/cares' (https://github.com/c-ares/c-ares.git) registered for path 'third_party/cares/cares'Submodule 'third_party/gflags' (https://github.com/gflags/gflags.git) registered for path 'third_party/gflags'
Submodule 'third_party/googletest' (https://github.com/google/googletest.git) registered for path 'third_party/googletest'
Submodule 'third_party/protobuf' (https://github.com/google/protobuf.git) registered for path 'third_party/protobuf'
Submodule 'third_party/zlib' (https://github.com/madler/zlib) registered for path 'third_party/zlib'
Cloning into '/cartographer/scripts/grpc/third_party/abseil-cpp'...
Cloning into '/cartographer/scripts/grpc/third_party/benchmark'...
Cloning into '/cartographer/scripts/grpc/third_party/bloaty'...
Cloning into '/cartographer/scripts/grpc/third_party/boringssl'...
Cloning into '/cartographer/scripts/grpc/third_party/boringssl-with-bazel'...
Cloning into '/cartographer/scripts/grpc/third_party/cares/cares'...
Cloning into '/cartographer/scripts/grpc/third_party/gflags'...
Cloning into '/cartographer/scripts/grpc/third_party/googletest'...
Cloning into '/cartographer/scripts/grpc/third_party/protobuf'...
Cloning into '/cartographer/scripts/grpc/third_party/zlib'...
Submodule path 'third_party/abseil-cpp': checked out 'cc4bed2d74f7c8717e31f9579214ab52a9c9c610'
Submodule path 'third_party/benchmark': checked out '5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8'
Submodule path 'third_party/bloaty': checked out '73594cde8c9a52a102c4341c244c833aa61b9c06'
Submodule path 'third_party/boringssl': checked out '4d7ba4e4e57195fcebdabe01489534b446ad02cb'
Submodule path 'third_party/boringssl-with-bazel': checked out '886e7d75368e3f4fab3f4d0d3584e4abfc557755'
Submodule path 'third_party/cares/cares': checked out '3be1924221e1326df520f8498d704a5c4c8d0cce'
Submodule path 'third_party/gflags': checked out '30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e'
Submodule path 'third_party/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'third_party/protobuf': checked out '2761122b810fe8861004ae785cc3ab39f384d342'
Submodule path 'third_party/zlib': checked out 'cacf7f1d4e3d44d871b605da3b647f07d718623f'
make
/bin/sh: 0: Illegal option -t
/bin/sh: 0: Illegal option -t
/bin/sh: 0: Illegal option -t
/bin/sh: 0: Illegal option -g
/bin/sh: 0: Illegal option -g
[MAKE]    Generating /cartographer/scripts/grpc/libs/opt/pkgconfig/grpc.pc
[MAKE]    Generating /cartographer/scripts/grpc/libs/opt/pkgconfig/grpc_unsecure.pc
[MAKE]    Generating cache.mk
[C]       Compiling third_party/cares/cares/ares__close_sockets.c
make: lpthread: Command not found
Makefile:2633: recipe for target '/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__close_sockets.o' failed
make: [/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__close_sockets.o] Error 127 (ignored)
[C]       Compiling third_party/cares/cares/ares__get_hostent.c
make: lpthread: Command not found
Makefile:2633: recipe for target '/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__get_hostent.o' failed
make: [/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__get_hostent.o] Error 127 (ignored)
[C]       Compiling third_party/cares/cares/ares__read_line.c
make: lpthread: Command not found
Makefile:2633: recipe for target '/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__read_line.o' failed
make: [/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__read_line.o] Error 127 (ignored)
[C]       Compiling third_party/cares/cares/ares__timeval.c
make: lpthread: Command not found
Makefile:2633: recipe for target '/cartographer/scripts/grpc/objs/opt/third_party/cares/cares/ares__timeval.o' failed

the list of compiler errors continues, always make: lpthread: Command not found

installig pthread with libpthread-stubs0-dev not help.

Do you have any ideas, what I'm doing wrong?