
Nicolai Hähnle has been a longtime AMD open-source Linux graphics driver developer and currently is employed by them to work on their LLVM-based AMDGPU shader compiler.
On his personal blog Hähnle has written a guide for building a HIP environment from scratch. This guide includes leveraging the upstream LLVM/Clang/LLD compiler sources, ROCm CMake files, and using the libhsa-runtime64.so library as the lowest-level host-side library of the ROCm stack. Plus building the libamdhip64.so library as the host-side HIP API support.
The guide then shows how you can use your newly-built Clang to compile a hello world example for targeting AMD HIP and running on the GPU.
Those interested in compiling your own AMD HIP stack can learn all the details via Nicolai's how-to guide .