Hi,
This is my first post here.
I am trying to write a CMakeLists.txt that will build a HIP test code (hipify from cuda):
hipcc --offload-arch=gfx908 -fPIC -fgpu-rdc -std=c++17 -w -c domain/util.cu
hipcc --offload-arch=gfx908 -fPIC -fgpu-rdc -std=c++17 -w -c domain/test.cu -Iinclude
hipcc -fPIC -shared -dlink util.o test.o -o device_link.o -fgpu-rdc --hip-link
/opt/rocm/llvm/bin/clang++ src/main.cpp util.o test.o device_link.o -o exe -L/opt/rocm/hip/lib -lamdhip64 -Iinclude
My cmake version is 3.22.1
I start with:
cmake -S . -B build
β The CXX compiler identification is GNU 7.5.0
β The C compiler identification is GNU 7.5.0
β Detecting CXX compiler ABI info
β Detecting CXX compiler ABI info - done
β Check for working CXX compiler: /usr/bin/c++ - skipped
β Detecting CXX compile features
β Detecting CXX compile features - done
β Detecting C compiler ABI info
β Detecting C compiler ABI info - done
β Check for working C compiler: /usr/bin/cc - skipped
β Detecting C compile features
β Detecting C compile features - done
β Found HIP: /opt/rocm-4.3.1/hip (found version β4.3.21331-94fc2572β)
β Found HIP: 4.3.21331-94fc2572
β Looking for a HIP compiler
β Looking for a HIP compiler - /opt/rocm-4.3.1/llvm/bin/clang++
β The HIP compiler identification is Clang 13.0.0
β Detecting HIP compiler ABI info
β Detecting HIP compiler ABI info - done
β Check for working HIP compiler: /opt/rocm-4.3.1/llvm/bin/clang++ - skipped
β Detecting HIP compile features
β Detecting HIP compile features - done
β Configuring done
β Generating done
β Build files have been written to: build
My CMakeLists.txt have add_library and $<TARGET_OBJECTS:test_obj> but I am unable to make cmake build the object:
cd build; make test_obj VERBOSE=1
make[3]: Nothing to be done for βdomain/CMakeFiles/test_obj.dir/buildβ.
What did I miss ?
Thank you for your help.