编译 opencv 出现 Segmentation fault (core dumped) 或者 internal compiler error: Segmentation fault
设置 cmake 选项 ENABLE_PRECOMPILED_HEADERS=OFF
,例如:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-$OPENCV_VERSION/modules \
-D OPENCV_ENABLE_NONFREE=ON \
-D BUILD_PERF_TESTS=OFF \
-D BUILD_TESTS=OFF \
-D BUILD_DOCS=ON \
-D BUILD_EXAMPLES=ON \
-D ENABLE_PRECOMPILED_HEADERS=OFF \
-D WITH_TBB=ON \
-D WITH_OPENMP=ON \
-D ENABLE_NEON=ON \
-D ENABLE_VFPV3=ON \
-D OPENCV_GENERATE_PKGCONFIG=YES \
-D OPENCV_EXTRA_EXE_LINKER_FLAGS=-latomic \
-D PYTHON3_EXECUTABLE=$(which python3) \
-D PYTHON_EXECUTABLE=$(which python2) \
..