From 50a1d0879b6a88dbd41467047447cd3aae2ba54d Mon Sep 17 00:00:00 2001 From: Brian Cornille Date: Sat, 9 Nov 2024 01:57:07 -0600 Subject: [PATCH] Minimal set of changes to enable building with LLVM flang. (#198) --- CMakeLists.txt | 6 +++--- lib/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eab23fe4..e22f47ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,15 +107,15 @@ ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F08) #OPTION(USE_MPI "Use the MPI library for parallelization" OFF) #OPTION(USE_OPENMP "Use OpenMP for parallelization" OFF) -IF(CMAKE_Fortran_COMPILER_ID MATCHES "Cray") +IF(CMAKE_Fortran_COMPILER_ID MATCHES "(Cray|LLVMFlang)") set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS}") -ELSE(CMAKE_Fortran_COMPILER_ID MATCHES "Cray") +ELSE(CMAKE_Fortran_COMPILER_ID MATCHES "(Cray|LLVMFlang)") IF(CMAKE_Fortran_COMPILER_SUPPORTS_F08) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS} -std=f2008") ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F08) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${HIPFORT_COMPILER_FLAGS} -std=f2003") ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F08) -ENDIF(CMAKE_Fortran_COMPILER_ID MATCHES "Cray") +ENDIF(CMAKE_Fortran_COMPILER_ID MATCHES "(Cray|LLVMFlang)") # Set compile flags for DEBUG, # RELEASE, or TESTING. INCLUDE(${CMAKE_MODULE_PATH}/SetFortranFlags.cmake) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index f94328d8..34303c20 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -196,7 +196,7 @@ if(HIP_PLATFORM STREQUAL "amd") find_package(hipsparse PATHS ${ROCM_PATH} /opt/rocm) if(hipsparse_FOUND) - hipfort_add_component(hipsparse hip::hipsparse) + hipfort_add_component(hipsparse roc::hipsparse) else() message(STATUS "Skipping hipfort::hipsparse target export") endif()