Skip to content

Commit

Permalink
Upgrade version of OR-Tools and abseil.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 418781323
Change-Id: If203791f8d76cd2a0b8a54fd4f9d728fa3d7962e
  • Loading branch information
lanctot committed Jan 3, 2022
1 parent e2152f2 commit ccd9ddc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
7 changes: 4 additions & 3 deletions open_spiel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,15 @@ set (OPEN_SPIEL_CORE_FILES
)

# We add the subdirectory here so open_spiel_core can #include absl.
set(ABSL_PROPAGATE_CXX_STD ON)
add_subdirectory (abseil-cpp)

# Just the core without any of the games
add_library(open_spiel_core OBJECT ${OPEN_SPIEL_CORE_FILES})
target_include_directories (
open_spiel_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} abseil-cpp)
link_libraries(open_spiel_core
absl::container
absl::algorithm
absl::flags
absl::flags_parse
absl::flat_hash_map
Expand Down Expand Up @@ -268,7 +269,7 @@ if (OPEN_SPIEL_BUILD_WITH_ORTOOLS)
# and assumed to be in $HOME/or-tools.
# The flags were taken from the compilation of linear_programming.cc after
# running make test_cc.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOP -DUSE_GLOP -DUSE_CBC -DUSE_CLP -DUSE_SCIP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BOP -DUSE_GLOP -DUSE_CBC -DUSE_CLP -DUSE_SCIP -pthread")
set(ORTOOLS_HOME "${CMAKE_CURRENT_SOURCE_DIR}/ortools")
set(ORTOOLS_INC_DIRS ${ORTOOLS_HOME} ${ORTOOLS_HOME}/include)
set(ORTOOLS_LIB_DIRS ${ORTOOLS_HOME}/lib ${ORTOOLS_HOME}/lib64)
Expand Down Expand Up @@ -336,7 +337,7 @@ if (BUILD_SHARED_LIB)
target_include_directories(open_spiel PUBLIC
${CMAKE_CURRENT_SOURCE_DIR} abseil-cpp)
target_link_libraries(open_spiel PUBLIC
absl::container
absl::algorithm
absl::flat_hash_map
absl::optional
absl::random_random
Expand Down
9 changes: 3 additions & 6 deletions open_spiel/scripts/global_variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,10 @@ export OPEN_SPIEL_BUILD_WITH_GAMUT="${OPEN_SPIEL_BUILD_WITH_GAMUT:-"OFF"}"
# See algorithms/ortools/CMakeLists.txt for specific instructions.
export OPEN_SPIEL_BUILD_WITH_ORTOOLS="${OPEN_SPIEL_BUILD_WITH_ORTOOLS:-"OFF"}"
# You may want to replace this URL according to your system.
# Use version 8 at minimum, due to compatibility between absl library versions
# Use version 9.2 at minimum, due to compatibility between absl library versions
# used in OpenSpiel and in OrTools.
# Other v8 URLs are:
# https://github.com/google/or-tools/releases/download/v8.0/or-tools_ubuntu-20.04_v8.0.8283.tar.gz
# https://github.com/google/or-tools/releases/download/v8.0/or-tools_debian-10_v8.0.8283.tar.gz
# https://github.com/google/or-tools/releases/download/v8.0/or-tools_MacOsX-10.15.7_v8.0.8283.tar.gz
export OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL="${OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL:-"https://github.com/google/or-tools/releases/download/v8.0/or-tools_ubuntu-18.04_v8.0.8283.tar.gz"}"
# Other links to archives found here: https://developers.google.com/optimization/install/cpp/linux
export OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL="${OPEN_SPIEL_BUILD_WITH_ORTOOLS_DOWNLOAD_URL:-"https://github.com/google/or-tools/releases/download/v9.2/or-tools_amd64_ubuntu-20.04_v9.2.9972.tar.gz"}"

# Used to determine whether to include the Python ML frameworks in the tests.
# A value of AUTO runs the appropriate find_X script in open_spiel/scripts to check what is installed.
Expand Down
6 changes: 1 addition & 5 deletions open_spiel/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ fi

DIR="open_spiel/abseil-cpp"
if [[ ! -d ${DIR} ]]; then
cached_clone -b '20200923.3' --single-branch --depth 1 https://github.com/abseil/abseil-cpp.git open_spiel/abseil-cpp
# TODO(author5): finally update absl to a newer version and remove this
# workaround. Required to fix: https://github.com/deepmind/open_spiel/issues/716.
# See https://github.com/deepmind/open_spiel/pull/722 for discussion.
patch -u ${MYDIR}/open_spiel/abseil-cpp/absl/debugging/failure_signal_handler.cc ${MYDIR}/open_spiel/scripts/patches/absl_failure_signal_handler.cc.patch
cached_clone -b '20211102.0' --single-branch --depth 1 https://github.com/abseil/abseil-cpp.git open_spiel/abseil-cpp
fi

# Optional dependencies.
Expand Down

0 comments on commit ccd9ddc

Please sign in to comment.