ROCm / ROCm-Device-Libs

ROCm Device Libraries
97 stars 60 forks source link

Use of unknown builtin #67

Closed MathiasMagnus closed 1 year ago

MathiasMagnus commented 4 years ago

Trying to build ROCm-Device-Libs master as suggested by HIP-clang build instructions while reyling on LLVM 9.0.1. Rest of ROCm installed under /opt/rocm is 3.0. Ubuntu 16.04

PS /home/mate/Source/Repos/ROCm-Device-Libs/build> cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DLLVM_DIR=/opt/rocm/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_WERROR=1 -DLLVM_ENABLE_ASSERTIONS=1 ..            
-- The C compiler identification is Clang 9.0.1
-- The CXX compiler identification is Clang 9.0.1
-- Check for working C compiler: /opt/rocm/llvm/bin/clang
-- Check for working C compiler: /opt/rocm/llvm/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/rocm/llvm/bin/clang++
-- Check for working CXX compiler: /opt/rocm/llvm/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Linker detection: GNU ld
CMake Deprecation Warning at OCL.cmake:12 (cmake_policy):
  The OLD behavior for policy CMP0053 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  CMakeLists.txt:62 (include)

-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    LLVM_ENABLE_WERROR

-- Build files have been written to: /home/mate/Source/Repos/ROCm-Device-Libs/build
PS /home/mate/Source/Repos/ROCm-Device-Libs/build> cmake --build . -- -j8
...
[11%] Generating add_sat.bc
/home/mate/Source/Repos/ROCm-Device-Libs/ocml/src/acosH.cl:30:15: error: use of unknown builtin '__builtin_fabsf16' [-Wimplicit-function-declaration]
    half ax = BUILTIN_ABS_F16(x);
              ^
/home/mate/Source/Repos/ROCm-Device-Libs/ocml/src/builtins.h:41:25: note: expanded from macro 'BUILTIN_ABS_F16'
#define BUILTIN_ABS_F16 __builtin_fabsf16
                        ^
b-sumner commented 4 years ago

@MathiasMagnus the device libs evolve in parallel with the compiler, and the compilers used in, and provided by, ROCm 3.0 are more recent than LLVM 9.0.1.

Also, the bitcode "libraries" which result from compiling device libs are shipped with ROCm so there is no particular need to build them.

MathiasMagnus commented 4 years ago

@b-sumner, good to know, although I was merely following orders. After seeing master branch being LLVM 11 already (I dared not try), I tried something at 'random' (latest stable) from the support chart.

b-sumner commented 1 year ago

We're working on a means to avoid the device library and compiler sources from getting out of sync and will update the build instructions. Closing this as user error due to incomplete documentation.