arrayfire / arrayfire

ArrayFire: a general purpose GPU library.

Home Page:https://arrayfire.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Build] Error : missing lib #include <climits>

Kreyparion opened this issue · comments

Description

During the build with the command : make -j8 an error occurred which stopped the build process : a missing library import in reduce.hpp

Error Log

arrayfire/src/backend/opencl/kernel/reduce.hpp: In function ‘void arrayfire::opencl::kernel::reduceAllLauncher(arrayfire::opencl::Param, arrayfire::opencl::Param, arrayfire::opencl::uint, arrayfire::opencl::uint, arrayfire::opencl::uint, int, double)’:
arrayfire/src/backend/opencl/kernel/reduce.hpp:145:24: error: ‘UINT_MAX’ was not declared in this scope
  145 |     if (tmp_elements > UINT_MAX) {
      |                        ^~~~~~~~
arrayfire/src/backend/opencl/kernel/reduce.hpp:26:1: note: ‘UINT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
   25 | #include <kernel_headers/reduce_first.hpp>
  +++ |+#include <climits>
   26 | #include <math.hpp>
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unqualified-std-cast-call’ may have been intended to silence earlier diagnostics

I added #include <climits> in the reduce.hpp file and it fixed it.

Build Environment

Compiler version: gcc 11.4.0
Operating system: Ubuntu 22.04
Build environment: everything else installed successfully
CMake variables: cmake .. -DCMAKE_BUILD_TYPE=Release