[英]Monocular Total Capture compilation process error : Makefile:83: recipe for target 'CMakeFiles/mylib.dir/all' failed
我正在嘗試使用這個 repo :
https://github.com/CMU-Perceptual-Computing-Lab/MoncularTotalCapture
這些是我安裝的軟件包:
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}")
我在想, -Werror
可用於設置${OpenMP_C_FLAGS}
或${OpenMP_CXX_Flags}
。 要對此進行測試,您可以使用 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 專家。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.