Repository: pytorch
Issue: Failed to build with system protobuf
Labels: module: build,module: protobuf,triaged

## 🐛 Bug

Failed to build (link) `caffe2_benchmark` target.

## To Reproduce

Steps to reproduce the behavior:

1. `git submodule update --init --recursive`
2. `... python setup.py build`
3. Get error:
```bash
[ 94%] Linking CXX executable ../bin/caffe2_benchmark
/usr/bin/ld: ../../../../../lib/libpthreadpool.a(threadpool-pthreads.c.o): in function `pthreadpool_create':
threadpool-pthreads.c:(.text+0x520): multiple definition of `pthreadpool_create'; ../../../../../lib/libcaffe2.a(pthreadpool_impl.cc.o):pthreadpool_impl.cc:(.text+0x140): first defined here
/usr/bin/ld: ../../../../../lib/libpthreadpool.a(threadpool-pthreads.c.o): in function `pthreadpool_get_threads_count':
threadpool-pthreads.c:(.text+0x670): multiple definition of `pthreadpool_get_threads_count'; ../../../../../lib/libcaffe2.a(pthreadpool_impl.cc.o):pthreadpool_impl.cc:(.text+0x120): first defined here
/usr/bin/ld: ../../../../../lib/libpthreadpool.a(threadpool-pthreads.c.o): in function `pthreadpool_compute_1d':
threadpool-pthreads.c:(.text+0x680): multiple definition of `pthreadpool_compute_1d'; ../../../../../lib/libcaffe2.a(pthreadpool_impl.cc.o):pthreadpool_impl.cc:(.text+0x50): first defined here
/usr/bin/ld: ../../../../../lib/libpthreadpool.a(threadpool-pthreads.c.o): in function `pthreadpool_destroy':
threadpool-pthreads.c:(.text+0x17d0): multiple definition of `pthreadpool_destroy'; ../../../../../lib/libcaffe2.a(pthreadpool_impl.cc.o):pthreadpool_impl.cc:(.text+0x1f0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [caffe2/torch/lib/c10d/test/CMakeFiles/ProcessGroupGlooTest.dir/build.make:119: bin/ProcessGroupGlooTest] Error 1
make[1]: *** [CMakeFiles/Makefile2:10591: caffe2/torch/lib/c10d/test/CMakeFiles/ProcessGroupGlooTest.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
```

## Expected behavior

Expected to build and link fine

## Environment
`collect_env.py`:
```
Collecting environment information...
PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A

OS: Arch Linux
GCC version: (GCC) 8.3.0
CMake version: version 3.14.3

Python version: 3.7
Is CUDA available: N/A
CUDA runtime version: 10.1.105
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: /usr/lib/libcudnn.so.7.5.1

Versions of relevant libraries:
[pip] Could not collect
[conda] Could not collect
```
Manual spec:

 - PyTorch Version (e.g., 1.0): 1.1.0
 - OS (e.g., Linux): ArchLinux x86_64
 - How you installed PyTorch (`conda`, `pip`, source): source
 - Build command you used (if compiling from source):
```bash
# Build command
  export CC=gcc
  export CXX=g++
  export PYTORCH_BUILD_VERSION="1.1.0"
  export PYTORCH_BUILD_NUMBER=1
  export BUILD_CUSTOM_PROTOBUF=0
  export BUILD_SHARED_LIBS=0
  export NO_CUDA=1
  export WITH_CUDNN=0
  export USE_OPENCV=1
  export BUILD_BINARY=1
  python setup.py build
```
 - Python version: 3.7.3
 - CUDA/cuDNN version: N/A
 - GPU models and configuration: N/A
 - Any other relevant information:

## Additional context

Full config log:
```
-- The CXX compiler identification is GNU 8.3.0
-- The C compiler identification is GNU 8.3.0
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Not forcing any particular BLAS to be found
-- Performing Test COMPILER_WORKS
-- Performing Test COMPILER_WORKS - Success
-- Performing Test SUPPORT_GLIBCXX_USE_C99
-- Performing Test SUPPORT_GLIBCXX_USE_C99 - Success
-- Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED
-- Performing Test CAFFE2_EXCEPTION_PTR_SUPPORTED - Success
-- std::exception_ptr is supported.
-- Performing Test CAFFE2_IS_NUMA_AVAILABLE
-- Performing Test CAFFE2_IS_NUMA_AVAILABLE - Failed
-- NUMA is not available
-- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING
-- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Success
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX2_EXTENSIONS - Success
-- Current compiler supports avx2 extension. Will build perfkernels.
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS
-- Performing Test CAFFE2_COMPILER_SUPPORTS_AVX512_EXTENSIONS - Success
-- Current compiler supports avx512f extension. Will build fbgemm.
-- Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_SUPPORTS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_SUPPORTS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_SUPPORTS_RDYNAMIC
-- Performing Test COMPILER_SUPPORTS_RDYNAMIC - Success
-- Caffe2: Found protobuf with new-style protobuf targets.
-- Caffe2 protobuf include directory: /usr/include
-- Found Threads: TRUE  
-- Trying to find preferred BLAS backend of choice: MKL
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
CMake Warning at cmake/Dependencies.cmake:120 (message):
  MKL could not be found.  Defaulting to Eigen
Call Stack (most recent call first):
  CMakeLists.txt:236 (include)


CMake Warning at cmake/Dependencies.cmake:139 (message):
  Preferred BLAS (MKL) cannot be found, now searching for a general BLAS
  library
Call Stack (most recent call first):
  CMakeLists.txt:236 (include)


-- Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_gnu_thread - mkl_core - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_gnu_thread - mkl_core - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_gnu_thread - mkl_core - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf_lp64 - mkl_intel_thread - mkl_core - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_gnu_thread - mkl_core - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_gf - mkl_intel_thread - mkl_core - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_sequential - mkl_core - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_sequential - mkl_core - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_core - gomp - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_core - gomp - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_core - iomp5 - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl_intel_lp64 - mkl_core - pthread - m - dl]
--   Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_core - pthread - m - dl]
--   Library mkl_intel: not found
-- Checking for [mkl_gf_lp64 - mkl_core - pthread - m - dl]
--   Library mkl_gf_lp64: not found
-- Checking for [mkl_gf - mkl_core - pthread - m - dl]
--   Library mkl_gf: not found
-- Checking for [mkl - guide - pthread - m]
--   Library mkl: not found
-- MKL library not found
-- Checking for [Accelerate]
--   Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
--   Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [openblas]
--   Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [openblas - pthread]
--   Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran]
--   Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran - pthread]
--   Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [acml - gfortran]
--   Library acml: BLAS_acml_LIBRARY-NOTFOUND
-- Checking for [ptf77blas - atlas - gfortran]
--   Library ptf77blas: BLAS_ptf77blas_LIBRARY-NOTFOUND
-- Checking for [blas]
--   Library blas: /usr/lib/libblas.so
-- Looking for sgemm_
-- Looking for sgemm_ - found
-- Performing Test BLAS_F2C_DOUBLE_WORKS
-- Performing Test BLAS_F2C_DOUBLE_WORKS - Failed
-- Performing Test BLAS_F2C_FLOAT_WORKS
-- Performing Test BLAS_F2C_FLOAT_WORKS - Success
-- Performing Test BLAS_USE_CBLAS_DOT
-- Performing Test BLAS_USE_CBLAS_DOT - Failed
-- Found a library with BLAS API (generic).
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/gcc
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Brace yourself, we are building NNPACK
-- Performing Test NNPACK_ARCH_IS_X86_32
-- Performing Test NNPACK_ARCH_IS_X86_32 - Failed
-- Found PythonInterp: /usr/bin/python (found version "3.7.3") 
-- NNPACK backend is x86-64
-- Failed to find LLVM FileCheck
-- Found Git: /usr/bin/git (found version "2.21.0") 
-- git Version: v1.4.0-505be96a
-- Version: 1.4.0
-- Performing Test HAVE_CXX_FLAG_STD_CXX11
-- Performing Test HAVE_CXX_FLAG_STD_CXX11 - Success
-- Performing Test HAVE_CXX_FLAG_WALL
-- Performing Test HAVE_CXX_FLAG_WALL - Success
-- Performing Test HAVE_CXX_FLAG_WEXTRA
-- Performing Test HAVE_CXX_FLAG_WEXTRA - Success
-- Performing Test HAVE_CXX_FLAG_WSHADOW
-- Performing Test HAVE_CXX_FLAG_WSHADOW - Success
-- Performing Test HAVE_CXX_FLAG_WERROR
-- Performing Test HAVE_CXX_FLAG_WERROR - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC
-- Performing Test HAVE_CXX_FLAG_PEDANTIC - Success
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS
-- Performing Test HAVE_CXX_FLAG_PEDANTIC_ERRORS - Success
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32
-- Performing Test HAVE_CXX_FLAG_WSHORTEN_64_TO_32 - Failed
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL
-- Performing Test HAVE_CXX_FLAG_WFLOAT_EQUAL - Success
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_FSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS
-- Performing Test HAVE_CXX_FLAG_WNO_DEPRECATED_DECLARATIONS - Success
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING
-- Performing Test HAVE_CXX_FLAG_WSTRICT_ALIASING - Success
-- Performing Test HAVE_CXX_FLAG_WD654
-- Performing Test HAVE_CXX_FLAG_WD654 - Failed
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY
-- Performing Test HAVE_CXX_FLAG_WTHREAD_SAFETY - Failed
-- Performing Test HAVE_CXX_FLAG_COVERAGE
-- Performing Test HAVE_CXX_FLAG_COVERAGE - Success
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX
-- Performing Test HAVE_STD_REGEX -- success
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Performing Test COMPILER_SUPPORTS_AVX512
-- Performing Test COMPILER_SUPPORTS_AVX512 - Success
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
-- Downloading asmjit to /build/python-pytorch/src/pytorch-1.1.0/build/third_party/fbgemm/third_party/asmjit
      (define ASMJIT_SRC_DIR to avoid it)
-- Configuring done
-- Generating done
-- Build files have been written to: /build/python-pytorch/src/pytorch-1.1.0/build/third_party/fbgemm/asmjit-download
Scanning dependencies of target asmjit
[ 11%] Creating directories for 'asmjit'
[ 22%] Performing download step (git clone) for 'asmjit'
Cloning into 'asmjit'...
Note: checking out '673dcefaa048c5f5a2bf8b85daf8f7b9978d018a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 673dcef Fixed #188
[ 33%] No patch step for 'asmjit'
[ 44%] Performing update step for 'asmjit'
[ 55%] No configure step for 'asmjit'
[ 66%] No build step for 'asmjit'
[ 77%] No install step for 'asmjit'
[ 88%] No test step for 'asmjit'
[100%] Completed 'asmjit'
[100%] Built target asmjit
CMake Warning (dev) at build/third_party/fbgemm/third_party/asmjit/CMakeLists.txt:34 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at build/third_party/fbgemm/third_party/asmjit/CMakeLists.txt:35 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at build/third_party/fbgemm/third_party/asmjit/CMakeLists.txt:36 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at build/third_party/fbgemm/third_party/asmjit/CMakeLists.txt:37 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at build/third_party/fbgemm/third_party/asmjit/CMakeLists.txt:38 (set):
  implicitly converting 'BOOLEAN' to 'STRING' type.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test __CxxFlag__msse
-- Performing Test __CxxFlag__msse - Success
-- Performing Test __CxxFlag__msse2
-- Performing Test __CxxFlag__msse2 - Success
-- Performing Test __CxxFlag__msse3
-- Performing Test __CxxFlag__msse3 - Success
-- Performing Test __CxxFlag__mssse3
-- Performing Test __CxxFlag__mssse3 - Success
-- Performing Test __CxxFlag__msse4_1
-- Performing Test __CxxFlag__msse4_1 - Success
-- Performing Test __CxxFlag__msse4_2
-- Performing Test __CxxFlag__msse4_2 - Success
-- Performing Test __CxxFlag__mavx
-- Performing Test __CxxFlag__mavx - Success
-- Performing Test __CxxFlag__mavx2
-- Performing Test __CxxFlag__mavx2 - Success
-- Performing Test __CxxFlag__std_c__17
-- Performing Test __CxxFlag__std_c__17 - Success
-- Performing Test __CxxFlag__std_c__14
-- Performing Test __CxxFlag__std_c__14 - Success
-- Performing Test __CxxFlag__std_c__11
-- Performing Test __CxxFlag__std_c__11 - Success
-- Performing Test __CxxFlag__std_c__0x
-- Performing Test __CxxFlag__std_c__0x - Success
-- Performing Test __CxxFlag__fno_tree_vectorize
-- Performing Test __CxxFlag__fno_tree_vectorize - Success
-- Performing Test __CxxFlag__fvisibility_hidden
-- Performing Test __CxxFlag__fvisibility_hidden - Success
-- Performing Test __CxxFlag__Winconsistent_missing_override
-- Performing Test __CxxFlag__Winconsistent_missing_override - Failed
-- Performing Test __CxxFlag__O2
-- Performing Test __CxxFlag__O2 - Success
-- Performing Test __CxxFlag__fno_keep_static_consts
-- Performing Test __CxxFlag__fno_keep_static_consts - Success
-- Performing Test __CxxFlag__fmerge_all_constants
-- Performing Test __CxxFlag__fmerge_all_constants - Success
-- [asmjit]
   BuildMode=Static
   BuildTest=Off
   ASMJIT_DIR=/build/python-pytorch/src/pytorch-1.1.0/build/third_party/fbgemm/third_party/asmjit
   ASMJIT_DEPS=pthread;rt
   ASMJIT_LIBS=asmjit;pthread;rt
   ASMJIT_CFLAGS=-DASMJIT_STATIC
   ASMJIT_SOURCE_DIR=/build/python-pytorch/src/pytorch-1.1.0/build/third_party/fbgemm/third_party/asmjit/src
   ASMJIT_INCLUDE_DIR=/build/python-pytorch/src/pytorch-1.1.0/build/third_party/fbgemm/third_party/asmjit/src
   ASMJIT_PRIVATE_CFLAGS=
     -DASMJIT_STATIC
     -std=c++17
     -fno-tree-vectorize
     -fvisibility=hidden
     -O2 [RELEASE]
     -fno-keep-static-consts [RELEASE]
     -fmerge-all-constants [RELEASE]
-- Could NOT find Numa (missing: Numa_INCLUDE_DIR Numa_LIBRARIES) 
CMake Warning at cmake/Dependencies.cmake:487 (message):
  Not compiling with NUMA.  Suppress this warning with -DUSE_NUMA=OFF
Call Stack (most recent call first):
  CMakeLists.txt:236 (include)


-- OpenCV found (/usr/lib64/cmake/opencv4)
-- Using third party subdirectory Eigen.
Python 3.7.3
-- Found PythonInterp: /usr/bin/python (found suitable version "3.7.3", minimum required is "2.7") 
-- Found PythonLibs: /usr/lib/libpython3.7m.so.1.0 (found suitable version "3.7.3", minimum required is "2.7") 
-- Found PythonInterp: /usr/bin/python (found version "3.7.3") 
-- Found PythonLibs: /usr/lib/libpython3.7m.so.1.0
-- System pybind11 found
-- pybind11 include dirs: /usr/include;/usr/include/python3.7m
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) 
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) 
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) 
CMake Warning at cmake/Dependencies.cmake:714 (message):
  Not compiling with MPI.  Suppress this warning with -DUSE_MPI=OFF
Call Stack (most recent call first):
  CMakeLists.txt:236 (include)


-- Adding OpenMP CXX_FLAGS: -fopenmp
-- Will link against OpenMP libraries: /usr/lib/libgomp.so;/usr/lib/libpthread.so
CMake Warning (dev) at third_party/gloo/CMakeLists.txt:21 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_BENCHMARK'.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning at cmake/Dependencies.cmake:981 (message):
  Metal is only used in ios builds.
Call Stack (most recent call first):
  CMakeLists.txt:236 (include)


-- 
-- ******** Summary ********
--   CMake version         : 3.14.3
--   CMake command         : /usr/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/g++
--   C++ compiler version  : 8.3.0
--   CXX flags             : -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -fvisibility-inlines-hidden -fopenmp -Wnon-virtual-dtor
--   Build type            : Release
--   Compile definitions   : 
--   CMAKE_PREFIX_PATH     : /usr/lib/python3.7/site-packages
--   CMAKE_INSTALL_PREFIX  : /build/python-pytorch/src/pytorch-1.1.0/torch
--   CMAKE_MODULE_PATH     : /build/python-pytorch/src/pytorch-1.1.0/cmake/Modules;/usr/share/cmake/pybind11
-- 
--   ONNX version          : 1.5.0
--   ONNX NAMESPACE        : onnx_torch
--   ONNX_BUILD_TESTS      : OFF
--   ONNX_BUILD_BENCHMARKS : OFF
--   ONNX_USE_LITE_PROTO   : OFF
--   ONNXIFI_DUMMY_BACKEND : OFF
--   ONNXIFI_ENABLE_EXT    : OFF
-- 
--   Protobuf compiler     : /usr/bin/protoc
--   Protobuf includes     : /usr/include
--   Protobuf libraries    : /usr/lib/libprotobuf.so;-lpthread
--   BUILD_ONNX_PYTHON     : OFF
-- 
-- ******** Summary ********
--   CMake version         : 3.14.3
--   CMake command         : /usr/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/g++
--   C++ compiler version  : 8.3.0
--   CXX flags             : -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -fvisibility-inlines-hidden -fopenmp -Wnon-virtual-dtor
--   Build type            : Release
--   Compile definitions   : 
--   CMAKE_PREFIX_PATH     : /usr/lib/python3.7/site-packages
--   CMAKE_INSTALL_PREFIX  : /build/python-pytorch/src/pytorch-1.1.0/torch
--   CMAKE_MODULE_PATH     : /build/python-pytorch/src/pytorch-1.1.0/cmake/Modules;/usr/share/cmake/pybind11
-- 
--   ONNX version          : 1.4.1
--   ONNX NAMESPACE        : onnx_torch
--   ONNX_BUILD_TESTS      : OFF
--   ONNX_BUILD_BENCHMARKS : OFF
--   ONNX_USE_LITE_PROTO   : OFF
--   ONNXIFI_DUMMY_BACKEND : OFF
-- 
--   Protobuf compiler     : /usr/bin/protoc
--   Protobuf includes     : /usr/include
--   Protobuf libraries    : /usr/lib/libprotobuf.so;-lpthread
--   BUILD_ONNX_PYTHON     : OFF
-- Found gcc >=5 and CUDA <= 7.5, adding workaround C++ flags
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- MAGMA not found. Compiling without MAGMA support
-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Looking for cpuid.h
-- Looking for cpuid.h - found
-- Performing Test HAVE_GCC_GET_CPUID
-- Performing Test HAVE_GCC_GET_CPUID - Success
-- Performing Test NO_GCC_EBX_FPIC_BUG
-- Performing Test NO_GCC_EBX_FPIC_BUG - Success
-- Performing Test C_HAS_AVX_1
-- Performing Test C_HAS_AVX_1 - Failed
-- Performing Test C_HAS_AVX_2
-- Performing Test C_HAS_AVX_2 - Success
-- Performing Test C_HAS_AVX2_1
-- Performing Test C_HAS_AVX2_1 - Failed
-- Performing Test C_HAS_AVX2_2
-- Performing Test C_HAS_AVX2_2 - Success
-- Performing Test CXX_HAS_AVX_1
-- Performing Test CXX_HAS_AVX_1 - Failed
-- Performing Test CXX_HAS_AVX_2
-- Performing Test CXX_HAS_AVX_2 - Success
-- Performing Test CXX_HAS_AVX2_1
-- Performing Test CXX_HAS_AVX2_1 - Failed
-- Performing Test CXX_HAS_AVX2_2
-- Performing Test CXX_HAS_AVX2_2 - Success
-- AVX compiler support found
-- AVX2 compiler support found
-- Performing Test HAS_C11_ATOMICS
-- Performing Test HAS_C11_ATOMICS - Success
-- Atomics: using C11 intrinsics
-- Looking for cheev_
-- Looking for cheev_ - found
-- Found a library with LAPACK API (generic).
disabling CUDA because NOT USE_CUDA is set
-- CuDNN not found. Compiling without CuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   621    0   621    0     0   1584      0 --:--:-- --:--:-- --:--:--  1588
100 66.4M  100 66.4M    0     0  19.6M      0  0:00:03  0:00:03 --:--:-- 28.2M
Downloaded and unpacked Intel(R) MKL small libraries to /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external
-- This is a product build
-- Detecting Intel(R) MKL: trying mklml_intel
-- Intel(R) MKL: include /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/include
-- Intel(R) MKL: lib /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib/libmklml_intel.so
-- Found OpenMP_C: -fopenmp  
-- Found OpenMP_CXX: -fopenmp  
-- Found OpenMP: TRUE   
-- OpenMP lib: /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib/libiomp5.so
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- VTune profiling environment is unset
CMake Warning (dev) at third_party/ideep/mkl-dnn/cmake/utils.cmake:120 (target_link_libraries):
  Policy CMP0023 is not set: Plain and keyword target_link_libraries
  signatures cannot be mixed.  Run "cmake --help-policy CMP0023" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

  The plain signature for target_link_libraries has already been used with
  the target "mkldnn".  All uses of target_link_libraries with a target
  should be either all-keyword or all-plain.

  The uses of the plain signature are here:

   * third_party/ideep/mkl-dnn/cmake/utils.cmake:111 (target_link_libraries)

Call Stack (most recent call first):
  third_party/ideep/mkl-dnn/src/CMakeLists.txt:108 (target_link_libraries_install)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found MKL-DNN: TRUE
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for mmap
-- Looking for mmap - found
-- Looking for shm_open
-- Looking for shm_open - found
-- Looking for shm_unlink
-- Looking for shm_unlink - found
-- Looking for malloc_usable_size
-- Looking for malloc_usable_size - found
-- Performing Test C_HAS_THREAD
-- Performing Test C_HAS_THREAD - Success
-- GCC 8.3.0: Adding gcc and gcc_s libs to link line
-- don't use NUMA
disabling CUDA because USE_CUDA is set false
-- Check size of long double
-- Check size of long double - done
-- Performing Test COMPILER_SUPPORTS_LONG_DOUBLE
-- Performing Test COMPILER_SUPPORTS_LONG_DOUBLE - Success
-- Performing Test COMPILER_SUPPORTS_FLOAT128
-- Performing Test COMPILER_SUPPORTS_FLOAT128 - Success
-- Performing Test COMPILER_SUPPORTS_SSE2
-- Performing Test COMPILER_SUPPORTS_SSE2 - Success
-- Performing Test COMPILER_SUPPORTS_SSE4
-- Performing Test COMPILER_SUPPORTS_SSE4 - Success
-- Performing Test COMPILER_SUPPORTS_AVX
-- Performing Test COMPILER_SUPPORTS_AVX - Success
-- Performing Test COMPILER_SUPPORTS_FMA4
-- Performing Test COMPILER_SUPPORTS_FMA4 - Success
-- Performing Test COMPILER_SUPPORTS_AVX2
-- Performing Test COMPILER_SUPPORTS_AVX2 - Success
-- Performing Test COMPILER_SUPPORTS_SVE
-- Performing Test COMPILER_SUPPORTS_SVE - Failed
-- Performing Test COMPILER_SUPPORTS_AVX512F
-- Performing Test COMPILER_SUPPORTS_AVX512F - Success
-- Performing Test COMPILER_SUPPORTS_OPENMP
-- Performing Test COMPILER_SUPPORTS_OPENMP - Success
-- Performing Test COMPILER_SUPPORTS_WEAK_ALIASES
-- Performing Test COMPILER_SUPPORTS_WEAK_ALIASES - Success
-- Performing Test COMPILER_SUPPORTS_BUILTIN_MATH
-- Performing Test COMPILER_SUPPORTS_BUILTIN_MATH - Success
-- Configuring build for SLEEF-v3.2
   Target system: Linux-5.0.10-arch1-1-ARCH
   Target processor: x86_64
   Host system: Linux-5.0.10-arch1-1-ARCH
   Host processor: x86_64
   Detected C compiler: GNU @ /usr/bin/gcc
-- Using option `-Wall -Wno-unused -Wno-attributes -Wno-unused-result -Wno-psabi -ffp-contract=off -fno-math-errno -fno-trapping-math` to compile libsleef
-- Building shared libs : OFF
-- MPFR : /usr/lib/libmpfr.so
-- MPFR header file in /usr/include
-- GMP : /usr/lib/libgmp.so
-- RUNNING_ON_TRAVIS : 0
-- COMPILER_SUPPORTS_OPENMP : 1
-- pytorch is compiling with OpenMP. 
OpenMP CXX_FLAGS: -fopenmp. 
OpenMP libraries: /usr/lib/libgomp.so;/usr/lib/libpthread.so.
-- /usr/bin/g++ /build/python-pytorch/src/pytorch-1.1.0/torch/abi-check.cpp -o /build/python-pytorch/src/pytorch-1.1.0/build/abi-check
-- Determined _GLIBCXX_USE_CXX11_ABI=1
-- Performing Test HAS_THREAD_LOCAL
-- Performing Test HAS_THREAD_LOCAL - Success
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) 
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) 
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) 
-- ignoring CUDA
-- Building C10D without CUDA support
-- Could NOT find MPI_C (missing: MPI_C_LIB_NAMES MPI_C_HEADER_DIR MPI_C_WORKS) 
-- Could NOT find MPI_CXX (missing: MPI_CXX_LIB_NAMES MPI_CXX_HEADER_DIR MPI_CXX_WORKS) 
-- Could NOT find MPI (missing: MPI_C_FOUND MPI_CXX_FOUND) 
-- Not able to find MPI, will compile c10d without MPI support
-- NCCL operators skipped due to no CUDA support
-- Including IDEEP operators
-- Including image processing operators
-- Excluding video processing operators due to no opencv
-- MPI operators skipped due to no MPI support
-- Include Observer library
-- Caffe2 is compiling with OpenMP. 
OpenMP CXX_FLAGS: -fopenmp. 
OpenMP libraries: /usr/lib/libgomp.so;/usr/lib/libpthread.so.
-- Using lib/python3.7/site-packages as python relative installation path
CMake Warning at CMakeLists.txt:435 (message):
  Generated cmake files are only fully tested if one builds with system glog,
  gflags, and protobuf.  Other settings may generate files that are not well
  tested.


CMake Warning at CMakeLists.txt:486 (message):
  Generated cmake files are only available when building shared libs.


-- 
-- ******** Summary ********
-- General:
--   CMake version         : 3.14.3
--   CMake command         : /usr/bin/cmake
--   System                : Linux
--   C++ compiler          : /usr/bin/g++
--   C++ compiler id       : GNU
--   C++ compiler version  : 8.3.0
--   BLAS                  : MKL
--   CXX flags             : -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -D_FORTIFY_SOURCE=2 -fvisibility-inlines-hidden -fopenmp -D_FORCE_INLINES -D_MWAITXINTRIN_H_INCLUDED -D__STRICT_ANSI__ -DUSE_FBGEMM -O2 -fPIC -Wno-narrowing -Wall -Wextra -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Wno-stringop-overflow
--   Build type            : Release
--   Compile definitions   : ONNX_NAMESPACE=onnx_torch;USE_C11_ATOMICS=1;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;HAVE_MALLOC_USABLE_SIZE=1
--   CMAKE_PREFIX_PATH     : /usr/lib/python3.7/site-packages
--   CMAKE_INSTALL_PREFIX  : /build/python-pytorch/src/pytorch-1.1.0/torch
-- 
--   TORCH_VERSION         : 1.1.0
--   CAFFE2_VERSION        : 1.1.0
--   BUILD_ATEN_MOBILE     : OFF
--   BUILD_ATEN_ONLY       : OFF
--   BUILD_BINARY          : True
--   BUILD_CUSTOM_PROTOBUF : OFF
--     Protobuf compiler   : /usr/bin/protoc
--     Protobuf includes   : /usr/include
--     Protobuf libraries  : /usr/lib/libprotobuf.so;-lpthread
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : True
--     Python version      : 3.7.3
--     Python executable   : /usr/bin/python
--     Pythonlibs version  : 3.7.3
--     Python library      : /usr/lib/libpython3.7m.so.1.0
--     Python includes     : /usr/include/python3.7m
--     Python site-packages: lib/python3.7/site-packages
--   BUILD_CAFFE2_OPS      : True
--   BUILD_SHARED_LIBS     : 0
--   BUILD_TEST            : True
--   USE_ASAN              : OFF
--   USE_CUDA              : False
--   USE_ROCM              : False
--   USE_EIGEN_FOR_BLAS    : ON
--   USE_FBGEMM            : ON
--   USE_FFMPEG            : False
--   USE_GFLAGS            : OFF
--   USE_GLOG              : OFF
--   USE_LEVELDB           : False
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : False
--   USE_METAL             : OFF
--   USE_MKL               : OFF
--   USE_MKLDNN            : ON
--   USE_NCCL              : False
--   USE_NNPACK            : True
--   USE_NUMPY             : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCL            : OFF
--   USE_OPENCV            : True
--     OpenCV version      : 4.1.0
--   USE_OPENMP            : ON
--   USE_PROF              : OFF
--   USE_QNNPACK           : True
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_ZMQ               : OFF
--   USE_DISTRIBUTED       : True
--     USE_MPI             : OFF
--     USE_GLOO            : ON
--     USE_GLOO_IBVERBS    : OFF
--   Public Dependencies  : Threads::Threads;caffe2::mkldnn
--   Private Dependencies : qnnpack;nnpack;cpuinfo;fbgemm;opencv_core;opencv_highgui;opencv_imgproc;opencv_imgcodecs;opencv_optflow;opencv_videoio;opencv_video;fp16;gloo;aten_op_header_gen;foxi_loader;rt;gcc_s;gcc;dl
-- Configuring done
CMake Warning at torch/lib/c10d/test/CMakeLists.txt:9 (add_executable):
  Cannot generate a safe linker search path for target TCPStoreTest because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libiomp5.so] in /usr/lib may be hidden by files in:
      /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  torch/lib/c10d/test/CMakeLists.txt:17 (c10d_add_test)


CMake Warning at torch/lib/c10d/test/CMakeLists.txt:9 (add_executable):
  Cannot generate a safe linker search path for target ProcessGroupGlooTest
  because files in some directories may conflict with libraries in implicit
  directories:

    link library [libiomp5.so] in /usr/lib may be hidden by files in:
      /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  torch/lib/c10d/test/CMakeLists.txt:26 (c10d_add_test)


CMake Warning at torch/lib/c10d/test/CMakeLists.txt:9 (add_executable):
  Cannot generate a safe linker search path for target FileStoreTest because
  files in some directories may conflict with libraries in implicit
  directories:

    link library [libiomp5.so] in /usr/lib may be hidden by files in:
      /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib

  Some of these libraries may not be found correctly.
Call Stack (most recent call first):
  torch/lib/c10d/test/CMakeLists.txt:16 (c10d_add_test)


CMake Warning at torch/lib/libshm/CMakeLists.txt:32 (ADD_EXECUTABLE):
  Cannot generate a safe linker search path for target torch_shm_manager
  because files in some directories may conflict with libraries in implicit
  directories:

    link library [libiomp5.so] in /usr/lib may be hidden by files in:
      /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib

  Some of these libraries may not be found correctly.


CMake Warning at torch/lib/libshm/CMakeLists.txt:25 (ADD_LIBRARY):
  Cannot generate a safe linker search path for target shm because files in
  some directories may conflict with libraries in implicit directories:

    link library [libiomp5.so] in /usr/lib may be hidden by files in:
      /build/python-pytorch/src/pytorch-1.1.0/third_party/ideep/mkl-dnn/external/mklml_lnx_2019.0.3.20190220/lib

  Some of these libraries may not be found correctly.


-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    THD_SO_VERSION
```