Repository: pytorch
Issue: Bug in building pytorch deploy from source in macos USE_DEPLOY=1 
Labels: oncall: package/deploy,imported

### 🐛 Describe the bug

I'm trying to use the `torch::deploy` feature, and follow the document in [this website](https://pytorch.org/docs/stable/deploy.html) to build pytorch from source. First, I suceeded in building it with `USE_DEPLOY=0`. Then I started fresh (I cleaned with the instruction on [this website](https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md#tips-and-debugging), with ` USE_DEPLOY=1`. But it failes. This is done in Macos system. The same issue happens in a linux system too (See this [issue](https://github.com/pytorch/pytorch/issues/82382)).

Could you help me check this or show me a working example of installing torch::deploy from source?

* The command:
```bash
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
export USE_DEPLOY=1

DEBUG=1 USE_DISTRIBUTED=0 USE_MKLDNN=0 USE_CUDA=0 BUILD_TEST=0 USE_FBGEMM=0 USE_NNPACK=0 USE_QNNPACK=0 USE_XNNPACK=0 MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py develop
```
* The error message:
```
Building wheel torch-1.13.0a0+git8a6c104
-- Building version 1.13.0a0+git8a6c104
cmake -GNinja -DBUILD_PYTHON=True -DBUILD_TEST=False -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=/Users/fenkexin/Desktop/forked/pytorch/torch -DCMAKE_PREFIX_PATH=/Users/fenkexin/opt/anaconda3/lib/python3.9/site-packages;/Users/fenkexin/opt/anaconda3 -DJAVA_HOME=/Users/fenkexin/Library/Java/JavaVirtualMachines/corretto-11.0.14.1/Contents/Home -DNUMPY_INCLUDE_DIR=/Users/fenkexin/opt/anaconda3/lib/python3.9/site-packages/numpy/core/include -DPYTHON_EXECUTABLE=/Users/fenkexin/opt/anaconda3/bin/python -DPYTHON_INCLUDE_DIR=/Users/fenkexin/opt/anaconda3/include/python3.9 -DPYTHON_LIBRARY=/Users/fenkexin/opt/anaconda3/lib/libpython3.9.a -DTORCH_BUILD_VERSION=1.13.0a0+git8a6c104 -DUSE_CUDA=0 -DUSE_DEPLOY=1 -DUSE_DISTRIBUTED=0 -DUSE_FBGEMM=0 -DUSE_MKLDNN=0 -DUSE_NNPACK=0 -DUSE_NUMPY=True -DUSE_QNNPACK=0 -DUSE_XNNPACK=0 /Users/fenkexin/Desktop/forked/pytorch
-- The CXX compiler identification is AppleClang 13.1.6.13160021
-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Not forcing any particular BLAS to be found
-- CLANG_VERSION_STRING:         Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

-- sdk version: 12.3, mps supported: ON
-- MPSGraph framework 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_NEED_TO_TURN_OFF_DEPRECATION_WARNING
-- Performing Test CAFFE2_NEED_TO_TURN_OFF_DEPRECATION_WARNING - Failed
-- Turning off deprecation warning due to glog.
-- 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 C_HAS_AVX512_1
-- Performing Test C_HAS_AVX512_1 - Failed
-- Performing Test C_HAS_AVX512_2
-- Performing Test C_HAS_AVX512_2 - Failed
-- Performing Test C_HAS_AVX512_3
-- Performing Test C_HAS_AVX512_3 - Failed
-- 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
-- Performing Test CXX_HAS_AVX512_1
-- Performing Test CXX_HAS_AVX512_1 - Failed
-- Performing Test CXX_HAS_AVX512_2
-- Performing Test CXX_HAS_AVX512_2 - Failed
-- Performing Test CXX_HAS_AVX512_3
-- Performing Test CXX_HAS_AVX512_3 - Failed
-- 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
-- Building using own protobuf under third_party per request.
-- Use custom protobuf build.
-- 
-- 3.13.0.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Caffe2 protobuf include directory: $<BUILD_INTERFACE:/Users/fenkexin/Desktop/forked/pytorch/third_party/protobuf/src>$<INSTALL_INTERFACE:include>
-- Trying to find preferred BLAS backend of choice: MKL
-- MKL_THREADING = OMP
-- 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
-- Looking for cblas_sgemm
-- Looking for cblas_sgemm - found
-- MKL libraries: /Users/fenkexin/opt/anaconda3/lib/libmkl_intel_lp64.dylib;/Users/fenkexin/opt/anaconda3/lib/libmkl_intel_thread.dylib;/Users/fenkexin/opt/anaconda3/lib/libmkl_core.dylib;/Users/fenkexin/opt/anaconda3/lib/libiomp5.dylib;/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/lib/libpthread.tbd;/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/lib/libm.tbd
-- MKL include directory: /Users/fenkexin/opt/anaconda3/include
-- MKL OpenMP type: Intel
-- MKL OpenMP library: /Users/fenkexin/opt/anaconda3/lib/libiomp5.dylib
-- The ASM compiler identification is Clang
-- Found assembler: /Library/Developer/CommandLineTools/usr/bin/clang
CMake Warning at cmake/Dependencies.cmake:844 (message):
  Turning USE_FAKELOWP off as it depends on USE_FBGEMM.
Call Stack (most recent call first):
  CMakeLists.txt:708 (include)


-- Using third party subdirectory Eigen.
-- Found PythonInterp: /Users/fenkexin/opt/anaconda3/bin/python (found suitable version "3.9.12", minimum required is "3.0") 
-- Found PythonLibs: /Users/fenkexin/opt/anaconda3/lib/libpython3.9.a (found suitable version "3.9.12", minimum required is "3.0") 
-- Using third_party/pybind11.
-- pybind11 include dirs: /Users/fenkexin/Desktop/forked/pytorch/cmake/../third_party/pybind11/include
CMake Warning (dev) at /Users/fenkexin/opt/anaconda3/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_C)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindOpenMP.cmake:576 (find_package_handle_standard_args)
  cmake/Dependencies.cmake:1222 (find_package)
  CMakeLists.txt:708 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /Users/fenkexin/opt/anaconda3/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_CXX)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindOpenMP.cmake:576 (find_package_handle_standard_args)
  cmake/Dependencies.cmake:1222 (find_package)
  CMakeLists.txt:708 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Adding OpenMP CXX_FLAGS: -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include
-- Will link against OpenMP libraries: /Users/fenkexin/opt/anaconda3/lib/libiomp5.dylib
CMake Warning at cmake/Dependencies.cmake:1513 (message):
  Metal is only used in ios builds.
Call Stack (most recent call first):
  CMakeLists.txt:708 (include)


-- Found PythonInterp: /Users/fenkexin/opt/anaconda3/bin/python (found version "3.9.12") 
-- Found PythonLibs: /Users/fenkexin/opt/anaconda3/lib/libpython3.9.a (found version "3.9.12") 
Generated: /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_onnx_torch-ml.proto
Generated: /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-operators_onnx_torch-ml.proto
Generated: /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-data_onnx_torch.proto
-- 
-- ******** Summary ********
--   CMake version             : 3.19.6
--   CMake command             : /Users/fenkexin/opt/anaconda3/bin/cmake
--   System                    : Darwin
--   C++ compiler              : /Library/Developer/CommandLineTools/usr/bin/clang++
--   C++ compiler version      : 13.1.6.13160021
--   CXX flags                 :  -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include -Wnon-virtual-dtor
--   Build type                : Debug
--   Compile definitions       : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;__STDC_FORMAT_MACROS
--   CMAKE_PREFIX_PATH         : /Users/fenkexin/opt/anaconda3/lib/python3.9/site-packages;/Users/fenkexin/opt/anaconda3
--   CMAKE_INSTALL_PREFIX      : /Users/fenkexin/Desktop/forked/pytorch/torch
--   CMAKE_MODULE_PATH         : /Users/fenkexin/Desktop/forked/pytorch/cmake/Modules
-- 
--   ONNX version              : 1.12.0
--   ONNX NAMESPACE            : onnx_torch
--   ONNX_USE_LITE_PROTO       : OFF
--   USE_PROTOBUF_SHARED_LIBS  : OFF
--   Protobuf_USE_STATIC_LIBS  : ON
--   ONNX_DISABLE_EXCEPTIONS   : OFF
--   ONNX_WERROR               : OFF
--   ONNX_BUILD_TESTS          : OFF
--   ONNX_BUILD_BENCHMARKS     : OFF
--   ONNXIFI_DUMMY_BACKEND     : OFF
--   ONNXIFI_ENABLE_EXT        : OFF
-- 
--   Protobuf compiler         : 
--   Protobuf includes         : 
--   Protobuf libraries        : 
--   BUILD_ONNX_PYTHON         : OFF
-- 
-- ******** Summary ********
--   CMake version         : 3.19.6
--   CMake command         : /Users/fenkexin/opt/anaconda3/bin/cmake
--   System                : Darwin
--   C++ compiler          : /Library/Developer/CommandLineTools/usr/bin/clang++
--   C++ compiler version  : 13.1.6.13160021
--   CXX flags             :  -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include -Wnon-virtual-dtor
--   Build type            : Debug
--   Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1
--   CMAKE_PREFIX_PATH     : /Users/fenkexin/opt/anaconda3/lib/python3.9/site-packages;/Users/fenkexin/opt/anaconda3
--   CMAKE_INSTALL_PREFIX  : /Users/fenkexin/Desktop/forked/pytorch/torch
--   CMAKE_MODULE_PATH     : /Users/fenkexin/Desktop/forked/pytorch/cmake/Modules
-- 
--   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     : 
--   Protobuf includes     : 
--   Protobuf libraries    : 
--   BUILD_ONNX_PYTHON     : OFF
-- Could not find CUDA with FP16 support, compiling without torch.CudaHalfTensor
-- Removing -DNDEBUG from compile flags
-- Checking prototype magma_get_sgeqrf_nb for MAGMA_V2
-- Checking prototype magma_get_sgeqrf_nb for MAGMA_V2 - False
CMake Warning at cmake/Dependencies.cmake:1713 (message):
  Not compiling with MAGMA.  Suppress this warning with -DUSE_MAGMA=OFF.
Call Stack (most recent call first):
  CMakeLists.txt:708 (include)


-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Found a library with LAPACK API (mkl).
disabling CUDA because NOT USE_CUDA is set
-- USE_CUDNN is set to 0. Compiling without cuDNN support
disabling ROCM because NOT USE_ROCM is set
-- MIOpen not found. Compiling without MIOpen support
disabling MKLDNN because USE_MKLDNN is not set
-- 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 - not found
-- Performing Test C_HAS_THREAD
-- Performing Test C_HAS_THREAD - Success
-- Version: 7.0.3
-- Build type: Debug
-- CXX_STANDARD: 14
-- Performing Test has_std_14_flag
-- Performing Test has_std_14_flag - Success
-- Performing Test has_std_1y_flag
-- Performing Test has_std_1y_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Performing Test HAS_NULLPTR_WARNING
-- Performing Test HAS_NULLPTR_WARNING - Success
-- Looking for strtod_l
-- Looking for strtod_l - found
-- Using CPU-only version of Kineto
-- Configuring Kineto dependency:
--   KINETO_SOURCE_DIR = /Users/fenkexin/Desktop/forked/pytorch/third_party/kineto/libkineto
--   KINETO_BUILD_TESTS = OFF
--   KINETO_LIBRARY_TYPE = static
INFO CUDA_SOURCE_DIR = 
INFO ROCM_SOURCE_DIR = 
INFO CUPTI unavailable or disabled - not building GPU profilers
-- Kineto: FMT_SOURCE_DIR = /Users/fenkexin/Desktop/forked/pytorch/third_party/fmt
-- Kineto: FMT_INCLUDE_DIR = /Users/fenkexin/Desktop/forked/pytorch/third_party/fmt/include
INFO CUPTI_INCLUDE_DIR = /extras/CUPTI/include
INFO ROCTRACER_INCLUDE_DIR = /include/roctracer
-- Configured Kineto (CPU)
-- Performing Test HAS_WERROR_FORMAT
-- Performing Test HAS_WERROR_FORMAT - Success
-- Performing Test HAS_WERROR_CAST_FUNCTION_TYPE
-- Performing Test HAS_WERROR_CAST_FUNCTION_TYPE - Success
-- Performing Test HAS_WERROR_SIGN_COMPARE
-- Performing Test HAS_WERROR_SIGN_COMPARE - Success
-- Looking for backtrace
-- Looking for backtrace - found
-- backtrace facility detected in default set of libraries
-- Found Backtrace: /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/usr/include  
-- don't use NUMA
-- headers outputs: 
-- sources outputs: 
-- declarations_yaml outputs: 
-- Performing Test COMPILER_SUPPORTS_NO_AVX256_SPLIT
-- Performing Test COMPILER_SUPPORTS_NO_AVX256_SPLIT - Failed
-- Using ATen parallel backend: OMP
disabling CUDA because USE_CUDA is set false
CMake Deprecation Warning at third_party/sleef/CMakeLists.txt:91 (cmake_policy):
  The OLD behavior for policy CMP0066 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Found OpenSSL: /Users/fenkexin/opt/anaconda3/lib/libcrypto.dylib (found version "1.1.1q")  
-- 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 - Failed
-- 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_AVX512F
-- Performing Test COMPILER_SUPPORTS_AVX512F - Success
-- Found OpenMP_C: -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include (found version "5.0") 
-- Found OpenMP_CXX: -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include (found version "5.0") 
-- Found OpenMP: TRUE (found version "5.0")  
-- Performing Test COMPILER_SUPPORTS_OPENMP
-- Performing Test COMPILER_SUPPORTS_OPENMP - Failed
-- Performing Test COMPILER_SUPPORTS_WEAK_ALIASES
-- Performing Test COMPILER_SUPPORTS_WEAK_ALIASES - Failed
-- Performing Test COMPILER_SUPPORTS_BUILTIN_MATH
-- Performing Test COMPILER_SUPPORTS_BUILTIN_MATH - Success
-- Performing Test COMPILER_SUPPORTS_SYS_GETRANDOM
-- Performing Test COMPILER_SUPPORTS_SYS_GETRANDOM - Failed
-- Configuring build for SLEEF-v3.6.0
   Target system: Darwin-21.6.0
   Target processor: x86_64
   Host system: Darwin-21.6.0
   Host processor: x86_64
   Detected C compiler: AppleClang @ /Library/Developer/CommandLineTools/usr/bin/clang
   CMake: 3.19.6
   Make program: /Users/fenkexin/opt/anaconda3/bin/ninja
-- Using option `-Wall -Wno-unused -Wno-attributes -Wno-unused-result -ffp-contract=off -fno-math-errno -fno-trapping-math` to compile libsleef
-- Building shared libs : OFF
-- Building static test bins: OFF
-- MPFR : /usr/local/lib/libmpfr.dylib
-- MPFR header file in /usr/local/include
-- GMP : /usr/local/lib/libgmp.dylib
-- RT : 
-- FFTW3 : LIBFFTW3-NOTFOUND
-- OPENSSL : 1.1.1q
-- SDE : SDE_COMMAND-NOTFOUND
-- RUNNING_ON_TRAVIS : 
-- COMPILER_SUPPORTS_OPENMP : 
AT_INSTALL_INCLUDE_DIR include/ATen/core
core header install: /Users/fenkexin/Desktop/forked/pytorch/build/aten/src/ATen/core/TensorBody.h
core header install: /Users/fenkexin/Desktop/forked/pytorch/build/aten/src/ATen/core/aten_interned_strings.h
core header install: /Users/fenkexin/Desktop/forked/pytorch/build/aten/src/ATen/core/enum_tag.h
CMake Warning (dev) at torch/CMakeLists.txt:467:
  Syntax Warning in cmake code at column 107

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at torch/CMakeLists.txt:467:
  Syntax Warning in cmake code at column 115

  Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /Users/fenkexin/opt/anaconda3/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_C)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindOpenMP.cmake:576 (find_package_handle_standard_args)
  caffe2/CMakeLists.txt:1288 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /Users/fenkexin/opt/anaconda3/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:426 (message):
  The package name passed to `find_package_handle_standard_args` (OpenMP_CXX)
  does not match the name of the calling package (OpenMP).  This can lead to
  problems in calling code that expects `find_package` result variables
  (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  cmake/Modules/FindOpenMP.cmake:576 (find_package_handle_standard_args)
  caffe2/CMakeLists.txt:1288 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- pytorch is compiling with OpenMP. 
OpenMP CXX_FLAGS: -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include. 
OpenMP libraries: /Users/fenkexin/opt/anaconda3/lib/libiomp5.dylib.
-- Caffe2 is compiling with OpenMP. 
OpenMP CXX_FLAGS: -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include. 
OpenMP libraries: /Users/fenkexin/opt/anaconda3/lib/libiomp5.dylib.
-- Using lib/python3.9/site-packages as python relative installation path
CMake Warning at CMakeLists.txt:1073 (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.


-- 
-- ******** Summary ********
-- General:
--   CMake version         : 3.19.6
--   CMake command         : /Users/fenkexin/opt/anaconda3/bin/cmake
--   System                : Darwin
--   C++ compiler          : /Library/Developer/CommandLineTools/usr/bin/clang++
--   C++ compiler id       : AppleClang
--   C++ compiler version  : 13.1.6.13160021
--   Using ccache if found : ON
--   Found ccache          : /Users/fenkexin/opt/anaconda3/bin/ccache
--   CXX flags             :  -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_PYTORCH_QNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-range-loop-analysis -Wno-pass-failed -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wconstant-conversion -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unknown-warning-option -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-c++14-extensions -Wno-constexpr-not-const -Wno-missing-braces -Qunused-arguments -fcolor-diagnostics -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unused-private-field -Wno-missing-braces -Wno-c++14-extensions -Wno-constexpr-not-const
--   Build type            : Debug
--   Compile definitions   : ONNX_ML=1;ONNXIFI_ENABLE_EXT=1;ONNX_NAMESPACE=onnx_torch;HAVE_MMAP=1;_FILE_OFFSET_BITS=64;HAVE_SHM_OPEN=1;HAVE_SHM_UNLINK=1;USE_EXTERNAL_MZCRC;MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
--   CMAKE_PREFIX_PATH     : /Users/fenkexin/opt/anaconda3/lib/python3.9/site-packages;/Users/fenkexin/opt/anaconda3
--   CMAKE_INSTALL_PREFIX  : /Users/fenkexin/Desktop/forked/pytorch/torch
--   USE_GOLD_LINKER       : OFF
-- 
--   TORCH_VERSION         : 1.13.0
--   CAFFE2_VERSION        : 1.13.0
--   BUILD_CAFFE2          : OFF
--   BUILD_CAFFE2_OPS      : OFF
--   BUILD_CAFFE2_MOBILE   : OFF
--   BUILD_STATIC_RUNTIME_BENCHMARK: OFF
--   BUILD_TENSOREXPR_BENCHMARK: OFF
--   BUILD_NVFUSER_BENCHMARK: OFF
--   BUILD_BINARY          : OFF
--   BUILD_CUSTOM_PROTOBUF : ON
--     Link local protobuf : ON
--   BUILD_DOCS            : OFF
--   BUILD_PYTHON          : True
--     Python version      : 3.9.12
--     Python executable   : /Users/fenkexin/opt/anaconda3/bin/python
--     Pythonlibs version  : 3.9.12
--     Python library      : /Users/fenkexin/opt/anaconda3/lib/libpython3.9.a
--     Python includes     : /Users/fenkexin/opt/anaconda3/include/python3.9
--     Python site-packages: lib/python3.9/site-packages
--   BUILD_SHARED_LIBS     : ON
--   CAFFE2_USE_MSVC_STATIC_RUNTIME     : OFF
--   BUILD_TEST            : False
--   BUILD_JNI             : OFF
--   BUILD_MOBILE_AUTOGRAD : OFF
--   BUILD_LITE_INTERPRETER: OFF
--   CROSS_COMPILING_MACOSX : 
--   INTERN_BUILD_MOBILE   : 
--   USE_BLAS              : 1
--     BLAS                : mkl
--     BLAS_HAS_SBGEMM     : 
--   USE_LAPACK            : 1
--     LAPACK              : mkl
--   USE_ASAN              : OFF
--   USE_CPP_CODE_COVERAGE : OFF
--   USE_CUDA              : 0
--   USE_ROCM              : OFF
--   USE_EIGEN_FOR_BLAS    : 
--   USE_FBGEMM            : OFF
--     USE_FAKELOWP          : OFF
--   USE_KINETO            : ON
--   USE_FFMPEG            : OFF
--   USE_GFLAGS            : OFF
--   USE_GLOG              : OFF
--   USE_LEVELDB           : OFF
--   USE_LITE_PROTO        : OFF
--   USE_LMDB              : OFF
--   USE_METAL             : OFF
--   USE_PYTORCH_METAL     : OFF
--   USE_PYTORCH_METAL_EXPORT     : OFF
--   USE_MPS               : ON
--   USE_FFTW              : OFF
--   USE_MKL               : ON
--   USE_MKLDNN            : 0
--   USE_UCC               : OFF
--   USE_ITT               : ON
--   USE_NCCL              : OFF
--   USE_NNPACK            : 0
--   USE_NUMPY             : ON
--   USE_OBSERVERS         : ON
--   USE_OPENCL            : OFF
--   USE_OPENCV            : OFF
--   USE_OPENMP            : ON
--   USE_TBB               : OFF
--   USE_VULKAN            : OFF
--   USE_PROF              : OFF
--   USE_QNNPACK           : 0
--   USE_PYTORCH_QNNPACK   : ON
--   USE_XNNPACK           : 0
--   USE_REDIS             : OFF
--   USE_ROCKSDB           : OFF
--   USE_ZMQ               : OFF
--   USE_DISTRIBUTED       : 0
--   USE_DEPLOY           : 1
--   Public Dependencies  : caffe2::Threads;caffe2::mkl
--   Private Dependencies : pthreadpool;cpuinfo;pytorch_qnnpack;ittnotify;fp16;foxi_loader;fmt::fmt-header-only;kineto
--   USE_COREML_DELEGATE     : OFF
--   BUILD_LAZY_TS_BACKEND   : ON
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    JAVA_HOME


-- Build files have been written to: /Users/fenkexin/Desktop/forked/pytorch/build
cmake --build . --target install --config Debug
[3/4] Generating ATen headers
[229/1806] Linking CXX static library lib/libprotobuf-lited.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobuf-lited.a(io_win32.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobuf-lited.a(io_win32.cc.o) has no symbols
[289/1806] Linking CXX static library lib/libprotobufd.a
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(io_win32.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(gzip_stream.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(error_listener.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(io_win32.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(gzip_stream.cc.o) has no symbols
/Library/Developer/CommandLineTools/usr/bin/ranlib: file: lib/libprotobufd.a(error_listener.cc.o) has no symbols
[327/1806] Running gen_proto.py on onnx/onnx.in.proto
Processing /Users/fenkexin/Desktop/forked/pytorch/third_party/onnx/onnx/onnx.in.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_onnx_torch-ml.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_onnx_torch-ml.proto3
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-ml.pb.h
generating /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_pb.py
[341/1806] Running gen_proto.py on onnx/onnx-operators.in.proto
Processing /Users/fenkexin/Desktop/forked/pytorch/third_party/onnx/onnx/onnx-operators.in.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-operators_onnx_torch-ml.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-operators_onnx_torch-ml.proto3
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-operators-ml.pb.h
generating /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_operators_pb.py
[342/1806] Running gen_proto.py on onnx/onnx-data.in.proto
Processing /Users/fenkexin/Desktop/forked/pytorch/third_party/onnx/onnx/onnx-data.in.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-data_onnx_torch.proto
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-data_onnx_torch.proto3
Writing /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx-data.pb.h
generating /Users/fenkexin/Desktop/forked/pytorch/build/third_party/onnx/onnx/onnx_data_pb.py
[424/1806] Linking C shared library lib/libtorch_global_deps.dylib
ld: warning: dylib (/Users/fenkexin/opt/anaconda3/lib/libmkl_intel_lp64.dylib) was built for newer macOS version (10.12) than being linked (10.9)
ld: warning: dylib (/Users/fenkexin/opt/anaconda3/lib/libmkl_intel_thread.dylib) was built for newer macOS version (10.12) than being linked (10.9)
ld: warning: dylib (/Users/fenkexin/opt/anaconda3/lib/libmkl_core.dylib) was built for newer macOS version (10.12) than being linked (10.9)
[443/1806] Generating include/renameavx2128.h
Generating renameavx2128.h: mkrename finz_ 2 4 avx2128
[444/1806] Generating include/renameavx512fnofma.h
Generating renameavx512fnofma.h: mkrename cinz_ 8 16 avx512fnofma
[445/1806] Generating include/renamesse2.h
Generating renamesse2.h: mkrename cinz_ 2 4 sse2
[447/1806] Generating include/renamepurecfma_scalar.h
Generating renamepurecfma_scalar.h: mkrename finz_ 1 1 purecfma
[448/1806] Generating include/renamepurec_scalar.h
Generating renamepurec_scalar.h: mkrename cinz_ 1 1 purec
[449/1806] Generating include/renamesse4.h
Generating renamesse4.h: mkrename cinz_ 2 4 sse4
[450/1806] Generating include/renameavx.h
Generating renameavx.h: mkrename cinz_ 4 8 avx
[451/1806] Generating include/renamefma4.h
Generating renamefma4.h: mkrename finz_ 4 8 fma4
[452/1806] Generating include/renameavx2.h
Generating renameavx2.h: mkrename finz_ 4 8 avx2
[453/1806] Generating include/renameavx512f.h
Generating renameavx512f.h: mkrename finz_ 8 16 avx512f
[454/1806] Generating include/renamecuda.h
Generating renamecuda.h: mkrename finz_ 1 1 cuda
[460/1806] Generating ../../../include/sleef.h
Generating sleef.h: mkrename cinz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__
Generating sleef.h: mkrename cinz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ sse2
Generating sleef.h: mkrename cinz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ sse4
Generating sleef.h: mkrename cinz_ 4 8 __m256d __m256 __m128i struct\ {\ __m128i\ x,\ y;\ } __AVX__
Generating sleef.h: mkrename cinz_ 4 8 __m256d __m256 __m128i struct\ {\ __m128i\ x,\ y;\ } __AVX__ avx
Generating sleef.h: mkrename finz_ 4 8 __m256d __m256 __m128i struct\ {\ __m128i\ x,\ y;\ } __AVX__ fma4
Generating sleef.h: mkrename finz_ 4 8 __m256d __m256 __m128i __m256i __AVX__ avx2
Generating sleef.h: mkrename finz_ 2 4 __m128d __m128 __m128i __m128i __SSE2__ avx2128
Generating sleef.h: mkrename finz_ 8 16 __m512d __m512 __m256i __m512i __AVX512F__
Generating sleef.h: mkrename finz_ 8 16 __m512d __m512 __m256i __m512i __AVX512F__ avx512f
Generating sleef.h: mkrename cinz_ 8 16 __m512d __m512 __m256i __m512i __AVX512F__ avx512fnofma
Generating sleef.h: mkrename cinz_ 1 1 double float int32_t int32_t __STDC__ purec
Generating sleef.h: mkrename finz_ 1 1 double float int32_t int32_t FP_FAST_FMA purecfma
[510/1806] Generating ../../../torch/utils/data/datapipes/datapipe.pyi
Generating Python interface file 'datapipe.pyi'...
[522/1806] Building CXX object torch/c...e_dt_needed.dir/remove_dt_needed.cpp.o
FAILED: torch/csrc/deploy/CMakeFiles/remove_dt_needed.dir/remove_dt_needed.cpp.o 
ccache /Library/Developer/CommandLineTools/usr/bin/clang++ -DFMT_HEADER_ONLY=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -Iaten/src -I../aten/src -I. -I../ -I../third_party/onnx -Ithird_party/onnx -I../third_party/foxi -Ithird_party/foxi -I../third_party/fmt/include -isystem ../third_party/protobuf/src -isystem /Users/fenkexin/opt/anaconda3/include -isystem ../third_party/ittapi/include -isystem ../cmake/../third_party/eigen -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -Xpreprocessor -fopenmp -I/Users/fenkexin/opt/anaconda3/include -DUSE_KINETO -DLIBKINETO_NOCUPTI -DUSE_PYTORCH_QNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-range-loop-analysis -Wno-pass-failed -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -Wconstant-conversion -Wno-invalid-partial-specialization -Wno-typedef-redefinition -Wno-unknown-warning-option -Wno-unused-private-field -Wno-inconsistent-missing-override -Wno-aligned-allocation-unavailable -Wno-c++14-extensions -Wno-constexpr-not-const -Wno-missing-braces -Qunused-arguments -fcolor-diagnostics -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unused-private-field -Wno-missing-braces -Wno-c++14-extensions -Wno-constexpr-not-const -g -fno-omit-frame-pointer -O0 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.9 -fPIE -DTH_HAVE_THREAD -std=gnu++14 -MD -MT torch/csrc/deploy/CMakeFiles/remove_dt_needed.dir/remove_dt_needed.cpp.o -MF torch/csrc/deploy/CMakeFiles/remove_dt_needed.dir/remove_dt_needed.cpp.o.d -o torch/csrc/deploy/CMakeFiles/remove_dt_needed.dir/remove_dt_needed.cpp.o -c ../torch/csrc/deploy/remove_dt_needed.cpp
../torch/csrc/deploy/remove_dt_needed.cpp:1:10: fatal error: 'elf.h' file not found
#include <elf.h>
         ^~~~~~~
1 error generated.
[536/1806] Generating ../../../torch/version.py
fatal: no tag exactly matches '8a6c104ce9398815989317f208eae80ea2fe6ac1'
[539/1806] Performing download step (git clone) for 'cpython'
Cloning into 'cpython'...
Note: switching to 'v3.8.6'.

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 switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at db455296be Python 3.8.6
ninja: build stopped: subcommand failed.

```


