【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>>
cmake命令参数为:
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_CXX_FLAGS="-std=c++11" \
-D CUDA_NVCC_FLAGS=--expt-relaxed-constexpr \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D WITH_CUDA=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D BUILD_opencv_python2=OFF \
-D BUILD_opencv_python3=ON \
-D PYTHON_EXECUTABLE=~/.virtualenvs/cv/bin/python \
-D PYTHON_PACKAGES_PATH=/home/allen/.virtualenvs/cv/lib/python3.6/site-packages \
-D PYTHON_LIBRARY=$(python3.6 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") \
-D BUILD_EXAMPLES=ON ..
- 参照例子一;
- 参照例子二;
- 参照例子三
- 编译错误
This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support \
: https://github.com/BVLC/caffe/issues/6358#issuecomment-383446222 - 编译错误
/opencv-3.4.5/modules/core/include/opencv2/core/cuda/vec_math.hpp(203): error: calling a constexpr __host__ function("abs") from a __device__ function("abs") is not allowed. The experimental flag '--expt-relaxed-constexpr' can be used to allow this.
: https://github.com/opencv/opencv/issues/8704#issuecomment-393738317
来源:oschina
链接:https://my.oschina.net/zhweizhwei/blog/3146034