make test_cc fails for Ubuntu 18.04.4 LTS

1,772 views
Skip to first unread message

Stuart Rogers

unread,
May 18, 2022, 10:48:03 PM5/18/22
to or-tools-discuss
For OR-Tools v9.3, 'make test_cc' fails for Ubuntu 18.04.4 LTS (bionic), 64 bit, as per the error below.

$ make test_cc
CC = cc
CC_BIN = /usr/bin/cc
CXX = g++
CXX_BIN = /usr/bin/g++
CXXFLAGS = -fPIC -std=c++17 -O4 -DNDEBUG -Iinclude -I. -DARCH_K8 -Wno-deprecated -DUSE_BOP -DUSE_GLOP -DUSE_PDLP -DUSE_CBC -DUSE_CLP -DUSE_SCIP
LDFLAGS = -Wl,-rpath,$ORIGIN -Wl,-rpath,$ORIGIN/../lib64 -Wl,-rpath,$ORIGIN/../lib -lz -lrt -lpthread
OR_TOOLS_LNK = -Llib -Llib64 -lortools

make run SOURCE=examples/cpp/simple_knapsack_program.cc
make[1]: Entering directory '/export/scratch/users/srogers/or-tools_Ubuntu-18.04-64bit_v9.3.10497'
g++ -fPIC -std=c++17 -O4 -DNDEBUG -Iinclude -I. -DARCH_K8 -Wno-deprecated -DUSE_BOP -DUSE_GLOP -DUSE_PDLP -DUSE_CBC -DUSE_CLP -DUSE_SCIP \
 objs/simple_knapsack_program..o \
 -Llib -Llib64 -lortools -Wl,-rpath,"\$ORIGIN" -Wl,-rpath,"\$ORIGIN/../lib64" -Wl,-rpath,"\$ORIGIN/../lib" -lz -lrt -lpthread \
 -o bin/simple_knapsack_program
lib/libortools.so: undefined reference to `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve()@GLIBCXX_3.4.29'
lib/libortools.so: undefined reference to `std::__throw_bad_array_new_length()@GLIBCXX_3.4.29'
lib/libortools.so: undefined reference to `std::__cxx11::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >::basic_ostringstream()@GLIBCXX_3.4.26'
collect2: error: ld returned 1 exit status
Makefile:306: recipe for target 'bin/simple_knapsack_program' failed
make[1]: *** [bin/simple_knapsack_program] Error 1
make[1]: Leaving directory '/export/scratch/users/srogers/or-tools_Ubuntu-18.04-64bit_v9.3.10497'
Makefile:275: recipe for target 'test_cc' failed
make: *** [test_cc] Error 2

Stuart Rogers

unread,
May 18, 2022, 11:23:59 PM5/18/22
to or-tools-discuss
$ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_DEBUG_MESSAGE_LENGTH

Mizux Seiha

unread,
May 19, 2022, 4:55:08 AM5/19/22
to or-tools-discuss
for v9.3 we tried to use a compiler with the C++20 support (gcc 9+) unfortunately the r-toolchain repo bump the GLIBC too (contrary to Centos 7)

You may try to bump your compiler
```
add-apt-repository -y ppa:ubuntu-toolchain-r/test
apt install -yq gcc-11 g++-11
```
Or rebuild ortools from source.

Stuart Rogers

unread,
May 20, 2022, 1:38:55 AM5/20/22
to or-tools-discuss
Bumping the compiler via those two commands resolved the errors. Thanks.
Reply all
Reply to author
Forward
0 new messages