alinmindroc / valhalla_traffic_poc

Step-by-step instructions to run valhalla with traffic info
65 stars 10 forks source link

fix: fatal error `cxxopts.hpp` no such file or directory #1

Closed prashis closed 2 years ago

prashis commented 2 years ago
#20 856.2 Scanning dependencies of target valhalla
#20 856.2 [ 66%] Building CXX object src/CMakeFiles/valhalla.dir/worker.cc.o
#20 867.4 [ 66%] Building CXX object src/CMakeFiles/valhalla.dir/filesystem.cc.o
#20 867.9 [ 70%] Building CXX object src/CMakeFiles/valhalla.dir/proto_conversions.cc.o
#20 872.1 [ 70%] Building CXX object src/CMakeFiles/valhalla.dir/tile_server.cc.o
#20 875.4 [ 70%] Building C object src/CMakeFiles/valhalla.dir/__/third_party/microtar/src/microtar.c.o
#20 875.5 [ 70%] Linking CXX static library libvalhalla.a
#20 875.8 [ 70%] Built target valhalla
#20 875.9 Scanning dependencies of target valhalla_build_statistics
#20 875.9 [ 73%] Building CXX object CMakeFiles/valhalla_build_statistics.dir/src/mjolnir/valhalla_build_statistics.cc.o
#20 876.5 /valhalla/src/mjolnir/valhalla_build_statistics.cc:8:10: fatal error: cxxopts.hpp: No such file or directory
#20 876.5     8 | #include <cxxopts.hpp>
#20 876.5       |          ^~~~~~~~~~~~~
#20 876.5 compilation terminated.
#20 876.5 make[2]: *** [CMakeFiles/valhalla_build_statistics.dir/build.make:63: CMakeFiles/valhalla_build_statistics.dir/src/mjolnir/valhalla_build_statistics.cc.o] Error 1
#20 876.5 make[1]: *** [CMakeFiles/Makefile2:1188: CMakeFiles/valhalla_build_statistics.dir/all] Error 2
#20 876.5 make: *** [Makefile:152: all] Error 2
------
executor failed running [/bin/sh -c cd valhalla/build; make]: exit code: 2
prashis commented 2 years ago

I'd fixed it by adding cxxopts.hpp in dir and moving inside of docker at /usr/include, maybe there is better solution for it instead of it 😅

alinmindroc commented 2 years ago

Thanks for reporting! This happens because I had to update two CMakeLists files in the Valhalla repository, in order to compile the valhalla_traffic_demo_utils tool. I'm sure there is a cleaner solution for that, but I'm not cmake-savvy enough. So whenever the original CMakeLists change in the upstream, things break.

I've updated the docker image to clone a specific commit of the Valhalla repo now, so it shouldn't break again in the future.

I have also moved the tool to use cxxopts instead of boost, so now it's compiling correctly.