-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
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 have Gurobi installed however I'm not sure which is being used and I'm not sure how to check.
What operating system (Linux, Windows, ...) and version?
NAME="Red Hat Enterprise Linux"
VERSION="8.8 (Ootpa)"
What did you do?
I'm new and trying to get the C++ example on: https://developers.google.com/optimization/flow/maxflow to run on my machine. I saved the code from that page to the file test-max-flow.cpp. Following the directions at: https://github.com/google/or-tools/blob/stable/cmake/README.md#consuming-or-tools-in-a-cmake-project I created my cmake file:
cmake_minimum_required(VERSION 3.14)
project(test-maximum-flow VERSION 1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb")
# Build OR-tools dependencies.
set(BUILD_DEPS ON)
find_package(ortools CONFIG REQUIRED)
add_executable(test-maximum-flow.exe test-maximum-flow.cpp)
target_link_libraries(test-maximum-flow.exe ortools::ortools)
I have a build directory where I execute the following:
$ cmake ../source/
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /apps/spack/linux-rhel8-zen/gcc-8.5.0/gcc-11.2.0-xiaeky3yguq32ddvvibp2o5n4gexejc2/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.11")
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found re2: /somedirectory/lib64/cmake/re2/re2Config.cmake (found version "11.0.0")
-- Found Clp: /somedirectory/lib64/cmake/Clp/ClpConfig.cmake (found version "1.17.7")
-- Found Cbc: /somedirectory/lib64/cmake/Cbc/CbcConfig.cmake (found version "2.10.7")
-- Found Eigen3: /usr/share/eigen3/Eigen3Config.cmake (found version "3.3.4")
-- Found SCIP: /somedirectory/lib64/cmake/scip/scip-config.cmake (found version "9.0.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /somedirectory/test-max-flow/build
Then I build the source:
$ cmake --build .
[ 50%] Building CXX object /somedirectory/test-max-flow/build/CMakeFiles/test-maximum-flow.exe.dir/test-maximum-flow.cpp.o
[100%] Linking CXX executable /somedirectory/test-max-flow/build/test-maximum-flow.exe
[100%] Built target test-maximum-flow.exe
When I execute, I get the following:
$ ./test-maximum-flow.exe
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1736624976.345230 1646102 test-maximum-flow.cpp:37] Solving the max flow problem failed. Solver status: 0
I'm sure that I'm doing something simple incorrectly. Any suggestions? Thank you.
What did you expect to see
I was hoping that the example problem would be solved.
What did you see instead?
When I execute, I get the following:
$ ./test-maximum-flow.exe
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1736624976.345230 1646102 test-maximum-flow.cpp:37] Solving the max flow problem failed. Solver status: 0
Make sure you include information that can help us debug (full error message, model Proto).
Let me know if there is anything else that I can provide to help resolve this problem.
Anything else we should know about your project / environment
I have an academic license of Gurobi installed but I'm not sure the build process found it and I'm not sure how to check. This is the first thing that I've tried since I installed. I also posted this same thing to the OR-Tools discussion group on January 11 but haven't received any responses.