Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building from source OR-Tools C++ on Linux results in compile error #4490

Closed
troyrock opened this issue Jan 10, 2025 · 3 comments
Closed

Building from source OR-Tools C++ on Linux results in compile error #4490

troyrock opened this issue Jan 10, 2025 · 3 comments
Assignees
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem Lang: C++ Native implementation issue OS: Linux GNU/Linux OS
Milestone

Comments

@troyrock
Copy link

troyrock commented Jan 10, 2025

What version of OR-Tools and what language are you using?
Version: stable/v9.11
Language: C++

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)
I intend to try Gurobi but I'm not sure if it is getting that far.

What operating system (Linux, Windows, ...) and version?
NAME="Red Hat Enterprise Linux"
VERSION="8.8 (Ootpa)"

What did you do?
git clone https://github.com/google/or-tools
cd or-tools
cmake -S . -B build -DBUILD_DEPS=ON
cmake --build build --config Release --target all -v

What did you expect to see
Compile successful! or something like that.

What did you see instead?
a LOT of successful compilations followed by:

/usr/bin/gmake  -f ortools/algorithms/CMakeFiles/ortools_algorithms.dir/build.make ortools/algorithms/CMakeFiles/ortools_algorithms.dir/build
gmake[2]: Entering directory '/home/username/or-tools/build'
[ 69%] Building CXX object ortools/algorithms/CMakeFiles/ortools_algorithms.dir/set_cover_invariant.cc.o
cd //home/username/or-tools/build/ortools/algorithms && /usr/bin/c++ -DOR_TOOLS_AS_DYNAMIC_LIB -DUSE_BOP -DUSE_CBC -DUSE_CLP -DUSE_GLOP -DUSE_HIGHS -DUSE_LP_PARSER -DUSE_MATH_OPT -DUSE_PDLP -DUSE_SCIP -I//home/username/or-tools -I//home/username/or-tools/build -I//home/username/or-tools/build/_deps/protobuf-src/src -I//home/username/or-tools/build/_deps/protobuf-src -isystem //home/username/or-tools/build/_deps/absl-src -O3 -DNDEBUG -fPIC -fwrapv -std=c++2a -MD -MT ortools/algorithms/CMakeFiles/ortools_algorithms.dir/set_cover_invariant.cc.o -MF CMakeFiles/ortools_algorithms.dir/set_cover_invariant.cc.o.d -o CMakeFiles/ortools_algorithms.dir/set_cover_invariant.cc.o -c //home/username/or-tools/ortools/algorithms/set_cover_invariant.cc
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc: In member function ‘std::tuple<double, util_intops::StrongVector<util_intops::StrongInt<operations_research::ElementIndex_tag_, int>, int, operations_research::internal::AllocatorWithAlignment<int, 64, 0> > > operations_research::SetCoverInvariant::ComputeCostAndCoverage(const SubsetBoolVector&) const’:
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:38: error: found ‘:’ in nested-name-specifier, expected ‘::’
   for (SubsetIndex subset(0); bool b : choices) {
                                                         ^
                                                          ::
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:31: error: expected primary-expression before ‘bool’
   for (SubsetIndex subset(0); bool b : choices) {
                                               ^~~~
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:30: error: expected ‘;’ before ‘bool’
   for (SubsetIndex subset(0); bool b : choices) {
                                             ^~~~~
                                             ;
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:31: error: expected primary-expression before ‘bool’
   for (SubsetIndex subset(0); bool b : choices) {
                                              ^~~~
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:30: error: expected ‘)’ before ‘bool’
   for (SubsetIndex subset(0); bool b : choices) {
        ~                                   ^~~~~
                                              )
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:36: error: ‘b’ has not been declared
   for (SubsetIndex subset(0); bool b : choices) {
                                                       ^
//home/username/or-tools/ortools/algorithms/set_cover_invariant.cc:113:47: error: qualified-id in declaration before ‘)’ token
   for (SubsetIndex subset(0); bool b : choices) {
                                                                       ^
gmake[2]: *** [ortools/algorithms/CMakeFiles/ortools_algorithms.dir/build.make:188: ortools/algorithms/CMakeFiles/ortools_algorithms.dir/set_cover_invariant.cc.o] Error 1
gmake[2]: Leaving directory '/home/username/or-tools/build'
gmake[1]: *** [CMakeFiles/Makefile2:8588: ortools/algorithms/CMakeFiles/ortools_algorithms.dir/all] Error 2
gmake[1]: Leaving directory '/home/username/or-tools/build'
gmake: *** [Makefile:166: all] Error 2

Make sure you include information that can help us debug (full error message, model Proto).

Anything else we should know about your project / environment
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu

$ /usr/bin/c++ --version
c++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-18)

@lperron
Copy link
Collaborator

lperron commented Jan 10, 2025

most likely a version of gcc too old.

@Mizux Mizux self-assigned this Jan 10, 2025
@Mizux Mizux added the Help Needed Modeling/Usage problem label Jan 10, 2025
@Mizux Mizux added this to the v9.12 milestone Jan 10, 2025
@Mizux Mizux added OS: Linux GNU/Linux OS Build: CMake CMake based build issue Lang: C++ Native implementation issue labels Jan 10, 2025
@troyrock
Copy link
Author

I updated to gcc 11.2.0 and that fixed the problem. Thank you.

@Mizux
Copy link
Collaborator

Mizux commented Jan 14, 2025

Thx for the update, appreciate it !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build: CMake CMake based build issue Help Needed Modeling/Usage problem Lang: C++ Native implementation issue OS: Linux GNU/Linux OS
Projects
None yet
Development

No branches or pull requests

3 participants