### Versions

Collecting environment information...
PyTorch version: 1.12.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 12.5 (x86_64)
GCC version: Could not collect
Clang version: 13.1.6 (clang-1316.0.21.2.5)
CMake version: version 3.19.6
Libc version: N/A

Python version: 3.9.12 (main, Jun  1 2022, 06:36:29)  [Clang 12.0.0 ] (64-bit runtime)
Python platform: macOS-10.16-x86_64-i386-64bit
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] pytorch-lightning==1.6.5
[pip3] pytorch-metric-learning==1.3.2
[pip3] torch==1.12.1
[pip3] torchmetrics==0.7.3
[pip3] torchtext==0.13.0
[pip3] torchvision==0.13.1
[conda] blas                      1.0                         mkl  
[conda] ffmpeg                    4.3                  h0a44026_0    pytorch
[conda] mkl                       2019.4                      233  
[conda] mkl-include               2022.0.0           hecd8cb5_105  
[conda] mkl-service               2.3.0            py39h9ed2024_0  
[conda] mkl_fft                   1.3.0            py39ha059aab_0  
[conda] mkl_random                1.0.2            py39h16bde0e_0  
[conda] numpy                     1.19.2           py39he57783f_0  
[conda] numpy-base                1.19.2           py39hde55871_0  
[conda] pytorch                   1.12.1                  py3.9_0    pytorch
[conda] pytorch-lightning         1.6.5                    pypi_0    pypi
[conda] pytorch-metric-learning   1.3.2                    pypi_0    pypi
[conda] torch                     1.13.0a0+git8a6c104           dev_0    <develop>
[conda] torchmetrics              0.7.3                    pypi_0    pypi
[conda] torchtext                 0.13.0                   pypi_0    pypi
[conda] torchvision               0.13.1                 py39_cpu    pytorch