diff --git a/WORKSPACE b/WORKSPACE index 0f10f68db0..2c503204e9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -89,6 +89,8 @@ git_repository( git_repository( name = "com_google_absl", tag = "20240116.0", + patches = ["//patches:abseil-cpp-20240116.0.patch"], + patch_args = ["-p1"], remote = "https://github.com/abseil/abseil-cpp.git", ) diff --git a/bazel/scip.patch b/bazel/scip.patch index 223bc9a27d..03e6c58e7d 100644 --- a/bazel/scip.patch +++ b/bazel/scip.patch @@ -15,13 +15,13 @@ index 2471778a8f..17fd1e8c34 100644 if ( ival == 0 ) { - (void) google::SetVLOGLevel("*", google::GLOG_INFO); -+ absl::SetFlag(&FLAGS_stderrthreshold, 2); ++ absl::SetFlag(&FLAGS_stderrthreshold, 2); lpi->lp_info = false; } else { - (void) google::SetVLOGLevel("*", google::GLOG_ERROR); -+ absl::SetFlag(&FLAGS_stderrthreshold, 0); ++ absl::SetFlag(&FLAGS_stderrthreshold, 0); lpi->lp_info = true; } break; diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index c2ec2833fb..d94a227bc2 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -83,6 +83,7 @@ if(BUILD_absl) abseil-cpp GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git" GIT_TAG "20240116.0" + PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/abseil-cpp-20240116.0.patch" ) FetchContent_MakeAvailable(abseil-cpp) list(POP_BACK CMAKE_MESSAGE_INDENT) diff --git a/cmake/host.CMakeLists.txt b/cmake/host.CMakeLists.txt index ddc0fa7e62..5a32451704 100644 --- a/cmake/host.CMakeLists.txt +++ b/cmake/host.CMakeLists.txt @@ -106,8 +106,7 @@ FetchContent_Declare( absl GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git" GIT_TAG "20240116.0" - #PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/abseil-cpp-20240116.0.patch" -) + PATCH_COMMAND git apply "${CMAKE_CURRENT_LIST_DIR}/@PATCHES_PATH@/abseil-cpp-20240116.0.patch") FetchContent_MakeAvailable(absl) list(POP_BACK CMAKE_MESSAGE_INDENT) message(CHECK_PASS "fetched") diff --git a/patches/BUILD.bazel b/patches/BUILD.bazel index 82c69a6e9d..3dd4c7ffda 100644 --- a/patches/BUILD.bazel +++ b/patches/BUILD.bazel @@ -12,9 +12,9 @@ # limitations under the License. exports_files([ + "abseil-cpp-20240116.0.patch", "protobuf-v25.2.patch", - "pybind11_abseil.patch", "pybind11_bazel.patch", - "pybind11.patch", "pybind11_protobuf.patch", + "pybind11.patch", ]) diff --git a/patches/abseil-cpp-20240116.0.patch b/patches/abseil-cpp-20240116.0.patch new file mode 100644 index 0000000000..9ea4a662f1 --- /dev/null +++ b/patches/abseil-cpp-20240116.0.patch @@ -0,0 +1,80 @@ +diff --git a/CMake/AbseilDll.cmake b/CMake/AbseilDll.cmake +index 47f3beeb..43217c85 100644 +--- a/CMake/AbseilDll.cmake ++++ b/CMake/AbseilDll.cmake +@@ -624,31 +624,44 @@ set(ABSL_INTERNAL_TEST_DLL_TARGETS + + include(CheckCXXSourceCompiles) + +-check_cxx_source_compiles( +- [==[ +-#ifdef _MSC_VER +-# if _MSVC_LANG < 201703L +-# error "The compiler defaults or is configured for C++ < 17" +-# endif +-#elif __cplusplus < 201703L +-# error "The compiler defaults or is configured for C++ < 17" +-#endif +-int main() { return 0; } +-]==] ++message(WARNING "ABSL_CXX_STANDARD: ${ABSL_CXX_STANDARD}") ++message(WARNING "CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}") ++message(WARNING "CMAKE_CXX_STANDARD_REQUIRED: ${CMAKE_CXX_STANDARD_REQUIRED}") ++message(WARNING "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}") ++ ++if(CMAKE_CXX_STANDARD GREATER_EQUAL 17) ++ set(ABSL_INTERNAL_AT_LEAST_CXX17 TRUE) ++else() ++ check_cxx_source_compiles( ++ [==[ ++ #ifdef _MSC_VER ++ # if _MSVC_LANG < 201703L ++ # error "The compiler defaults or is configured for C++ < 17" ++ # endif ++ #elif __cplusplus < 201703L ++ # error "The compiler defaults or is configured for C++ < 17" ++ #endif ++ int main() { return 0; } ++ ]==] + ABSL_INTERNAL_AT_LEAST_CXX17) ++endif() + +-check_cxx_source_compiles( +- [==[ +-#ifdef _MSC_VER +-# if _MSVC_LANG < 202002L +-# error "The compiler defaults or is configured for C++ < 20" +-# endif +-#elif __cplusplus < 202002L +-# error "The compiler defaults or is configured for C++ < 20" +-#endif +-int main() { return 0; } +-]==] ++if(CMAKE_CXX_STANDARD GREATER_EQUAL 20) ++ set(ABSL_INTERNAL_AT_LEAST_CXX20 TRUE) ++else() ++ check_cxx_source_compiles( ++ [==[ ++ #ifdef _MSC_VER ++ # if _MSVC_LANG < 202002L ++ # error "The compiler defaults or is configured for C++ < 20" ++ # endif ++ #elif __cplusplus < 202002L ++ # error "The compiler defaults or is configured for C++ < 20" ++ #endif ++ int main() { return 0; } ++ ]==] + ABSL_INTERNAL_AT_LEAST_CXX20) ++endif() + + if(ABSL_INTERNAL_AT_LEAST_CXX20) + set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20) +@@ -656,6 +669,7 @@ elseif(ABSL_INTERNAL_AT_LEAST_CXX17) + set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17) + else() + set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14) ++ message(FATAL_ERROR "Should not pass here !!!") + endif() + + function(absl_internal_dll_contains) + diff --git a/patches/scip-v810.patch b/patches/scip-v810.patch index ead07e034a..257e365993 100644 --- a/patches/scip-v810.patch +++ b/patches/scip-v810.patch @@ -15,13 +15,13 @@ index 2471778a8f..17fd1e8c34 100644 if ( ival == 0 ) { - (void) google::SetVLOGLevel("*", google::GLOG_INFO); -+ absl::SetFlag(&FLAGS_stderrthreshold, 2); ++ absl::SetFlag(&FLAGS_stderrthreshold, 2); lpi->lp_info = false; } else { - (void) google::SetVLOGLevel("*", google::GLOG_ERROR); -+ absl::SetFlag(&FLAGS_stderrthreshold, 0); ++ absl::SetFlag(&FLAGS_stderrthreshold, 0); lpi->lp_info = true; } break; @@ -42,4 +42,4 @@ index 2471778a8f..17fd1e8c34 100644 + if ( ! WriteProtoToFile(filespec, proto, operations_research::ProtoWriteFormat::kProtoText, true).ok() ) { SCIPerrorMessage("Could not write <%s>\n", fname); - return SCIP_READERROR; \ No newline at end of file + return SCIP_READERROR;