Repository: pytorch
Issue: Build from source failed
Labels: module: build,triaged

### 🐛 Describe the bug

I try to build pytorch from source so it can utilized OpenBLAS instead MKL. But, i got error during the build. Here is the log.

## Log
```
FAILED: third_party/breakpad/CMakeFiles/breakpad.dir/src/client/linux/handler/exception_handler.cc.o 
/usr/bin/c++ -DHAVE_A_OUT_H -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 -I/home/permata/Projects/build_aur/pytorch/cmake/../third_party/benchmark/include -I/home/permata/Projects/build_aur/pytorch/third_party/onnx -I/home/permata/Projects/build_aur/pytorch/build/third_party/onnx -I/home/permata/Projects/build_aur/pytorch/third_party/foxi -I/home/permata/Projects/build_aur/pytorch/build/third_party/foxi -I/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src -I/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/third_party/linux/include -isystem /home/permata/Projects/build_aur/pytorch/build/third_party/gloo -isystem /home/permata/Projects/build_aur/pytorch/cmake/../third_party/gloo -isystem /home/permata/Projects/build_aur/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /home/permata/Projects/build_aur/pytorch/cmake/../third_party/googletest/googletest/include -isystem /home/permata/Projects/build_aur/pytorch/third_party/protobuf/src -isystem /home/permata/Projects/build_aur/pytorch/third_party/gemmlowp -isystem /home/permata/Projects/build_aur/pytorch/third_party/neon2sse -isystem /home/permata/Projects/build_aur/pytorch/third_party/XNNPACK/include -isystem /home/permata/Projects/build_aur/pytorch/cmake/../third_party/eigen -isystem /home/permata/Projects/build_aur/pytorch/third_party/ideep/mkl-dnn/third_party/oneDNN/include -isystem /home/permata/Projects/build_aur/pytorch/third_party/ideep/include -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -O3 -DNDEBUG -DNDEBUG -fPIC -DCAFFE2_USE_GLOO -DTH_HAVE_THREAD -std=gnu++14 -MD -MT third_party/breakpad/CMakeFiles/breakpad.dir/src/client/linux/handler/exception_handler.cc.o -MF third_party/breakpad/CMakeFiles/breakpad.dir/src/client/linux/handler/exception_handler.cc.o.d -o third_party/breakpad/CMakeFiles/breakpad.dir/src/client/linux/handler/exception_handler.cc.o -c /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc: In function ‘void google_breakpad::{anonymous}::InstallAlternateStackLocked()’:
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:141:49: error: no matching function for call to ‘max(int, long int)’
  141 |   static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11.2.0/bits/char_traits.h:39,
                 from /usr/include/c++/11.2.0/string:40,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.h:38,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:66:
/usr/include/c++/11.2.0/bits/stl_algobase.h:254:5: note: candidate: ‘template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
  254 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/11.2.0/bits/stl_algobase.h:254:5: note:   template argument deduction/substitution failed:
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:141:49: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long int’)
  141 |   static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11.2.0/bits/char_traits.h:39,
                 from /usr/include/c++/11.2.0/string:40,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.h:38,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:66:
/usr/include/c++/11.2.0/bits/stl_algobase.h:300:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
  300 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/11.2.0/bits/stl_algobase.h:300:5: note:   template argument deduction/substitution failed:
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:141:49: note:   deduced conflicting types for parameter ‘const _Tp’ (‘int’ and ‘long int’)
  141 |   static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11.2.0/algorithm:62,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:85:
/usr/include/c++/11.2.0/bits/stl_algo.h:3461:5: note: candidate: ‘template<class _Tp> constexpr _Tp std::max(std::initializer_list<_Tp>)’
 3461 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/11.2.0/bits/stl_algo.h:3461:5: note:   template argument deduction/substitution failed:
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:141:49: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  141 |   static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11.2.0/algorithm:62,
                 from /home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:85:
/usr/include/c++/11.2.0/bits/stl_algo.h:3467:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr _Tp std::max(std::initializer_list<_Tp>, _Compare)’
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/11.2.0/bits/stl_algo.h:3467:5: note:   template argument deduction/substitution failed:
/home/permata/Projects/build_aur/pytorch/third_party/breakpad/src/client/linux/handler/exception_handler.cc:141:49: note:   mismatched types ‘std::initializer_list<_Tp>’ and ‘int’
  141 |   static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
      |                                         ~~~~~~~~^~~~~~~~~~~~~~~~~
[3287/4939] Building CXX object thir...pu_x64.dir/utils/jit_io_helper.cpp.o
ninja: build stopped: subcommand failed.
```

I am having a hard time to understand this log. I hope there is someone can give me an insight or solution to this error. 

### Versions

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A

OS: Arch Linux (x86_64)
GCC version: (GCC) 11.2.0
Clang version: 13.0.1
CMake version: version 3.22.2
Libc version: glibc-2.35

Python version: 3.8.12 (default, Feb 18 2022, 03:30:28)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.15.24-xanmod1-tt-1-x86_64-with-glibc2.34
Is CUDA available: N/A
CUDA runtime version: Could not collect
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: false

Versions of relevant libraries:
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.22.2
[conda] Could not collect

cc @malfet @seemethere