or-tools Installation in ubuntu:20.04 docker container #3484
-
Hi, i come to ask for help to understand a error i'm having with an already compiled distribution of a C++ program given to me that uses or-tools library. The error i was having while trying to run the program in my container is the following: "/DdVC.out: error while loading shared libraries: libortools.so.9: cannot open shared object file: No such file or directory" Figured i didn't had or-tools installed so i followed the installation instructions and ended up doing the following steps:
In the end i noticed my So what i ended up doing was copying all the content of the generated folder "/DdVC.out: symbol lookup error: ./DdVC.out: undefined symbol: _ZN4absl12lts_2022062319ToInt64MillisecondsENS0_8DurationE" Questions: The person who gave the compiled C++ distribution to me can run the program in his ubuntu:20.04. Thanks! ps: all the steps were done inside my ubuntu:20.04 docker container. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
c++filt _ZN4absl12lts_2022062319ToInt64MillisecondsENS0_8DurationE
absl::lts_20220623::ToInt64Milliseconds(absl::lts_20220623::Duration) Do you have something like this ? Please note absl API is C++ dialect dependent, since we build or-tools using |
Beta Was this translation helpful? Give feedback.
-
Small test trying to run the tsp examples from the cpp Ubuntu-20.04 archive # ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:20.04 AS env
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -yq wget build-essential cmake zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENTRYPOINT ["/bin/bash", "-c"]
CMD ["/bin/bash"]
# Install CMake 3.24.2
RUN ARCH=$(uname -m) \
&& wget -q "https://cmake.org/files/v3.24/cmake-3.24.2-linux-${ARCH}.sh" \
&& chmod a+x cmake-3.24.2-linux-${ARCH}.sh \
&& ./cmake-3.24.2-linux-${ARCH}.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.24.2-linux-${ARCH}.sh
FROM env AS devel
WORKDIR /root
RUN wget https://github.com/google/or-tools/releases/download/v9.4/or-tools_amd64_ubuntu-20.04_cpp_v9.4.1874.tar.gz
RUN tar xzvf or-tools_amd64_ubuntu-20.04_cpp_v*.tar.gz \
&& rm -rf or-tools_amd64_ubuntu-20.04_cpp_v*.tar.gz
FROM devel as build
RUN cd or-tools_cpp_Ubuntu-20.04-* \
&& cd examples/tsp \
&& cmake -S. -Bbuild -DCMAKE_PREFIX_PATH=/root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874 \
&& cmake --build build -v \
&& ./build/bin/tsp output: docker build --tag=plop --target=build .
...
[ 50%] Building CXX object CMakeFiles/tsp.dir/tsp.cc.o
/usr/bin/c++ -DHAVE_CONFIG_H -DOR_TOOLS_AS_DYNAMIC_LIB -DUSE_BOP -DUSE_CBC -DUSE_CLP -DUSE_GLOP -DUSE_LP_PARSER -DUSE_PDLP -DUSE_SCIP -I/root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/examples/tsp -isystem /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/include -isystem /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/include/coin -isystem /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/include/eigen3 -O3 -DNDEBUG -fPIE -fwrapv -std=c++17 -MD -MT CMakeFiles/tsp.dir/tsp.cc.o -MF CMakeFiles/tsp.dir/tsp.cc.o.d -o CMakeFiles/tsp.dir/tsp.cc.o -c /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/examples/tsp/tsp.cc
[100%] Linking CXX executable bin/tsp
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/tsp.dir/link.txt --verbose=1
/usr/bin/c++ -O3 -DNDEBUG CMakeFiles/tsp.dir/tsp.cc.o -o bin/tsp -Wl,-rpath,/root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libortools.so.9.4.1874 -ldl /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_parse.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_usage.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_usage_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_marshalling.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_reflection.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_config.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_private_handle_accessor.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_commandlineflag.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_commandlineflag_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_flags_program_name.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_distributions.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_seed_sequences.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_pool_urbg.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_randen.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_randen_hwaes.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_randen_hwaes_impl.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_randen_slow.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_platform.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_internal_seed_material.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_random_seed_gen_exception.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_raw_hash_set.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_hashtablez_sampler.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_hash.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_city.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_low_level_hash.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_leak_check.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_statusor.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_status.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_cord.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_cordz_info.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_cord_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_cordz_functions.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_exponential_biased.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_cordz_handle.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_bad_optional_access.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_bad_variant_access.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_str_format_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_synchronization.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_stacktrace.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_symbolize.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_debugging_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_demangle_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_graphcycles_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_malloc_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_time.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_strings.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_strings_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_base.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_spinlock_wait.a -lrt /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_throw_delegate.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_int128.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_civil_time.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_time_zone.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_bad_any_cast_impl.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_raw_logging_internal.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libabsl_log_severity.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libprotobuf.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libre2.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libCbcSolver.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libOsiCbc.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libCbc.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libCgl.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libClpSolver.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libOsiClp.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libClp.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libOsi.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libCoinUtils.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libscip.a /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/lib/libz.a -pthread -lpthread
make[2]: Leaving directory '/root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/examples/tsp/build'
[100%] Built target tsp
make[1]: Leaving directory '/root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/examples/tsp/build'
/usr/local/bin/cmake -E cmake_progress_start /root/or-tools_cpp_Ubuntu-20.04-64bit_v9.4.1874/examples/tsp/build/CMakeFiles 0
WARNING: Logging before InitGoogleLogging() is written to STDERR
I1007 07:11:22.074460 113 tsp.cc:74] Objective: 4384
I1007 07:11:22.074573 113 tsp.cc:77] Route for Vehicle 0:
I1007 07:11:22.074586 113 tsp.cc:86] 0 -> 9 -> 5 -> 8 -> 6 -> 2 -> 10 -> 16 -> 14 -> 13 -> 12 -> 11 -> 15 -> 3 -> 4 -> 1 -> 7 -> 0
I1007 07:11:22.074590 113 tsp.cc:87] Distance of the route: 4384m
I1007 07:11:22.074593 113 tsp.cc:88]
I1007 07:11:22.074597 113 tsp.cc:89] Advanced usage:
I1007 07:11:22.074600 113 tsp.cc:90] Problem solved in 2ms
Removing intermediate container 25544f88582d
---> 872c8d5ca089
Successfully built 872c8d5ca089
Successfully tagged plop:latest Please take a look at the |
Beta Was this translation helpful? Give feedback.
-
It seems we didn't link against absl_time... Lines 35 to 56 in 69ab636 Lines 154 to 167 in 69ab636 @andreaxe could you try to add |
Beta Was this translation helpful? Give feedback.
Do you have something like this ?
https://github.com/google/or-tools/blob/main/tools/docker/images/ubuntu-20.04.Dockerfile
Please note absl API is C++ dialect dependent, since we build or-tools using
-std=c++17
you should also build your program with the same flag otherwise you may have "two kinds of absl" which could explain this error...If you can provide the command line used to build
./DdVC.out