18105, "king-11", "LLVM Build fails without 'limits' header", "2021-07-23T03:23:21Z"
Summary of Problem
make
fails on llvm
build in Manjaro Linux.
Error
/home/lord/CS/Development/chapel/third-party/llvm/llvm-src/utils/benchmark/src/benchmark_register.h:17:30: error: ânumeric_limitsâ is not a member of âstdâ
17 | static const T kmax = std::numeric_limits<T>::max();
> ^~~~~~~~~~~~~~
/home/lord/CS/Development/chapel/third-party/llvm/llvm-src/utils/benchmark/src/benchmark_register.h:17:46: error: expected primary-expression before â>â token
17 | static const T kmax = std::numeric_limits<T>::max();
> ^
/home/lord/CS/Development/chapel/third-party/llvm/llvm-src/utils/benchmark/src/benchmark_register.h:17:49: error: â::maxâ has not been declared; did you mean âstd::maxâ?
17 | static const T kmax = std::numeric_limits<T>::max();
> ^~~
> std::max
Steps to Reproduce
- clone the repo in a manjaro distribution with Linux kernel
5.10.49-1
- run
./configure
- run
make
Configuration Information
- Output of
chpl --version
:main
- Output of
$CHPL_HOME/util/printchplenv --anonymize
:CHPL_TARGET_PLATFORM: linux64 CHPL_TARGET_COMPILER: llvm CHPL_TARGET_ARCH: x86_64 CHPL_TARGET_CPU: native CHPL_LOCALE_MODEL: flat CHPL_COMM: none CHPL_TASKS: qthreads CHPL_LAUNCHER: none CHPL_TIMERS: generic CHPL_UNWIND: none CHPL_MEM: jemalloc CHPL_ATOMICS: cstdlib CHPL_GMP: none CHPL_HWLOC: bundled CHPL_RE2: none CHPL_LLVM: bundled * CHPL_AUX_FILESYS: none
- Back-end compiler and version, e.g.
gcc --version
orclang --version
:- gcc (GCC) 11.1.0
- clang version 12.0.1
Solution
adding limits
header in /third-party/llvm/llvm-src/utils/benchmark/src/benchmark_register.h
#include <limits>