Build on MacOS Monterey fails

gianni: <p>Following the directions on pytorch website my build fails using <code>MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ USE_CUDA=0 USE_METAL=1 python setup.py develop</code></p>
<p>Any help regarding this will be much appreciated.</p>
<p>the error:</p>
<pre><code class="lang-auto">[3/1758] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/Layout.cpp.o
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Layout.cpp.o 
/Users/giannicrivello/pytorch/torch/csrc/Layout.cpp:38:5: error: cast from 'PyObject *(*)(THPLayout *)' (aka '_object *(*)(THPLayout *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)THPLayout_repr, /* tp_repr */
    ^~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[4/1758] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/Device.cpp.o
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Device.cpp.o 
/Users/giannicrivello/llvm/build/bin/clang++ -DAT_PER_OPERATOR_HEADERS -DBUILDING_TESTS -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 -DTHP_BUILD_MAIN_LIB -DUSE_EXTERNAL_MZCRC -DUSE_ITT -DUSE_NUMPY -D_FILE_OFFSET_BITS=64 -Dtorch_python_EXPORTS -I/Users/giannicrivello/pytorch/build/aten/src -I/Users/giannicrivello/pytorch/aten/src -I/Users/giannicrivello/pytorch/build -I/Users/giannicrivello/pytorch -I/Users/giannicrivello/pytorch/cmake/../third_party/benchmark/include -I/Users/giannicrivello/pytorch/third_party/onnx -I/Users/giannicrivello/pytorch/build/third_party/onnx -I/Users/giannicrivello/pytorch/third_party/foxi -I/Users/giannicrivello/pytorch/build/third_party/foxi -I/Users/giannicrivello/pytorch/torch/.. -I/Users/giannicrivello/pytorch/torch/../aten/src -I/Users/giannicrivello/pytorch/torch/../aten/src/TH -I/Users/giannicrivello/pytorch/build/caffe2/aten/src -I/Users/giannicrivello/pytorch/build/third_party -I/Users/giannicrivello/pytorch/torch/../third_party/valgrind-headers -I/Users/giannicrivello/pytorch/torch/../third_party/gloo -I/Users/giannicrivello/pytorch/torch/../third_party/onnx -I/Users/giannicrivello/pytorch/torch/../third_party/flatbuffers/include -I/Users/giannicrivello/pytorch/torch/../third_party/kineto/libkineto/include -I/Users/giannicrivello/pytorch/torch/csrc -I/Users/giannicrivello/pytorch/torch/csrc/api/include -I/Users/giannicrivello/pytorch/torch/lib -I/Users/giannicrivello/pytorch/torch/lib/libshm -I/Users/giannicrivello/pytorch/torch/csrc/api -I/Users/giannicrivello/pytorch/c10/.. -I/Users/giannicrivello/pytorch/torch/lib/libshm/../../../torch/lib -I/Users/giannicrivello/pytorch/third_party/fmt/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googletest/include -isystem /Users/giannicrivello/pytorch/third_party/protobuf/src -isystem /Users/giannicrivello/pytorch/third_party/gemmlowp -isystem /Users/giannicrivello/pytorch/third_party/neon2sse -isystem /Users/giannicrivello/pytorch/third_party/XNNPACK/include -isystem /Users/giannicrivello/pytorch/third_party/ittapi/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/eigen -isystem /Users/giannicrivello/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /Users/giannicrivello/pytorch/third_party/ideep/include -isystem /Users/giannicrivello/miniconda3/include/python3.9 -isystem /Users/giannicrivello/miniconda3/lib/python3.9/site-packages/numpy/core/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/pybind11/include -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -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-unused-private-field -Wno-inconsistent-missing-override -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const -O3 -DNDEBUG -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.9 -fPIC -DTH_HAVE_THREAD -Wno-unused-variable -Wno-writable-strings -MD -MT caffe2/torch/CMakeFiles/torch_python.dir/csrc/Device.cpp.o -MF caffe2/torch/CMakeFiles/torch_python.dir/csrc/Device.cpp.o.d -o caffe2/torch/CMakeFiles/torch_python.dir/csrc/Device.cpp.o -c /Users/giannicrivello/pytorch/torch/csrc/Device.cpp
/Users/giannicrivello/pytorch/torch/csrc/Device.cpp:178:14: error: cast from 'PyObject *(*)(THPDevice *, PyObject *)' (aka '_object *(*)(THPDevice *, _object *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"type", (getter)THPDevice_type, nullptr, nullptr, nullptr},
             ^~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Device.cpp:179:15: error: cast from 'PyObject *(*)(THPDevice *, PyObject *)' (aka '_object *(*)(THPDevice *, _object *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"index", (getter)THPDevice_index, nullptr, nullptr, nullptr},
              ^~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Device.cpp:197:5: error: cast from 'PyObject *(*)(THPDevice *)' (aka '_object *(*)(THPDevice *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)THPDevice_repr, /* tp_repr */
    ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Device.cpp:201:5: error: cast from 'Py_ssize_t (*)(THPDevice *)' (aka 'long (*)(THPDevice *)') to 'hashfunc' (aka 'long (*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (hashfunc)THPDevice_hash, /* tp_hash  */
    ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Device.cpp:203:5: error: cast from 'PyObject *(*)(THPDevice *)' (aka '_object *(*)(THPDevice *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)THPDevice_str, /* tp_str */
    ^~~~~~~~~~~~~~~~~~~~~~~
5 errors generated.
[5/1758] Building CXX object functorch/CMakeFiles/functorch.dir/csrc/dim/dim.cpp.o
FAILED: functorch/CMakeFiles/functorch.dir/csrc/dim/dim.cpp.o 
/Users/giannicrivello/llvm/build/bin/clang++ -DFUNCTORCH_BUILD_MAIN_LIB -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 -DTORCH_API_INCLUDE_EXTENSION_H -DTORCH_EXTENSION_NAME=_C -DUSE_EXTERNAL_MZCRC -D_FILE_OFFSET_BITS=64 -Dfunctorch_EXPORTS -I/Users/giannicrivello/pytorch/build/aten/src -I/Users/giannicrivello/pytorch/aten/src -I/Users/giannicrivello/pytorch/build -I/Users/giannicrivello/pytorch -I/Users/giannicrivello/pytorch/cmake/../third_party/benchmark/include -I/Users/giannicrivello/pytorch/third_party/onnx -I/Users/giannicrivello/pytorch/build/third_party/onnx -I/Users/giannicrivello/pytorch/third_party/foxi -I/Users/giannicrivello/pytorch/build/third_party/foxi -I/Users/giannicrivello/pytorch/functorch -I/Users/giannicrivello/pytorch/torch/csrc/api -I/Users/giannicrivello/pytorch/torch/csrc/api/include -I/Users/giannicrivello/pytorch/c10/.. -I/Users/giannicrivello/pytorch/torch/.. -I/Users/giannicrivello/pytorch/torch/../aten/src -I/Users/giannicrivello/pytorch/torch/../aten/src/TH -I/Users/giannicrivello/pytorch/build/caffe2/aten/src -I/Users/giannicrivello/pytorch/build/third_party -I/Users/giannicrivello/pytorch/torch/../third_party/valgrind-headers -I/Users/giannicrivello/pytorch/torch/../third_party/gloo -I/Users/giannicrivello/pytorch/torch/../third_party/onnx -I/Users/giannicrivello/pytorch/torch/../third_party/flatbuffers/include -I/Users/giannicrivello/pytorch/torch/../third_party/kineto/libkineto/include -I/Users/giannicrivello/pytorch/torch/csrc -I/Users/giannicrivello/pytorch/torch/lib -I/Users/giannicrivello/pytorch/torch/lib/libshm -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googletest/include -isystem /Users/giannicrivello/pytorch/third_party/protobuf/src -isystem /Users/giannicrivello/pytorch/third_party/gemmlowp -isystem /Users/giannicrivello/pytorch/third_party/neon2sse -isystem /Users/giannicrivello/pytorch/third_party/XNNPACK/include -isystem /Users/giannicrivello/pytorch/third_party/ittapi/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/eigen -isystem /Users/giannicrivello/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /Users/giannicrivello/pytorch/third_party/ideep/include -isystem /Users/giannicrivello/miniconda3/include/python3.9 -isystem /Users/giannicrivello/pytorch/cmake/../third_party/pybind11/include -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -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-unused-private-field -Wno-inconsistent-missing-override -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const -O3 -DNDEBUG -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.9 -fPIC -DTH_HAVE_THREAD -Wno-writable-strings -MD -MT functorch/CMakeFiles/functorch.dir/csrc/dim/dim.cpp.o -MF functorch/CMakeFiles/functorch.dir/csrc/dim/dim.cpp.o.d -o functorch/CMakeFiles/functorch.dir/csrc/dim/dim.cpp.o -c /Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:281:14: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"size", (getter) Dim_getsize, (setter) Dim_setsize,
             ^~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:281:36: error: cast from 'int (*)(Dim *, PyObject *, void *)' (aka 'int (*)(Dim *, _object *, void *)') to 'setter' (aka 'int (*)(_object *, _object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"size", (getter) Dim_getsize, (setter) Dim_setsize,
                                   ^~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:283:18: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"is_bound", (getter) Dim_getis_bound, NULL, "is_bound", NULL},
                 ^~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:284:16: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"_level", (getter) Dim_getlevel, NULL, "_level", NULL},
               ^~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:285:17: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"_levels", (getter) Dim_get_levels, NULL, "_levels", NULL},
                ^~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:286:21: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"_has_device", (getter) Dim_get_has_device, NULL, "_has_device", NULL},
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:287:17: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"_tensor", (getter) Dim_get_tensor, NULL, "_tensor", NULL},
                ^~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:288:22: error: cast from 'PyObject *(*)(Dim *, void *)' (aka '_object *(*)(Dim *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"_batchtensor", (getter) Dim_get_batchtensor, NULL, "_batchtensor", NULL},
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:303:5: error: cast from 'PyObject *(*)(Dim *)' (aka '_object *(*)(Dim *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)Dim_repr,           /* tp_repr */
    ^~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:464:5: error: cast from 'Py_ssize_t (*)(DimList *)' (aka 'long (*)(DimList *)') to 'lenfunc' (aka 'long (*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (lenfunc) DimList_len, //lenfunc sq_length;
    ^~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:467:5: error: cast from 'PyObject *(*)(DimList *, Py_ssize_t)' (aka '_object *(*)(DimList *, long)') to 'ssizeargfunc' (aka '_object *(*)(_object *, long)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (ssizeargfunc) DimList_item, //ssizeargfunc sq_item;
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:482:18: error: cast from 'PyObject *(*)(DimList *, void *)' (aka '_object *(*)(DimList *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"is_bound", (getter) DimList_getis_bound, NULL, "is_bound", NULL},
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:526:5: error: cast from 'PyObject *(*)(DimList *)' (aka '_object *(*)(DimList *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)DimList_repr,           /* tp_repr */
    ^~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:552:5: error: cast from 'int (*)(DimList *, PyObject *, PyObject *)' (aka 'int (*)(DimList *, _object *, _object *)') to 'initproc' (aka 'int (*)(_object *, _object *, _object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (initproc) DimList_init,            /* tp_init */
    ^~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:1371:14: error: cast from 'PyObject *(*)(Tensor *, void *)' (aka '_object *(*)(Tensor *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"ndim", (getter) Tensor_ndim, NULL, "ndim", NULL},
             ^~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/functorch/csrc/dim/dim.cpp:1840:9: warning: variable 'ndim' set but not used [-Wunused-but-set-variable]
    int ndim = 0;
        ^
1 warning and 15 errors generated.
[6/1758] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/Dtype.cpp.o
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Dtype.cpp.o 
/Users/giannicrivello/llvm/build/bin/clang++ -DAT_PER_OPERATOR_HEADERS -DBUILDING_TESTS -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 -DTHP_BUILD_MAIN_LIB -DUSE_EXTERNAL_MZCRC -DUSE_ITT -DUSE_NUMPY -D_FILE_OFFSET_BITS=64 -Dtorch_python_EXPORTS -I/Users/giannicrivello/pytorch/build/aten/src -I/Users/giannicrivello/pytorch/aten/src -I/Users/giannicrivello/pytorch/build -I/Users/giannicrivello/pytorch -I/Users/giannicrivello/pytorch/cmake/../third_party/benchmark/include -I/Users/giannicrivello/pytorch/third_party/onnx -I/Users/giannicrivello/pytorch/build/third_party/onnx -I/Users/giannicrivello/pytorch/third_party/foxi -I/Users/giannicrivello/pytorch/build/third_party/foxi -I/Users/giannicrivello/pytorch/torch/.. -I/Users/giannicrivello/pytorch/torch/../aten/src -I/Users/giannicrivello/pytorch/torch/../aten/src/TH -I/Users/giannicrivello/pytorch/build/caffe2/aten/src -I/Users/giannicrivello/pytorch/build/third_party -I/Users/giannicrivello/pytorch/torch/../third_party/valgrind-headers -I/Users/giannicrivello/pytorch/torch/../third_party/gloo -I/Users/giannicrivello/pytorch/torch/../third_party/onnx -I/Users/giannicrivello/pytorch/torch/../third_party/flatbuffers/include -I/Users/giannicrivello/pytorch/torch/../third_party/kineto/libkineto/include -I/Users/giannicrivello/pytorch/torch/csrc -I/Users/giannicrivello/pytorch/torch/csrc/api/include -I/Users/giannicrivello/pytorch/torch/lib -I/Users/giannicrivello/pytorch/torch/lib/libshm -I/Users/giannicrivello/pytorch/torch/csrc/api -I/Users/giannicrivello/pytorch/c10/.. -I/Users/giannicrivello/pytorch/torch/lib/libshm/../../../torch/lib -I/Users/giannicrivello/pytorch/third_party/fmt/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googletest/include -isystem /Users/giannicrivello/pytorch/third_party/protobuf/src -isystem /Users/giannicrivello/pytorch/third_party/gemmlowp -isystem /Users/giannicrivello/pytorch/third_party/neon2sse -isystem /Users/giannicrivello/pytorch/third_party/XNNPACK/include -isystem /Users/giannicrivello/pytorch/third_party/ittapi/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/eigen -isystem /Users/giannicrivello/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /Users/giannicrivello/pytorch/third_party/ideep/include -isystem /Users/giannicrivello/miniconda3/include/python3.9 -isystem /Users/giannicrivello/miniconda3/lib/python3.9/site-packages/numpy/core/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/pybind11/include -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -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-unused-private-field -Wno-inconsistent-missing-override -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const -O3 -DNDEBUG -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.9 -fPIC -DTH_HAVE_THREAD -Wno-unused-variable -Wno-writable-strings -MD -MT caffe2/torch/CMakeFiles/torch_python.dir/csrc/Dtype.cpp.o -MF caffe2/torch/CMakeFiles/torch_python.dir/csrc/Dtype.cpp.o.d -o caffe2/torch/CMakeFiles/torch_python.dir/csrc/Dtype.cpp.o -c /Users/giannicrivello/pytorch/torch/csrc/Dtype.cpp
/Users/giannicrivello/pytorch/torch/csrc/Dtype.cpp:65:6: error: cast from 'PyObject *(*)(THPDtype *, PyObject *)' (aka '_object *(*)(THPDtype *, _object *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
     (getter)THPDtype_is_floating_point,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Dtype.cpp:69:20: error: cast from 'PyObject *(*)(THPDtype *, PyObject *)' (aka '_object *(*)(THPDtype *, _object *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"is_complex", (getter)THPDtype_is_complex, nullptr, nullptr, nullptr},
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Dtype.cpp:70:19: error: cast from 'PyObject *(*)(THPDtype *, PyObject *)' (aka '_object *(*)(THPDtype *, _object *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"is_signed", (getter)THPDtype_is_signed, nullptr, nullptr, nullptr},
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/giannicrivello/pytorch/torch/csrc/Dtype.cpp:93:5: error: cast from 'PyObject *(*)(THPDtype *)' (aka '_object *(*)(THPDtype *)') to 'reprfunc' (aka '_object *(*)(_object *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    (reprfunc)THPDtype_repr, /* tp_repr */
    ^~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
[9/1758] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/Generator.cpp.o
FAILED: caffe2/torch/CMakeFiles/torch_python.dir/csrc/Generator.cpp.o 
/Users/giannicrivello/llvm/build/bin/clang++ -DAT_PER_OPERATOR_HEADERS -DBUILDING_TESTS -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 -DTHP_BUILD_MAIN_LIB -DUSE_EXTERNAL_MZCRC -DUSE_ITT -DUSE_NUMPY -D_FILE_OFFSET_BITS=64 -Dtorch_python_EXPORTS -I/Users/giannicrivello/pytorch/build/aten/src -I/Users/giannicrivello/pytorch/aten/src -I/Users/giannicrivello/pytorch/build -I/Users/giannicrivello/pytorch -I/Users/giannicrivello/pytorch/cmake/../third_party/benchmark/include -I/Users/giannicrivello/pytorch/third_party/onnx -I/Users/giannicrivello/pytorch/build/third_party/onnx -I/Users/giannicrivello/pytorch/third_party/foxi -I/Users/giannicrivello/pytorch/build/third_party/foxi -I/Users/giannicrivello/pytorch/torch/.. -I/Users/giannicrivello/pytorch/torch/../aten/src -I/Users/giannicrivello/pytorch/torch/../aten/src/TH -I/Users/giannicrivello/pytorch/build/caffe2/aten/src -I/Users/giannicrivello/pytorch/build/third_party -I/Users/giannicrivello/pytorch/torch/../third_party/valgrind-headers -I/Users/giannicrivello/pytorch/torch/../third_party/gloo -I/Users/giannicrivello/pytorch/torch/../third_party/onnx -I/Users/giannicrivello/pytorch/torch/../third_party/flatbuffers/include -I/Users/giannicrivello/pytorch/torch/../third_party/kineto/libkineto/include -I/Users/giannicrivello/pytorch/torch/csrc -I/Users/giannicrivello/pytorch/torch/csrc/api/include -I/Users/giannicrivello/pytorch/torch/lib -I/Users/giannicrivello/pytorch/torch/lib/libshm -I/Users/giannicrivello/pytorch/torch/csrc/api -I/Users/giannicrivello/pytorch/c10/.. -I/Users/giannicrivello/pytorch/torch/lib/libshm/../../../torch/lib -I/Users/giannicrivello/pytorch/third_party/fmt/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/googletest/googletest/include -isystem /Users/giannicrivello/pytorch/third_party/protobuf/src -isystem /Users/giannicrivello/pytorch/third_party/gemmlowp -isystem /Users/giannicrivello/pytorch/third_party/neon2sse -isystem /Users/giannicrivello/pytorch/third_party/XNNPACK/include -isystem /Users/giannicrivello/pytorch/third_party/ittapi/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/eigen -isystem /Users/giannicrivello/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /Users/giannicrivello/pytorch/third_party/ideep/include -isystem /Users/giannicrivello/miniconda3/include/python3.9 -isystem /Users/giannicrivello/miniconda3/lib/python3.9/site-packages/numpy/core/include -isystem /Users/giannicrivello/pytorch/cmake/../third_party/pybind11/include -Wno-deprecated -fvisibility-inlines-hidden -Wno-deprecated-declarations -DUSE_PTHREADPOOL -DNDEBUG -DUSE_KINETO -DLIBKINETO_NOCUPTI -DLIBKINETO_NOROCTRACER -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wall -Wextra -Werror=return-type -Werror=non-virtual-dtor -Werror=braced-scalar-init -Werror=range-loop-construct -Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wvla-extension -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-unused-private-field -Wno-inconsistent-missing-override -Wno-constexpr-not-const -Wno-missing-braces -Wunused-lambda-capture -Wunused-local-typedef -Qunused-arguments -fcolor-diagnostics -fdiagnostics-color=always -fno-math-errno -fno-trapping-math -Werror=format -Werror=cast-function-type -DUSE_MPS -fno-objc-arc -Wno-unguarded-availability-new -Wno-unused-private-field -Wno-missing-braces -Wno-constexpr-not-const -O3 -DNDEBUG -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.9 -fPIC -DTH_HAVE_THREAD -Wno-unused-variable -Wno-writable-strings -MD -MT caffe2/torch/CMakeFiles/torch_python.dir/csrc/Generator.cpp.o -MF caffe2/torch/CMakeFiles/torch_python.dir/csrc/Generator.cpp.o.d -o caffe2/torch/CMakeFiles/torch_python.dir/csrc/Generator.cpp.o -c /Users/giannicrivello/pytorch/torch/csrc/Generator.cpp
/Users/giannicrivello/pytorch/torch/csrc/Generator.cpp:172:16: error: cast from 'PyObject *(*)(THPGenerator *, void *)' (aka '_object *(*)(THPGenerator *, void *)') to 'getter' (aka '_object *(*)(_object *, void *)') converts to incompatible function type [-Werror,-Wcast-function-type-strict]
    {"device", (getter)THPGenerator_get_device, nullptr, nullptr, nullptr},
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[12/1758] Building CXX object functorch/CMakeFiles/functorch.dir/csrc/init_dim_only.cpp.o
ninja: build stopped: subcommand failed.
</code></pre>