gpt4 book ai didi

c++ - 单目Total Capture编译过程错误: Makefile:83: recipe for target 'CMakeFiles/mylib.dir/all' failed

转载 作者:行者123 更新时间:2023-12-01 19:18:36 26 4
gpt4 key购买 nike

我正在尝试使用此存储库:

https://github.com/CMU-Perceptual-Computing-Lab/MonocularTotalCapture

这些是我已经安装的软件包:

ffmpeg
Python 2.7.12 (with TensorFlow 1.5.0, OpenCV, Matplotlib, packages installed with pip3)
openCV 4.2.0
cmake = 3.5.1
OpenCV 2.4.13 (compiled from source with CUDA 9.0, CUDNN 7.0)
Ceres-Solver 1.13.0 (with SuiteSparse)
OpenGL, GLUT, GLEW
libigl https://github.com/libigl/libigl
wget
OpenPose
eigen3, version 3.3.7
Boost version: 1.58.0
GNU 5.4.0

不幸的是,我最后遇到了一个错误,而且我不知道如何修复。

-- Build files have been written to: /home/ziom/Scrivania/MonocularTotalCapture/FitAdam/build

mario@ziom-Z87-HD3:/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/build# make -j12

/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/src/AdamFastCost.cpp: In member function ‘void AdamFullCost::SparseRegress(const Eigen::SparseMatrix<double, 0>&, const double*, const double*, const double*, const double*, double*, double*, double*, double*) const’:
/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/src/AdamFastCost.cpp:1200:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int ic = 0; ic < total_vertex.size(); ic++)
^
/home/ziom/Scrivania/MonocularTotalCapture/FitAdam/src/AdamFastCost.cpp:1225:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for (int ic = 0; ic < total_vertex.size(); ic++)
^
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/mylib.dir/all' failed
make[1]: *** [CMakeFiles/MYLIB.dir/all] Errore 2
Makefile:83: recipe for target 'CMakeFiles/mylib.dir/all' failed
make: *** [all] Errore 2

最佳答案

开始在评论中输入对此的回应,但它太长了......所以我只是做一个答案。

你显然有 2 个警告,但你却因 2 个错误而失败。这就是 -Werror 的作用。现在,您对 -Wno-error 所做的操作应该可以工作,但如果后跟 -Werror ,它可能会被覆盖。例如,如果我使用 gcc 构建一个简单的程序,如下所示:

gcc -Wno-error -Werror test.c

-Werror 命令已覆盖 -Wno-error 命令。我刚刚查看了该项目中的 CMakeLists.txt 文件,没有看到任何提及 -Werror 的内容。由于默认情况下该功能是关闭的,因此它一定在某个地方。以下是该项目的 CMakeLists.txt 文件的片段:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

我认为可以为 ${OpenMP_C_FLAGS}${OpenMP_CXX_Flags} 设置 -Werror。要测试这一点,您可以使用 cmake 的 message 函数。在 CMAKE_CXX_FLAGS 赋值后添加以下行:

message("CFlags: ${CMAKE_C_FLAGS} CXXFlags: ${CMAKE_CXX_FLAGS}")

我的理论是,您会在某个地方找到-Werror。如果是这种情况,只需在 CMakeLists.txt 中的这两行(8 和 10)末尾抛出 -Wno-error 即可:

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -Wno-error")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -Wno-error")

尾随的-Wno-error将覆盖其中的任何-Werror。可能有一个更纯粹的 cmake 解决方案来处理这个问题,但我不是 cmake 专家。

关于c++ - 单目Total Capture编译过程错误: Makefile:83: recipe for target 'CMakeFiles/mylib.dir/all' failed,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60609893/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com