ci: Fix system_build workflow
This commit is contained in:
committed by
Corentin Le Molgat
parent
d577dd79fd
commit
dbecad75cb
@@ -398,6 +398,9 @@ CMAKE_DEPENDENT_OPTION(BUILD_PYTHON_DOC "Build the Python doc" OFF "NOT BUILD_DO
|
|||||||
message(STATUS "Python: Fetch dependencies: ${FETCH_PYTHON_DEPS}")
|
message(STATUS "Python: Fetch dependencies: ${FETCH_PYTHON_DEPS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Find system deps
|
||||||
|
include(system_deps)
|
||||||
|
|
||||||
# Build Needed dependencies
|
# Build Needed dependencies
|
||||||
add_subdirectory(cmake/dependencies dependencies)
|
add_subdirectory(cmake/dependencies dependencies)
|
||||||
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/dependencies/install)
|
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_CURRENT_BINARY_DIR}/dependencies/install)
|
||||||
@@ -426,7 +429,9 @@ message(STATUS "Found int * size: ${SIZEOF_INT_P}")
|
|||||||
cmake_pop_check_state()
|
cmake_pop_check_state()
|
||||||
|
|
||||||
include(host)
|
include(host)
|
||||||
include(deps)
|
# verify deps
|
||||||
|
include(check_deps)
|
||||||
|
|
||||||
include(cpp)
|
include(cpp)
|
||||||
include(flatzinc)
|
include(flatzinc)
|
||||||
include(glop)
|
include(glop)
|
||||||
|
|||||||
109
cmake/check_deps.cmake
Normal file
109
cmake/check_deps.cmake
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
# Copyright 2010-2024 Google LLC
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
# Check dependencies
|
||||||
|
if(NOT TARGET ZLIB::ZLIB)
|
||||||
|
message(FATAL_ERROR "Target ZLIB::ZLIB not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT TARGET absl::base)
|
||||||
|
message(FATAL_ERROR "Target absl::base not available.")
|
||||||
|
endif()
|
||||||
|
set(ABSL_DEPS
|
||||||
|
absl::base
|
||||||
|
absl::core_headers
|
||||||
|
absl::absl_check
|
||||||
|
absl::absl_log
|
||||||
|
absl::check
|
||||||
|
absl::die_if_null
|
||||||
|
absl::flags
|
||||||
|
absl::flags_commandlineflag
|
||||||
|
absl::flags_marshalling
|
||||||
|
absl::flags_parse
|
||||||
|
absl::flags_reflection
|
||||||
|
absl::flags_usage
|
||||||
|
absl::log
|
||||||
|
absl::log_flags
|
||||||
|
absl::log_globals
|
||||||
|
absl::log_initialize
|
||||||
|
absl::log_internal_message
|
||||||
|
absl::cord
|
||||||
|
absl::random_random
|
||||||
|
absl::raw_hash_set
|
||||||
|
absl::hash
|
||||||
|
absl::leak_check
|
||||||
|
absl::memory
|
||||||
|
absl::meta
|
||||||
|
absl::stacktrace
|
||||||
|
absl::status
|
||||||
|
absl::statusor
|
||||||
|
absl::str_format
|
||||||
|
absl::strings
|
||||||
|
absl::synchronization
|
||||||
|
absl::time
|
||||||
|
absl::any
|
||||||
|
)
|
||||||
|
|
||||||
|
if(NOT TARGET protobuf::libprotobuf)
|
||||||
|
message(FATAL_ERROR "Target protobuf::libprotobuf not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT TARGET Eigen3::Eigen)
|
||||||
|
message(FATAL_ERROR "Target Eigen3::Eigen not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_LP_PARSER OR BUILD_TESTING)
|
||||||
|
if(NOT TARGET re2::re2)
|
||||||
|
message(FATAL_ERROR "Target re2::re2 not available.")
|
||||||
|
endif()
|
||||||
|
set(RE2_DEPS re2::re2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_COINOR)
|
||||||
|
if(NOT TARGET Coin::CbcSolver)
|
||||||
|
message(FATAL_ERROR "Target Coin::CbcSolver not available.")
|
||||||
|
endif()
|
||||||
|
if(NOT TARGET Coin::ClpSolver)
|
||||||
|
message(FATAL_ERROR "Target Coin::ClpSolver not available.")
|
||||||
|
endif()
|
||||||
|
set(COINOR_DEPS Coin::CbcSolver Coin::OsiCbc Coin::ClpSolver Coin::OsiClp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_PDLP AND BUILD_PDLP)
|
||||||
|
set(PDLP_DEPS Eigen3::Eigen)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(USE_SCIP AND NOT TARGET libscip)
|
||||||
|
message(FATAL_ERROR "Target libscip not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check optional Dependencies
|
||||||
|
if(USE_CPLEX AND NOT TARGET CPLEX::CPLEX)
|
||||||
|
message(FATAL_ERROR "Target CPLEX::CPLEX not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# CXX Test
|
||||||
|
if(BUILD_TESTING AND NOT TARGET GTest::gtest_main)
|
||||||
|
message(FATAL_ERROR "Target GTest::gtest_main not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Check language Dependencies
|
||||||
|
if(BUILD_PYTHON)
|
||||||
|
if(NOT TARGET pybind11_abseil::absl_casters)
|
||||||
|
message(FATAL_ERROR "Target pybind11_abseil::absl_casters not available.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT TARGET pybind11_native_proto_caster)
|
||||||
|
message(FATAL_ERROR "Target pybind11_native_proto_caster not available.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
@@ -14,6 +14,7 @@ COPY . .
|
|||||||
FROM devel AS build
|
FROM devel AS build
|
||||||
# Archlinux do not provide pybind11 protobuf package
|
# Archlinux do not provide pybind11 protobuf package
|
||||||
RUN cmake -S. -Bbuild -DBUILD_DEPS=OFF \
|
RUN cmake -S. -Bbuild -DBUILD_DEPS=OFF \
|
||||||
|
-DBUILD_pybind11_abseil=ON \
|
||||||
-DBUILD_pybind11_protobuf=ON \
|
-DBUILD_pybind11_protobuf=ON \
|
||||||
-DUSE_COINOR=ON \
|
-DUSE_COINOR=ON \
|
||||||
-DUSE_GLPK=ON \
|
-DUSE_GLPK=ON \
|
||||||
|
|||||||
@@ -25,73 +25,23 @@ set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
|
|||||||
if(NOT BUILD_ZLIB)
|
if(NOT BUILD_ZLIB)
|
||||||
find_package(ZLIB REQUIRED)
|
find_package(ZLIB REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET ZLIB::ZLIB)
|
|
||||||
message(FATAL_ERROR "Target ZLIB::ZLIB not available.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT BUILD_absl)
|
if(NOT BUILD_absl)
|
||||||
find_package(absl REQUIRED)
|
find_package(absl REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
set(ABSL_DEPS
|
|
||||||
absl::base
|
|
||||||
absl::core_headers
|
|
||||||
absl::absl_check
|
|
||||||
absl::absl_log
|
|
||||||
absl::check
|
|
||||||
absl::die_if_null
|
|
||||||
absl::flags
|
|
||||||
absl::flags_commandlineflag
|
|
||||||
absl::flags_marshalling
|
|
||||||
absl::flags_parse
|
|
||||||
absl::flags_reflection
|
|
||||||
absl::flags_usage
|
|
||||||
absl::log
|
|
||||||
absl::log_flags
|
|
||||||
absl::log_globals
|
|
||||||
absl::log_initialize
|
|
||||||
absl::log_internal_message
|
|
||||||
absl::cord
|
|
||||||
absl::random_random
|
|
||||||
absl::raw_hash_set
|
|
||||||
absl::hash
|
|
||||||
absl::leak_check
|
|
||||||
absl::memory
|
|
||||||
absl::meta
|
|
||||||
absl::stacktrace
|
|
||||||
absl::status
|
|
||||||
absl::statusor
|
|
||||||
absl::str_format
|
|
||||||
absl::strings
|
|
||||||
absl::synchronization
|
|
||||||
absl::time
|
|
||||||
absl::any
|
|
||||||
)
|
|
||||||
|
|
||||||
if(NOT BUILD_Protobuf)
|
if(NOT BUILD_Protobuf)
|
||||||
find_package(Protobuf REQUIRED)
|
find_package(Protobuf REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET protobuf::libprotobuf)
|
|
||||||
message(FATAL_ERROR "Target protobuf::libprotobuf not available.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(NOT BUILD_Eigen3)
|
if(NOT BUILD_Eigen3)
|
||||||
find_package(Eigen3 REQUIRED)
|
find_package(Eigen3 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET Eigen3::Eigen)
|
|
||||||
message(FATAL_ERROR "Target Eigen3::Eigen not available.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_LP_PARSER OR BUILD_TESTING)
|
if(BUILD_LP_PARSER OR BUILD_TESTING)
|
||||||
if(NOT BUILD_re2)
|
if(NOT BUILD_re2)
|
||||||
find_package(re2 REQUIRED)
|
find_package(re2 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET re2::re2)
|
|
||||||
message(FATAL_ERROR "Target re2::re2 not available.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(BUILD_LP_PARSER)
|
|
||||||
set(RE2_DEPS re2::re2)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_COINOR)
|
if(USE_COINOR)
|
||||||
@@ -114,34 +64,22 @@ if(USE_COINOR)
|
|||||||
if(NOT BUILD_Cbc)
|
if(NOT BUILD_Cbc)
|
||||||
find_package(Cbc REQUIRED)
|
find_package(Cbc REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(COINOR_DEPS Coin::CbcSolver Coin::OsiCbc Coin::ClpSolver Coin::OsiClp)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_GLPK)
|
if(USE_GLPK AND NOT BUILD_GLPK)
|
||||||
if(NOT BUILD_GLPK)
|
find_package(GLPK REQUIRED)
|
||||||
find_package(GLPK REQUIRED)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_HIGHS)
|
if(USE_HIGHS AND NOT BUILD_HIGHS)
|
||||||
if(NOT BUILD_HIGHS)
|
find_package(HIGHS REQUIRED)
|
||||||
find_package(HIGHS REQUIRED)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_PDLP)
|
if(USE_PDLP AND NOT BUILD_PDLP)
|
||||||
if(NOT BUILD_PDLP)
|
find_package(PDLP REQUIRED)
|
||||||
find_package(PDLP REQUIRED)
|
|
||||||
else()
|
|
||||||
set(PDLP_DEPS Eigen3::Eigen)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_SCIP)
|
if(USE_SCIP AND NOT BUILD_SCIP)
|
||||||
if(NOT BUILD_SCIP)
|
find_package(SCIP REQUIRED)
|
||||||
find_package(SCIP REQUIRED)
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check optional Dependencies
|
# Check optional Dependencies
|
||||||
@@ -150,13 +88,8 @@ if(USE_CPLEX)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# CXX Test
|
# CXX Test
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING AND NOT BUILD_googletest)
|
||||||
if(NOT BUILD_googletest)
|
find_package(GTest REQUIRED)
|
||||||
find_package(GTest REQUIRED)
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET GTest::gtest_main)
|
|
||||||
message(FATAL_ERROR "Target GTest::gtest_main not available.")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Check language Dependencies
|
# Check language Dependencies
|
||||||
@@ -165,6 +98,10 @@ if(BUILD_PYTHON)
|
|||||||
find_package(pybind11 REQUIRED)
|
find_package(pybind11 REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT BUILD_pybind11_abseil)
|
||||||
|
find_package(pybind11_abseil REQUIRED)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT BUILD_pybind11_protobuf)
|
if(NOT BUILD_pybind11_protobuf)
|
||||||
find_package(pybind11_protobuf REQUIRED)
|
find_package(pybind11_protobuf REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
@@ -55,25 +55,29 @@ index ceb65a8..e142837 100644
|
|||||||
include_directories(${TOP_LEVEL_DIR} ${pybind11_INCLUDE_DIRS})
|
include_directories(${TOP_LEVEL_DIR} ${pybind11_INCLUDE_DIRS})
|
||||||
diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt
|
diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000..826eda8
|
index 0000000..b67d564
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/cmake/dependencies/CMakeLists.txt
|
+++ b/cmake/dependencies/CMakeLists.txt
|
||||||
@@ -0,0 +1,15 @@
|
@@ -0,0 +1,19 @@
|
||||||
+include(FetchContent)
|
+include(FetchContent)
|
||||||
+
|
|
||||||
+set(ABSL_PROPAGATE_CXX_STD ON)
|
|
||||||
+set(BUILD_TESTING OFF)
|
+set(BUILD_TESTING OFF)
|
||||||
+FetchContent_Declare(
|
+
|
||||||
+ absl
|
+if(NOT TARGET absl::base)
|
||||||
+ URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
|
+ set(ABSL_PROPAGATE_CXX_STD ON)
|
||||||
+ URL_HASH
|
+ FetchContent_Declare(
|
||||||
|
+ absl
|
||||||
|
+ URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
|
||||||
|
+ URL_HASH
|
||||||
+ SHA256=59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5)
|
+ SHA256=59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5)
|
||||||
|
+ FetchContent_MakeAvailable(absl)
|
||||||
|
+endif()
|
||||||
+
|
+
|
||||||
+FetchContent_Declare(
|
+if(NOT TARGET pybind11::pybind11_headers)
|
||||||
+ pybind11
|
+ FetchContent_Declare(
|
||||||
+ URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)
|
+ pybind11
|
||||||
+
|
+ URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)
|
||||||
+FetchContent_MakeAvailable(absl pybind11)
|
+ FetchContent_MakeAvailable(pybind11)
|
||||||
|
+endif()
|
||||||
diff --git a/pybind11_abseil/BUILD b/pybind11_abseil/BUILD
|
diff --git a/pybind11_abseil/BUILD b/pybind11_abseil/BUILD
|
||||||
index 791c245..33e614a 100644
|
index 791c245..33e614a 100644
|
||||||
--- a/pybind11_abseil/BUILD
|
--- a/pybind11_abseil/BUILD
|
||||||
|
|||||||
Reference in New Issue
Block a user