今天,我来给大家分享一下opencv安装时报的错。然后讲错是怎么解决的。
为啥老是写一些环境搭建的博客?因为环境搭建琐碎而繁杂,希望写下来,帮助大家。让大家少走弯路。
专注主业,专注算法的实现和优化。
错误是这样的:
CMake Error at cuda_compile_generated_warp.cu.o.cmake:264 (message)
Building CXX object modules/ocl/CMakeFiles/opencv_test_ocl.dir/test/test_optflow.cpp.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_arithm.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [modules/ocl/CMakeFiles/opencv_perf_ocl.dir/perf/perf_stat.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [modules/ocl/CMakeFiles/opencv_test_ocl.dir/test/test_objdetect.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [modules/ocl/CMakeFiles/opencv_test_ocl.dir/test/test_ml.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** [modules/ocl/CMakeFiles/opencv_test_ocl.dir/test/test_match_template.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
谷歌了好久都没找到原因。我发现我编译的时候硬盘灯一直亮。感觉不应该。可能是编译的线程起多了,导致一些进程在不断读写相同的程序代码。
因为我是make -j990
实在没招了。索性再编译一次:
make -j16。
16是我机器的CPU 核数。
居然安全编译通过了。opencv 真是折腾人。