【发布时间】:2021-12-25 22:10:51
【问题描述】:
我正在尝试在 Linux Mint 20 Ulyana(基于 ubuntu 焦点)中使用 cmake (3.16.3) 构建 or-tools 7.1 版
我正在按照这里的说明进行操作https://github.com/google/or-tools/blob/f3fd201e68cf75b7720ff5c3cadc599a1d02b54b/cmake/README.md
首先我运行cmake -H. -Bbuild -G "Unix Makefiles",但由于找不到依赖项而失败,所以我将其替换为cmake -H. -Bbuild -G "Unix Makefiles" -DBUILD_DEPS=ON
但过了一段时间后出现以下错误
[ 55%] No test step for 'Cbc_project'
[ 66%] Completed 'Cbc_project'
[100%] Built target Cbc_project
-- Building Cbc: ...DONE
-- Configuring done
CMake Error at ortools/constraint_solver/CMakeLists.txt:57 (add_dependencies):
The dependency target "absl::container" of target
"ortools_constraint_solver" does not exist.
CMake Error at ortools/glop/CMakeLists.txt:50 (add_dependencies):
The dependency target "absl::container" of target "ortools_glop" does not
exist.
CMake Error at ortools/linear_solver/CMakeLists.txt:54 (add_dependencies):
The dependency target "absl::container" of target "ortools_linear_solver"
does not exist.
CMake Error at ortools/sat/CMakeLists.txt:60 (add_dependencies):
The dependency target "absl::container" of target "ortools_sat" does not
exist.
CMake Error at ortools/constraint_solver/CMakeLists.txt:33 (target_compile_options):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_OPTIONS>
Target "absl::container" not found.
CMake Error at ortools/constraint_solver/CMakeLists.txt:45 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/constraint_solver/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/constraint_solver/CMakeLists.txt:45 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/constraint_solver/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/glop/CMakeLists.txt:30 (target_compile_options):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_OPTIONS>
Target "absl::container" not found.
CMake Error at ortools/glop/CMakeLists.txt:40 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/glop/CMakeLists.txt:19 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/glop/CMakeLists.txt:40 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/glop/CMakeLists.txt:19 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/linear_solver/CMakeLists.txt:32 (target_compile_options):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_OPTIONS>
Target "absl::container" not found.
CMake Error at ortools/linear_solver/CMakeLists.txt:43 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/linear_solver/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/linear_solver/CMakeLists.txt:43 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/linear_solver/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/sat/CMakeLists.txt:34 (target_compile_options):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_OPTIONS>
Target "absl::container" not found.
CMake Error at ortools/sat/CMakeLists.txt:47 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/sat/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
CMake Error at ortools/sat/CMakeLists.txt:47 (target_compile_definitions):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_COMPILE_DEFINITIONS>
Target "absl::container" not found.
CMake Error at ortools/sat/CMakeLists.txt:20 (target_include_directories):
Error evaluating generator expression:
$<TARGET_PROPERTY:absl::container,INTERFACE_INCLUDE_DIRECTORIES>
Target "absl::container" not found.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
提前谢谢你!
【问题讨论】:
-
您也可以使用 CMake GUI。这样您就可以看到所有可用的选项。或者,您可以打开可能已经生成的 CMakeCache.txt。
-
另外,希望你关注these instructions
-
@Anastasios Loumpas:您的 cmake 说明:旧 (2018)。 新 (2021) = github.com/google/or-tools/blob/stable/cmake/README.md#deps ..... 最小值为
abseil-cpp, protobuf >= 3.12, (bazel?)................. →cmake .. -DUSE_SCIP=OFF -DUSE_COINOR=OFF -
谢谢@KnudLarsen 我正在寻找旧的,因为我正在寻找 7.1 分支。我会看看新的说明
-
不保证新版本(v9.1 github.com/google/or-tools/releases 和当前 github 版本)更容易构建。我失败了github.com/google/or-tools