Unable to build pytorch v1.14 from source

generating /home/lijuntao/pytorch1.14/pytorch/build/third_party/onnx/onnx/onnx_data_pb.py
[848/1657] Building CXX object caffe2/CMakeFiles/torch_cpu.dir//aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp.o
FAILED: caffe2/CMakeFiles/torch_cpu.dir/
/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp.o
/usr/bin/c++ -DAT_PER_OPERATOR_HEADERS -DCPUINFO_SUPPORTED_PLATFORM=1 -DFMT_HEADER_ONLY=1 -DHAVE_MALLOC_USABLE_SIZE=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 -Dtorch_cpu_EXPORTS -I/home/lijuntao/pytorch1.14/pytorch/build/aten/src -I/home/lijuntao/pytorch1.14/pytorch/aten/src -I/home/lijuntao/pytorch1.14/pytorch/build -I/home/lijuntao/pytorch1.14/pytorch -I/home/lijuntao/pytorch1.14/pytorch/third_party/onnx -I/home/lijuntao/pytorch1.14/pytorch/build/third_party/onnx -I/home/lijuntao/pytorch1.14/pytorch/third_party/foxi -I/home/lijuntao/pytorch1.14/pytorch/build/third_party/foxi -I/home/lijuntao/pytorch1.14/pytorch/torch/csrc/api -I/home/lijuntao/pytorch1.14/pytorch/torch/csrc/api/include -I/home/lijuntao/pytorch1.14/pytorch/caffe2/aten/src/TH -I/home/lijuntao/pytorch1.14/pytorch/build/caffe2/aten/src/TH -I/home/lijuntao/pytorch1.14/pytorch/build/caffe2/aten/src -I/home/lijuntao/pytorch1.14/pytorch/build/caffe2/…/aten/src -I/home/lijuntao/pytorch1.14/pytorch/torch/csrc -I/home/lijuntao/pytorch1.14/pytorch/third_party/miniz-2.1.0 -I/home/lijuntao/pytorch1.14/pytorch/third_party/kineto/libkineto/include -I/home/lijuntao/pytorch1.14/pytorch/third_party/kineto/libkineto/src -I/home/lijuntao/pytorch1.14/pytorch/aten/…/third_party/catch/single_include -I/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/… -I/home/lijuntao/pytorch1.14/pytorch/c10/… -I/home/lijuntao/pytorch1.14/pytorch/third_party/pthreadpool/include -I/home/lijuntao/pytorch1.14/pytorch/third_party/cpuinfo/include -I/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack/include -I/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/qnnpack/src -I/home/lijuntao/pytorch1.14/pytorch/third_party/cpuinfo/deps/clog/include -I/home/lijuntao/pytorch1.14/pytorch/third_party/ittapi/src/ittnotify -I/home/lijuntao/pytorch1.14/pytorch/third_party/FP16/include -I/home/lijuntao/pytorch1.14/pytorch/third_party/fmt/include -I/home/lijuntao/pytorch1.14/pytorch/third_party/flatbuffers/include -isystem /home/lijuntao/pytorch1.14/pytorch/third_party/protobuf/src -isystem /home/lijuntao/.conda/envs/torch-1.14/include -isystem /home/lijuntao/pytorch1.14/pytorch/third_party/ittapi/include -isystem /home/lijuntao/pytorch1.14/pytorch/cmake/…/third_party/eigen -isystem /home/lijuntao/pytorch1.14/pytorch/build/include -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -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 -Wunused-local-typedefs -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-attributes -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -DHAVE_AVX2_CPU_DEFINITION -g -fno-omit-frame-pointer -O0 -fPIC -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-unused-result -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-type-limits -Wno-array-bounds -Wno-sign-compare -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-missing-braces -Wno-maybe-uninitialized -fvisibility=hidden -fopenmp -DCAFFE2_BUILD_MAIN_LIB -pthread -std=gnu++14 -MD -MT caffe2/CMakeFiles/torch_cpu.dir//aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp.o -MF caffe2/CMakeFiles/torch_cpu.dir//aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp.o.d -o caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp.o -c /home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp: In function ‘constexpr const char* {anonymous}::_hack_int_to_class_name(int)’:
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:390:3: error: call to non-constexpr function ‘void assert_fail(const char*, const char*, unsigned int, const char*)’
}
^
In file included from /home/lijuntao/pytorch1.14/pytorch/torch/custom_class.h:14:0,
from /home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:21:
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp: In instantiation of ‘int register_conv_params() [with int kSpatialDim = 2]’:
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:434:39: required from here
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:398:67: error: ‘constexpr const char* {anonymous}::_hack_int_to_class_name(int)’ called in a constant expression
“quantized”, TORCH_SELECTIVE_CLASS(hack_int_to_class_name(kSpatialDim)))
^
/home/lijuntao/pytorch1.14/pytorch/torch/library.h:497:71: note: in definition of macro ‘TORCH_SELECTIVE_CLASS’
torch::detail::SelectiveStrc10::impl::custom_class_allowlist_check(n)(n)
^
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:397:63: note: in template argument for type ‘bool’
torch::selective_class
<ConvPackedParamsBase>(
^
In file included from /home/lijuntao/pytorch1.14/pytorch/torch/custom_class.h:14:0,
from /home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:21:
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp: In instantiation of ‘int register_conv_params() [with int kSpatialDim = 3]’:
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:436:39: required from here
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:398:67: error: ‘constexpr const char* {anonymous}::_hack_int_to_class_name(int)’ called in a constant expression
“quantized”, TORCH_SELECTIVE_CLASS(hack_int_to_class_name(kSpatialDim)))
^
/home/lijuntao/pytorch1.14/pytorch/torch/library.h:497:71: note: in definition of macro ‘TORCH_SELECTIVE_CLASS’
torch::detail::SelectiveStrc10::impl::custom_class_allowlist_check(n)(n)
^
/home/lijuntao/pytorch1.14/pytorch/aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp:397:63: note: in template argument for type ‘bool’
torch::selective_class
<ConvPackedParamsBase>(
^
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-stringop-overflow’
[869/1657] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/
/aten/src/ATen/native/quantized/cpu/qdropout.cpp.o
ninja: build stopped: subcommand failed.