HIP
HIP copied to clipboard
ld.lld: error: unable to find library -lamdhip64
I am compiling code converted from CUDA by Hipify-perl with Rocm-5.0.0, My CMakeLists.txt about HIP lies here:
PROJECT(MultiEuler LANGUAGES CXX) set(CMAKE_MODULE_PATH "/opt/rocm/hip/cmake" ${CMAKE_MODULE_PATH}) find_package(HIP) find_package(MPI) option(USE_DOUBLE "if double" ON) option(ENABLE_HIP "if enable cuda" ON) option(USE_MPI "if enable mpi" ON) if(ENABLE_HIP) set(CMAKE_CXX_COMPILER "hipcc") endif(ENABLE_HIP) IF(ENABLE_HIP) set(HIP_INCLUDE_DIRS "$ENV{HIP_PATH}/include") include_directories(${HIP_INCLUDE_DIRS}) add_compile_options(-DENABLE_HIP) IF(NOT DEFINED CMAKE_HIP_ARCHITECTURES) set(CMAKE_HIP_ARCHITECTURES gfx803) ENDIF(NOT DEFINED CMAKE_HIP_ARCHITECTURES) ENDIF(ENABLE_HIP)
HIP code are treated as libs in sub_dir like :
add_library(hipsrc STATIC fun.cuh setup.h error.cuh block.cuh device_func.cuh cuda_kernels.cuh block.cpp cuda_kernels.cpp ) target_compile_features(hipsrc PUBLIC cxx_std_14 )
compiling failed at the end of link execuable and libs with error : ld.lld: error: unable to find library -lamdhip64 clang-14: error: linker command failed with exit code 1 (use -v to see invocation)
But Linking step has no -lamdhip64 and no libamdhip64.so in my Rocm_install_path
Hello @jiuxiaocloud,
libamdhip64 is obligatory HIP lib, the path to which should be provided to the compiler/linker.
Regards, Evgeny
Though the reported issue is unrelated to hipification, could you please provide at least a hipified source? CUDA source would be even better. Btw, why are you using not the latest ROCm HIP release?
@jiuxiaocloud Hi, were you able to resolve this issue on the latest HIP? If so can we close this ticket?
yes, It's solved