Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blt_hip_smoke does not compile #700

Open
gzagaris opened this issue Sep 18, 2024 · 2 comments
Open

blt_hip_smoke does not compile #700

gzagaris opened this issue Sep 18, 2024 · 2 comments

Comments

@gzagaris
Copy link
Member

gzagaris commented Sep 18, 2024

Hello,

I am trying to compile with HIP and it seems that CMake attempts to compile the blt_hip_smoke test using the host-compiler.

My host-config looks like this:

#---------------------------------------------------------------------------------------------------
# Compiler settings
#---------------------------------------------------------------------------------------------------
set(CMAKE_C_COMPILER "/opt/cray/pe/gcc/12.2.0/snos/bin/gcc" CACHE PATH "Path to the C compiler." )
set(CMAKE_CXX_COMPILER "/opt/cray/pe/gcc/12.2.0/snos/bin/g++" CACHE PATH "Path to the C++ compiler." )

...

#---------------------------------------------------------------------------------------------------
# ROCM / HIP 
#---------------------------------------------------------------------------------------------------
set(ENABLE_HIP ON CACHE BOOL "")
set(ROCM_ROOT_DIR "/opt/rocm-5.7.0" CACHE PATH "")
set(HIP_ROOT_DIR "${ROCM_ROOT_DIR}/hip" CACHE PATH "")
set(HIP_CXX_COMPILER "${HIP_ROOT_DIR}/bin/hipcc" CACHE PATH "")
set(CMAKE_HIP_COMPILER "${ROCM_ROOT_DIR}/llvm/bin/clang++" CACHE FILEPATH "")

set(CMAKE_HIP_ARCHITECTURES "gfx90a" CACHE STRING "")
set(AMDGPU_TARGETS "gfx90a" CACHE STRING "")
set(GPU_TARGETS "gfx90a" CACHE STRING "")

I configure with CMake successfully, but, I see the following warnings:

-- Creating BLT HIP targets...
CMake Deprecation Warning at /opt/rocm-5.7.0/lib/cmake/hip/hip-config.cmake:20 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  contrib/blt/cmake/thirdparty/BLTSetupHIP.cmake:38 (find_package)
  contrib/blt/cmake/BLTSetupTargets.cmake:108 (include)
  contrib/blt/cmake/SetupThirdParty.cmake:6 (include)
  contrib/blt/SetupBLT.cmake:129 (include)
  CMakeLists.txt:39 (mint_blt_setup)


CMake Deprecation Warning at /opt/rocm-5.7.0/lib/cmake/hip/hip-config-amd.cmake:21 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  /opt/rocm-5.7.0/lib/cmake/hip/hip-config.cmake:150 (include)
  contrib/blt/cmake/thirdparty/BLTSetupHIP.cmake:38 (find_package)
  contrib/blt/cmake/BLTSetupTargets.cmake:108 (include)
  contrib/blt/cmake/SetupThirdParty.cmake:6 (include)
  contrib/blt/SetupBLT.cmake:129 (include)
  ...

When building, e.g., with make -j, or just make make blt_hip_smoke/fast

I get the following error:

Building CXX object blt/tests/smoke/CMakeFiles/blt_hip_smoke.dir/blt_hip_smoke.cpp.o
g++: error: unrecognized command-line option '--rocm-path=/opt/rocm-5.7.0'
g++: error: unrecognized command-line option '--offload-arch=gfx90a'
make[1]: *** [blt/tests/smoke/CMakeFiles/blt_hip_smoke.dir/build.make:76: blt/tests/smoke/CMakeFiles/blt_hip_smoke.dir/blt_hip_smoke.cpp.o] Error 1

Any ideas? Am I missing any flags?

I tried this with blt v0.5.3 and the latest v0.6.2.

Thank you for all your help.

@white238
Copy link
Member

Unfortunately we are still on the original way to handle HIP which requires you to have your main compiler be the HIP compiler. See example here:

https://github.com/LLNL/blt/blob/develop/host-configs/llnl/toss_4_x86_64_ib_cray/clang%4016.0.0_hip.cmake

It is on our shortlist to fix.

@gzagaris
Copy link
Member Author

Unfortunately we are still on the original way to handle HIP which requires you to have your main compiler be the HIP compiler. See example here:

https://github.com/LLNL/blt/blob/develop/host-configs/llnl/toss_4_x86_64_ib_cray/clang%4016.0.0_hip.cmake

It is on our shortlist to fix.

Ugh...bummer, thanks @white238 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants