<h2 dir="auto">I tried to install caffe2 by following this link  "<a href="https://caffe2.ai/docs/getting-started.html?platform=ubuntu&amp;configuration=compile" rel="nofollow">https://caffe2.ai/docs/getting-started.html?platform=ubuntu&amp;configuration=compile</a> "</h2>
<p dir="auto">Every step was sucesfully compiled , but unfortunately while compiling the last command</p>
<p dir="auto">**<strong>sudo make install</strong></p>
<p dir="auto">I am getting the following ### output/error :</p>
<p dir="auto">Scanning dependencies of target python_copy_files<br>
[ 72%] Built target python_copy_files<br>
[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o<br>
[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o<br>
In file included from /usr/local/cuda/include/common_functions.h:50:0,<br>
from /usr/local/cuda/include/cuda_runtime.h:115,<br>
from :0:<br>
/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""<strong>CUDACC_VER</strong> is no longer supported.  Use <strong>CUDACC_VER_MAJOR</strong>, <strong>CUDACC_VER_MINOR</strong>, and <strong>CUDACC_VER_BUILD</strong> instead."" is not valid in preprocessor expressions<br>
#define <strong>CUDACC_VER</strong> "<strong>CUDACC_VER</strong> is no longer supported.  Use <strong>CUDACC_VER_MAJOR</strong>, <strong>CUDACC_VER_MINOR</strong>, and <strong>CUDACC_VER_BUILD</strong> instead."<br>
^<br>
/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘<strong>CUDACC_VER</strong>’<br>
#if defined(<strong>CUDACC_VER</strong>) &amp;&amp;  <strong>CUDACC_VER</strong> &gt;= 70500 &amp;&amp; __cplusplus &gt; 199711L<br>
^<br>
CMake Error at caffe2_gpu_generated_math_gpu.cu.o.Release.cmake:219 (message):<br>
Error generating<br>
/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/utils/./caffe2_gpu_generated_math_gpu.cu.o</p>
<p dir="auto">caffe2/CMakeFiles/caffe2_gpu.dir/build.make:63: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o' failed<br>
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o] Error 1<br>
CMakeFiles/Makefile2:1456: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/all' failed<br>
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2<br>
Makefile:138: recipe for target 'all' failed<br>
make: *** [all] Error 2</p>
<p dir="auto"><strong>python collect_env.py</strong><br>
Collecting environment information...<br>
PyTorch version: 0.4.0<br>
Is debug build: No<br>
CUDA used to build PyTorch: 8.0.61</p>
<p dir="auto">OS: Ubuntu 16.04.4 LTS<br>
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609<br>
CMake version: version 3.5.1</p>
<p dir="auto">Python version: 2.7<br>
Is CUDA available: Yes<br>
CUDA runtime version: 9.0.252<br>
GPU models and configuration: GPU 0: Quadro M2000M<br>
Nvidia driver version: 384.130<br>
cuDNN version: Probably one of the following:<br>
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.4<br>
/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a</p>
<p dir="auto">Versions of relevant libraries:<br>
[pip] numpy (1.11.0)<br>
[pip] torch (0.4.0)<br>
[conda] Could not collect</p>
<p dir="auto"><strong>### Installation guide followed  -</strong><br>
<a href="https://caffe2.ai/docs/getting-started.html?platform=ubuntu&amp;configuration=compile" rel="nofollow">https://caffe2.ai/docs/getting-started.html?platform=ubuntu&amp;configuration=compile</a></p>
<h3 dir="auto"><strong>Error Output</strong></h3>
<p dir="auto">Scanning dependencies of target python_copy_files<br>
[ 72%] Built target python_copy_files<br>
[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o<br>
[ 72%] Building NVCC (Device) object caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o<br>
In file included from /usr/local/cuda/include/common_functions.h:50:0,<br>
from /usr/local/cuda/include/cuda_runtime.h:115,<br>
from :0:<br>
/usr/local/cuda/include/crt/common_functions.h:64:24: error: token ""<strong>CUDACC_VER</strong> is no longer supported.  Use <strong>CUDACC_VER_MAJOR</strong>, <strong>CUDACC_VER_MINOR</strong>, and <strong>CUDACC_VER_BUILD</strong> instead."" is not valid in preprocessor expressions<br>
#define <strong>CUDACC_VER</strong> "<strong>CUDACC_VER</strong> is no longer supported.  Use <strong>CUDACC_VER_MAJOR</strong>, <strong>CUDACC_VER_MINOR</strong>, and <strong>CUDACC_VER_BUILD</strong> instead."<br>
^<br>
/usr/include/eigen3/Eigen/src/Core/util/Macros.h:364:33: note: in expansion of macro ‘<strong>CUDACC_VER</strong>’<br>
#if defined(<strong>CUDACC_VER</strong>) &amp;&amp;  <strong>CUDACC_VER</strong> &gt;= 70500 &amp;&amp; __cplusplus &gt; 199711L<br>
^<br>
CMake Error at caffe2_gpu_generated_math_gpu.cu.o.Release.cmake:219 (message):<br>
Error generating<br>
/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/utils/./caffe2_gpu_generated_math_gpu.cu.o</p>
<p dir="auto">caffe2/CMakeFiles/caffe2_gpu.dir/build.make:63: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o' failed<br>
make[2]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/utils/caffe2_gpu_generated_math_gpu.cu.o] Error 1<br>
CMakeFiles/Makefile2:1456: recipe for target 'caffe2/CMakeFiles/caffe2_gpu.dir/all' failed<br>
make[1]: *** [caffe2/CMakeFiles/caffe2_gpu.dir/all] Error 2<br>
Makefile:138: recipe for target 'all' failed<br>
make: *** [all] Error 2</p>
<h2 dir="auto">Issue description</h2>
<p dir="auto">Error during running the command<br>
$ <strong>sudo make install</strong></p>
<h2 dir="auto">Code example</h2>
<h3 dir="auto"><strong>output of cmake ..</strong></h3>
<p dir="auto">Does not need to define long separately.<br>
-- std::exception_ptr is supported.<br>
-- NUMA is available<br>
-- Current compiler supports avx2 extention. Will build perfkernels.<br>
-- Building using own protobuf under third_party per request.<br>
-- Use custom protobuf build.<br>
-- Caffe2 protobuf include directory: <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="a21919c5dc5e071dc3303b95e0117d06">$&amp;lt;BUILD_INTERFACE:/home/rv/pytorch/third_party/protobuf/src&amp;gt;$</math-renderer>&amp;lt;INSTALL_INTERFACE:include&gt;<br>
-- The BLAS backend of choice:Eigen<br>
-- Brace yourself, we are building NNPACK<br>
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")<br>
-- Caffe2: Cannot find gflags automatically. Using legacy find.<br>
-- Caffe2: Found gflags  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libgflags.so)<br>
-- Caffe2: Cannot find glog automatically. Using legacy find.<br>
-- Caffe2: Found glog (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libglog.so)<br>
-- Found lmdb    (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/liblmdb.so)<br>
-- Found LevelDB (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libleveldb.so)<br>
-- Found Snappy  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libsnappy.so)<br>
-- Found Numa  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libnuma.so)<br>
-- OpenCV found (/usr/share/OpenCV)<br>
-- Found system Eigen at /usr/include/eigen3<br>
-- Found PythonInterp: /usr/bin/python (found suitable version "2.7.12", minimum required is "2.7")<br>
-- NumPy ver. 1.11.0 found (include: /usr/lib/python2.7/dist-packages/numpy/core/include)<br>
-- Could NOT find pybind11 (missing:  pybind11_INCLUDE_DIR)<br>
-- MPI support found<br>
-- MPI compile flags:<br>
-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi<br>
-- MPI LINK flags path:  -Wl,-rpath  -Wl,/usr/lib/openmpi/lib  -Wl,--enable-new-dtags<br>
-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so<br>
CMake Warning at cmake/Dependencies.cmake:376 (message):<br>
OpenMPI found, but it is not built with CUDA support.<br>
Call Stack (most recent call first):<br>
CMakeLists.txt:181 (include)</p>
<p dir="auto">-- Caffe2: CUDA detected: 9.0<br>
-- Caffe2: CUDA nvcc is: /usr/local/cuda/bin/nvcc<br>
-- Caffe2: CUDA toolkit directory: /usr/local/cuda<br>
-- Caffe2: Header version is: 9.0<br>
-- Found cuDNN: v7.1.4  (include: /usr/include, library: /usr/lib/x86_64-linux-gnu/libcudnn.so)<br>
-- Autodetected CUDA architecture(s): 5.0<br>
-- Added CUDA NVCC flags for: -gencode;arch=compute_50,code=sm_50<br>
-- Could NOT find NCCL (missing:  NCCL_INCLUDE_DIRS NCCL_LIBRARIES)<br>
-- Could NOT find CUB (missing:  CUB_INCLUDE_DIR)<br>
-- Could NOT find Gloo (missing:  Gloo_INCLUDE_DIR Gloo_LIBRARY)<br>
-- MPI include path: /usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/usr/lib/openmpi/include/openmpi/opal/mca/event/libevent2021/libevent/include/usr/lib/openmpi/include/usr/lib/openmpi/include/openmpi<br>
-- MPI libraries: /usr/lib/openmpi/lib/libmpi_cxx.so/usr/lib/openmpi/lib/libmpi.so<br>
-- CUDA detected: 9.0<br>
-- Found libcuda: /usr/local/cuda-9.0/lib64/stubs/libcuda.so<br>
-- Found libnvrtc: /usr/local/cuda-9.0/lib64/libnvrtc.so<br>
-- Could NOT find NCCL (missing:  NCCL_INCLUDE_DIR NCCL_LIBRARY)<br>
CMake Warning at third_party/gloo/cmake/Dependencies.cmake:62 (message):<br>
Not compiling with NCCL support.  Suppress this warning with<br>
-DUSE_NCCL=OFF.<br>
Call Stack (most recent call first):<br>
third_party/gloo/CMakeLists.txt:56 (include)</p>
<p dir="auto">-- GCC 5.4.0: Adding gcc and gcc_s libs to link line<br>
-- Include NCCL operators<br>
-- Excluding ideep operators as we are not using ideep<br>
-- Including image processing operators<br>
-- Excluding video processing operators due to no opencv<br>
-- Excluding mkl operators as we are not using mkl<br>
-- Include Observer library<br>
CMake Error at cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:497 (file):<br>
file failed to open for writing (Permission denied):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o.depend"><pre class="notranslate"><code class="notranslate">/home/rv/pytorch/build/caffe2/CMakeFiles/caffe2_gpu.dir/sgd/caffe2_gpu_generated_adagrad_op_gpu.cu.o.depend
</code></pre></div>
<p dir="auto">Call Stack (most recent call first):<br>
cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:1595 (cuda_include_nvcc_dependencies)<br>
cmake/Modules_CUDA_fix/upstream/FindCUDA.cmake:1827 (CUDA_WRAP_SRCS)<br>
cmake/public/utils.cmake:134 (cuda_add_library)<br>
caffe2/CMakeLists.txt:230 (torch_cuda_based_add_library)</p>
<p dir="auto">-- Using lib/python2.7/dist-packages as python relative installation path<br>
-- Automatically generating missing <strong>init</strong>.py files.<br>
-- A previous caffe2 cmake run already created the <strong>init</strong>.py files.<br>
CMake Warning at CMakeLists.txt:341 (message):<br>
Generated cmake files are only fully tested if one builds with system glog,<br>
gflags, and protobuf.  Other settings may generate files that are not well<br>
tested.</p>
<h2 dir="auto">--<br>
-- ******** Summary ********<br>
-- General:<br>
--   CMake version         : 3.5.1<br>
--   CMake command         : /usr/bin/cmake<br>
--   Git version           : v0.1.11-9191-g08daed4<br>
--   System                : Linux<br>
--   C++ compiler          : /usr/bin/c++<br>
--   C++ compiler version  : 5.4.0<br>
--   BLAS                  : Eigen<br>
--   CXX flags             :  -fvisibility-inlines-hidden -DONNX_NAMESPACE=onnx_c2 -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-error=deprecated-declarations<br>
--   Build type            : Release<br>
--   Compile definitions   :<br>
--   CMAKE_PREFIX_PATH     :<br>
--   CMAKE_INSTALL_PREFIX  : /usr/local</h2>
<p dir="auto">--   BUILD_CAFFE2          : ON<br>
--   BUILD_ATEN            : OFF<br>
--   BUILD_BINARY          : ON<br>
--   BUILD_CUSTOM_PROTOBUF : ON<br>
--     Link local protobuf : ON<br>
--   BUILD_DOCS            : OFF<br>
--   BUILD_PYTHON          : ON<br>
--     Python version      : 2.7.12<br>
--     Python includes     : /usr/include/python2.7<br>
--   BUILD_SHARED_LIBS     : ON<br>
--   BUILD_TEST            : OFF<br>
--   USE_ASAN              : OFF<br>
--   USE_ATEN              : OFF<br>
--   USE_CUDA              : ON<br>
--     CUDA static link    : OFF<br>
--     USE_CUDNN           : ON<br>
--     CUDA version        : 9.0<br>
--     cuDNN version       : 7.1.4<br>
--     CUDA root directory : /usr/local/cuda<br>
--     CUDA library        : /usr/local/cuda-9.0/lib64/stubs/libcuda.so<br>
--     cudart library      : /usr/local/cuda/lib64/libcudart_static.a;-pthread;dl;/usr/lib/x86_64-linux-gnu/librt.so<br>
--     cublas library      : /usr/local/cuda/lib64/libcublas.so;/usr/local/cuda/lib64/libcublas_device.a<br>
--     cufft library       : /usr/local/cuda/lib64/libcufft.so<br>
--     curand library      : /usr/local/cuda/lib64/libcurand.so<br>
--     cuDNN library       : /usr/lib/x86_64-linux-gnu/libcudnn.so<br>
--     nvrtc               : /usr/local/cuda-9.0/lib64/libnvrtc.so<br>
--     CUDA include path   : /usr/local/cuda/include<br>
--     NVCC executable     : /usr/local/cuda/bin/nvcc<br>
--     CUDA host compiler  : /usr/bin/cc<br>
--     USE_TENSORRT        : OFF<br>
--   USE_ROCM              : OFF<br>
--   USE_EIGEN_FOR_BLAS    : ON<br>
--   USE_FFMPEG            : OFF<br>
--   USE_GFLAGS            : ON<br>
--   USE_GLOG              : ON<br>
--   USE_GLOO              : ON<br>
--     USE_GLOO_IBVERBS    : OFF<br>
--   USE_LEVELDB           : ON<br>
--     LevelDB version     : 1.18<br>
--     Snappy version      : 1.1.3<br>
--   USE_LITE_PROTO        : OFF<br>
--   USE_LMDB              : ON<br>
--     LMDB version        : 0.9.17<br>
--   USE_METAL             : OFF<br>
--   USE_MKL               :<br>
--   USE_MOBILE_OPENGL     : OFF<br>
--   USE_MPI               : ON<br>
--   USE_NCCL              : ON<br>
--     USE_SYSTEM_NCCL     : OFF<br>
--   USE_NERVANA_GPU       : OFF<br>
--   USE_NNPACK            : ON<br>
--   USE_OBSERVERS         : ON<br>
--   USE_OPENCL            : OFF<br>
--   USE_OPENCV            : ON<br>
--     OpenCV version      : 3.3.1<br>
--   USE_OPENMP            : OFF<br>
--   USE_PROF              : OFF<br>
--   USE_REDIS             : OFF<br>
--   USE_ROCKSDB           : OFF<br>
--   USE_ZMQ               : OFF<br>
--   Public Dependencies  : Threads::Threads;gflags;glog::glog<br>
--   Private Dependencies : nnpack;cpuinfo;/usr/lib/x86_64-linux-gnu/liblmdb.so;/usr/lib/x86_64-linux-gnu/libleveldb.so;/usr/lib/x86_64-linux-gnu/libsnappy.so;/usr/lib/x86_64-linux-gnu/libnuma.so;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_videoio;opencv_video;/usr/lib/openmpi/lib/libmpi_cxx.so;/usr/lib/openmpi/lib/libmpi.so;gloo;onnxifi_loader;gcc_s;gcc;dl<br>
-- Configuring incomplete, errors occurred!<br>
See also "/home/rv/pytorch/build/CMakeFiles/CMakeOutput.log".<br>
See also "/home/rv/pytorch/build/CMakeFiles/CMakeError.log".</p>
<h2 dir="auto">System Info</h2>