Skip to content

Conversation

@DominikAdamski
Copy link
Contributor

@DominikAdamski DominikAdamski commented Oct 21, 2025

[WIP] Do not merge. Test only with: ROCm/llvm-project#328 and manually applied patches for hipfort and rocprofiler-register/external/glog .

Motivation

Modify aomp scripts to test PR: ROCm/llvm-project#328

Technical Details

This PR bumps CMake version to 4.1.2 (the latest release). I haven't determined the oldest CMake version which can compile AOMP LLVM with PR ROCm/llvm-project#328 .

This PR adds required changes to build GPU LLVM IR Flang runtime.

Test Plan

Test procedure:

  1. Apply this PR
  2. Apply LLVM PR: [WIP] Changes required for embedded GPU LLVM IR Flang runtime llvm-project#328 for LLVM
  3. Manually increase version of CMake for hipfort:
diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt
index e56006bb..ee70fd2b 100644
--- a/bin/CMakeLists.txt
+++ b/bin/CMakeLists.txt
@@ -1,5 +1,5 @@

-cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
+cmake_minimum_required(VERSION 4.0.0 FATAL_ERROR)
 if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
   project(hipfort-tools)
  1. Manually increase version of CMake for rocprofiler-register/external/glog:
diff --git a/cmake/GetCacheVariables.cmake b/cmake/GetCacheVariables.cmake
index ead3589..4fa0562 100644
--- a/cmake/GetCacheVariables.cmake
+++ b/cmake/GetCacheVariables.cmake
@@ -1,5 +1,5 @@
 cmake_policy (PUSH)
-cmake_policy (VERSION 3.3)
+cmake_policy (VERSION 4.0)

 include (CMakeParseArguments)
  1. Build AOMP :
./build_aomp.sh

a) (Optional) Build flang_rt.hostdevice if you want to use old -lflang_rt.hostdevice

./build_llvm-flang-rt-host-dev.sh
  1. Test smoke-fort-dev for the new Flang RT:
    ./check_smoke_fort_dev.sh

  2. (Optional) Test smoke-fort-dev for the old Flang RT (flang_rt.hostdevice):
    Make sure, you built flang_rt.hostdevice (point 5a), and launch smoke_fort_dev tests with env var: FLANG_GPU_LINK_FLAGS="-nogpuflangrt -lflang_rt.hostdevice"

FLANG_GPU_LINK_FLAGS="-nogpuflangrt -lflang_rt.hostdevice"  ./check_smoke_fort_dev.sh

Test Result

No regression for smoke-fort-dev and GenASiS.

This change requires patching hipfort and rocprofiler-register.
No need to explicitly link Flang runtime for GPU code.
Do not add -lflang_rt.hostdevice flag
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

Successfully merging this pull request may close these issues.

1 participant