bump .NET to 8.0; remove LP_PARSER option
This commit is contained in:
@@ -29,10 +29,10 @@ jobs:
|
||||
- name: Check swig
|
||||
run: swig -version
|
||||
# Install .NET SDKs
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
# Install Java
|
||||
|
||||
@@ -18,10 +18,10 @@ jobs:
|
||||
run: |
|
||||
sudo apt install -y swig
|
||||
swig -version
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
- name: Check CMake
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# ref: https://github.com/actions/runner-images
|
||||
name: amd64 Linux CMake C++ LP_PARSER OFF
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
concurrency:
|
||||
group: ${{github.workflow}}-${{github.ref}}
|
||||
cancel-in-progress: true
|
||||
|
||||
# Building using the github runner environement directly.
|
||||
jobs:
|
||||
native:
|
||||
name: amd64•Linux•CMake•LP_PARSER=OFF
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check cmake
|
||||
run: cmake --version
|
||||
- name: Configure
|
||||
run: >
|
||||
cmake -S. -Bbuild
|
||||
-DCMAKE_BUILD_TYPE=Release
|
||||
-DBUILD_DEPS=ON
|
||||
-DBUILD_LP_PARSER=OFF
|
||||
- name: Build
|
||||
run: >
|
||||
cmake --build build
|
||||
--config Release
|
||||
--target all
|
||||
-v -j2
|
||||
- name: Test
|
||||
run: >
|
||||
CTEST_OUTPUT_ON_FAILURE=1
|
||||
cmake --build build
|
||||
--config Release
|
||||
--target test
|
||||
-v
|
||||
- name: Install
|
||||
run: >
|
||||
cmake --build build
|
||||
--config Release
|
||||
--target install
|
||||
-v
|
||||
-- DESTDIR=install
|
||||
@@ -29,10 +29,10 @@ jobs:
|
||||
- name: Check swig
|
||||
run: swig -version
|
||||
# Install .NET SDKs
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
# Install Java
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
run: |
|
||||
brew install swig
|
||||
swig -version
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
- name: Check CMake
|
||||
|
||||
@@ -22,10 +22,10 @@ jobs:
|
||||
CTEST_OUTPUT_ON_FAILURE: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
- name: Check CMake
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
run: |
|
||||
brew install swig
|
||||
swig -version
|
||||
- name: Setup .NET 6.0
|
||||
- name: Setup .NET 8.0
|
||||
uses: actions/setup-dotnet@v4
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
dotnet-version: 8.0.x
|
||||
- name: Check dotnet
|
||||
run: dotnet --info
|
||||
- name: Check CMake
|
||||
|
||||
@@ -123,10 +123,6 @@ include(CMakeDependentOption)
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_FLATZINC "Build flatzinc" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "Build Flatzinc: ${BUILD_FLATZINC}")
|
||||
|
||||
## LP Parser
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_LP_PARSER "Build lp_parser" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "Build LP Parser: ${BUILD_LP_PARSER}")
|
||||
|
||||
## MathOpt
|
||||
CMAKE_DEPENDENT_OPTION(BUILD_MATH_OPT "Build the MATH_OPT" ON "BUILD_CXX" OFF)
|
||||
message(STATUS "Build MathOpt: ${BUILD_MATH_OPT}")
|
||||
@@ -378,13 +374,13 @@ if(BUILD_DOTNET)
|
||||
endif()
|
||||
message(STATUS ".Net: Use .Net Core 3.1 LTS support: ${USE_DOTNET_CORE_31}")
|
||||
|
||||
option(USE_DOTNET_6 "Use .Net 6.0 LTS support" ON)
|
||||
option(USE_DOTNET_6 "Use .Net 6.0 LTS support" OFF)
|
||||
message(STATUS ".Net: Use .Net 6.0 LTS support: ${USE_DOTNET_6}")
|
||||
|
||||
option(USE_DOTNET_7 "Use .Net 7.0 support" OFF)
|
||||
message(STATUS ".Net: Use .Net 7.0 support: ${USE_DOTNET_7}")
|
||||
|
||||
option(USE_DOTNET_8 "Use .Net 8.0 LTS support" OFF)
|
||||
option(USE_DOTNET_8 "Use .Net 8.0 LTS support" ON)
|
||||
message(STATUS ".Net: Use .Net 8.0 support: ${USE_DOTNET_8}")
|
||||
|
||||
option(USE_DOTNET_9 "Use .Net 9.0 support" OFF)
|
||||
|
||||
@@ -53,9 +53,6 @@ if(MSVC AND BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
|
||||
# Optional built-in components
|
||||
if(BUILD_LP_PARSER)
|
||||
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_LP_PARSER")
|
||||
endif()
|
||||
if(BUILD_MATH_OPT)
|
||||
list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_MATH_OPT")
|
||||
set(MATH_OPT_DIR math_opt)
|
||||
@@ -650,13 +647,11 @@ install(
|
||||
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
|
||||
COMPONENT Devel)
|
||||
if(BUILD_LP_PARSER)
|
||||
install(
|
||||
FILES
|
||||
"${PROJECT_SOURCE_DIR}/cmake/Findre2.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/modules"
|
||||
COMPONENT Devel)
|
||||
endif()
|
||||
install(
|
||||
FILES
|
||||
"${PROJECT_SOURCE_DIR}/cmake/Findre2.cmake"
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/modules"
|
||||
COMPONENT Devel)
|
||||
if(USE_COINOR)
|
||||
install(
|
||||
FILES
|
||||
|
||||
@@ -82,6 +82,8 @@ target_sources(glop PRIVATE
|
||||
ortools/base/accurate_sum.h
|
||||
ortools/base/base_export.h
|
||||
ortools/base/basictypes.h
|
||||
ortools/base/case.cc
|
||||
ortools/base/case.h
|
||||
ortools/base/commandlineflags.h
|
||||
ortools/base/file.cc
|
||||
ortools/base/file.h
|
||||
@@ -130,6 +132,8 @@ target_sources(glop PRIVATE
|
||||
ortools/lp_data/lp_data.h
|
||||
ortools/lp_data/lp_data_utils.cc
|
||||
ortools/lp_data/lp_data_utils.h
|
||||
ortools/lp_data/lp_parser.cc
|
||||
ortools/lp_data/lp_parser.h
|
||||
ortools/lp_data/lp_print_utils.cc
|
||||
ortools/lp_data/lp_print_utils.h
|
||||
ortools/lp_data/lp_types.cc
|
||||
@@ -145,8 +149,8 @@ target_sources(glop PRIVATE
|
||||
ortools/lp_data/sparse.cc
|
||||
ortools/lp_data/sparse.h
|
||||
ortools/lp_data/sparse_column.cc
|
||||
ortools/port/sysinfo.h
|
||||
ortools/port/sysinfo.cc
|
||||
ortools/port/sysinfo.h
|
||||
ortools/util/file_util.cc
|
||||
ortools/util/file_util.h
|
||||
ortools/util/fp_utils.cc
|
||||
@@ -160,14 +164,7 @@ target_sources(glop PRIVATE
|
||||
ortools/util/strong_integers.h
|
||||
ortools/util/time_limit.cc
|
||||
ortools/util/time_limit.h
|
||||
)
|
||||
if(BUILD_LP_PARSER)
|
||||
target_sources(glop PRIVATE
|
||||
ortools/base/case.cc
|
||||
ortools/base/case.h
|
||||
ortools/lp_data/lp_parser.cc
|
||||
ortools/lp_data/lp_parser.h)
|
||||
endif()
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
list(APPEND GLOP_COMPILE_DEFINITIONS "__WIN32__")
|
||||
|
||||
@@ -30,11 +30,9 @@ if(NOT TARGET protobuf::libprotobuf)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(@BUILD_LP_PARSER@)
|
||||
# re2 may not provide a CMake config files
|
||||
if(NOT TARGET re2::re2)
|
||||
find_dependency(re2 REQUIRED)
|
||||
endif()
|
||||
# re2 may not provide a CMake config files
|
||||
if(NOT TARGET re2::re2)
|
||||
find_dependency(re2 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(@USE_COINOR@)
|
||||
|
||||
@@ -377,7 +377,6 @@ cc_library(
|
||||
cc_binary(
|
||||
name = "solve",
|
||||
srcs = ["solve.cc"],
|
||||
defines = ["USE_LP_PARSER"],
|
||||
deps = [
|
||||
":linear_solver",
|
||||
":linear_solver_cc_proto",
|
||||
|
||||
@@ -26,7 +26,6 @@ ortools_java_wrap_cc(
|
||||
"//ortools/base:base_swig",
|
||||
"//ortools/util/java:vector_swig",
|
||||
],
|
||||
swig_opt = "-DUSE_LP_PARSER",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//ortools/linear_solver/wrappers:model_builder_helper",
|
||||
|
||||
@@ -619,19 +619,10 @@ PYBIND11_MODULE(model_builder_helper, m) {
|
||||
py::arg("mps_string"))
|
||||
.def("import_from_mps_file", &ModelBuilderHelper::ImportFromMpsFile,
|
||||
py::arg("mps_file"))
|
||||
#if defined(USE_LP_PARSER)
|
||||
.def("import_from_lp_string", &ModelBuilderHelper::ImportFromLpString,
|
||||
py::arg("lp_string"))
|
||||
.def("import_from_lp_file", &ModelBuilderHelper::ImportFromLpFile,
|
||||
py::arg("lp_file"))
|
||||
#else
|
||||
.def("import_from_lp_string", [](const std::string& lp_string) {
|
||||
LOG(INFO) << "Parsing LP string is not compiled in";
|
||||
})
|
||||
.def("import_from_lp_file", [](const std::string& lp_file) {
|
||||
LOG(INFO) << "Parsing LP file is not compiled in";
|
||||
})
|
||||
#endif
|
||||
.def(
|
||||
"fill_model_from_sparse_data",
|
||||
[](ModelBuilderHelper* helper,
|
||||
|
||||
@@ -133,15 +133,11 @@ MPModelRequest ReadMipModel(const std::string& input) {
|
||||
MPModelRequest request_proto;
|
||||
MPModelProto model_proto;
|
||||
if (absl::EndsWith(input, ".lp")) {
|
||||
#if defined(USE_LP_PARSER)
|
||||
std::string data;
|
||||
CHECK_OK(file::GetContents(input, &data, file::Defaults()));
|
||||
absl::StatusOr<MPModelProto> result = ModelProtoFromLpFormat(data);
|
||||
CHECK_OK(result);
|
||||
model_proto = std::move(result).value();
|
||||
#else // !defined(USE_LP_PARSER)
|
||||
LOG(FATAL) << "Support for parsing LP format is not compiled in.";
|
||||
#endif // !defined(USE_LP_PARSER)
|
||||
} else if (absl::EndsWith(input, ".mps") ||
|
||||
absl::EndsWith(input, ".mps.gz")) {
|
||||
QCHECK_OK(glop::MPSReader().ParseFile(input, &model_proto))
|
||||
|
||||
@@ -33,7 +33,6 @@ cc_library(
|
||||
"-DUSE_HIGHS",
|
||||
"-DUSE_PDLP",
|
||||
"-DUSE_SCIP",
|
||||
"-DUSE_LP_PARSER",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
|
||||
@@ -48,9 +48,7 @@
|
||||
#if defined(USE_PDLP)
|
||||
#include "ortools/linear_solver/proto_solver/pdlp_proto_solver.h"
|
||||
#endif // defined(USE_PDLP)
|
||||
#if defined(USE_LP_PARSER)
|
||||
#include "ortools/lp_data/lp_parser.h"
|
||||
#endif // defined(USE_LP_PARSER)
|
||||
#include "ortools/lp_data/mps_reader.h"
|
||||
#include "ortools/xpress/environment.h"
|
||||
|
||||
@@ -121,7 +119,6 @@ bool ModelBuilderHelper::ImportFromMpsFile(const std::string& mps_file) {
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined(USE_LP_PARSER)
|
||||
bool ModelBuilderHelper::ImportFromLpString(const std::string& lp_string) {
|
||||
absl::StatusOr<MPModelProto> model_or = ModelProtoFromLpFormat(lp_string);
|
||||
if (!model_or.ok()) return false;
|
||||
@@ -139,7 +136,6 @@ bool ModelBuilderHelper::ImportFromLpFile(const std::string& lp_file) {
|
||||
model_ = model_or.value();
|
||||
return true;
|
||||
}
|
||||
#endif // #if defined(USE_LP_PARSER)
|
||||
|
||||
const MPModelProto& ModelBuilderHelper::model() const { return model_; }
|
||||
|
||||
|
||||
@@ -382,10 +382,8 @@ class ModelBuilderHelper {
|
||||
|
||||
bool ImportFromMpsString(const std::string& mps_string);
|
||||
bool ImportFromMpsFile(const std::string& mps_file);
|
||||
#if defined(USE_LP_PARSER)
|
||||
bool ImportFromLpString(const std::string& lp_string);
|
||||
bool ImportFromLpFile(const std::string& lp_file);
|
||||
#endif // defined(USE_LP_PARSER)
|
||||
|
||||
const MPModelProto& model() const;
|
||||
MPModelProto* mutable_model();
|
||||
|
||||
@@ -240,7 +240,6 @@ cc_library(
|
||||
srcs = ["lp_parser.cc"],
|
||||
hdrs = ["lp_parser.h"],
|
||||
copts = SAFE_FP_CODE,
|
||||
defines = ["USE_LP_PARSER"],
|
||||
deps = [
|
||||
":base",
|
||||
":lp_data",
|
||||
|
||||
@@ -33,11 +33,8 @@
|
||||
#include "ortools/lp_data/lp_data.h"
|
||||
#include "ortools/lp_data/lp_types.h"
|
||||
#include "ortools/lp_data/proto_utils.h"
|
||||
#if defined(USE_LP_PARSER)
|
||||
#include "re2/re2.h"
|
||||
#endif // defined(USE_LP_PARSER)
|
||||
|
||||
#if defined(USE_LP_PARSER)
|
||||
namespace operations_research {
|
||||
namespace glop {
|
||||
|
||||
@@ -465,5 +462,3 @@ absl::StatusOr<MPModelProto> ModelProtoFromLpFormat(absl::string_view model) {
|
||||
}
|
||||
|
||||
} // namespace operations_research
|
||||
|
||||
#endif // defined(USE_LP_PARSER)
|
||||
|
||||
@@ -74,8 +74,6 @@
|
||||
#ifndef OR_TOOLS_LP_DATA_LP_PARSER_H_
|
||||
#define OR_TOOLS_LP_DATA_LP_PARSER_H_
|
||||
|
||||
#if defined(USE_LP_PARSER)
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -125,6 +123,4 @@ absl::StatusOr<ParsedConstraint> ParseConstraint(absl::string_view constraint);
|
||||
} // namespace glop
|
||||
} // namespace operations_research
|
||||
|
||||
#endif // defined(USE_LP_PARSER)
|
||||
|
||||
#endif // OR_TOOLS_LP_DATA_LP_PARSER_H_
|
||||
|
||||
Reference in New Issue
Block a user