Skip to content
Snippets Groups Projects
Commit 011bc9fc authored by Yen-Chen Chen's avatar Yen-Chen Chen Committed by Jonas Jucker
Browse files

Fix OpenACC configuration for LUMI (!84)


<!--
ICON
## What is the bug
LUMI does not have `OpenACC_C` and the BB fails because we are checking `OpenACC` for both `C` and `Fortran`. This MR fixes `lumi_gpu` BB.
## How do you fix it
Only check if `OpenACC_Fortran` is found.

Approved-by: default avatarJonas Jucker <jonas.jucker@env.ethz.ch>
Merged-by: default avatarJonas Jucker <jonas.jucker@env.ethz.ch>
Changelog: bugfix
parent 07c0f723
No related branches found
No related tags found
1 merge request!84Fix OpenACC configuration for LUMI
Pipeline #64042 passed
......@@ -13,8 +13,6 @@ cmake_minimum_required(VERSION 3.18)
project(fortran-support VERSION 0.1.0 LANGUAGES Fortran C)
find_package(OpenACC QUIET)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(BUILD_TESTING "Build tests" ON)
......
......@@ -84,8 +84,13 @@ check_macro_defined(HAS_OPENACC_MACRO _OPENACC QUIET)
if (FS_ENABLE_OPENACC)
# If _OPENACC is defined, assume that the required compiler flags are already
# provided, e.g. in CMAKE_Fortran_FLAGS:
if(NOT HAS_OPENACC_MACRO)
find_package(OpenACC REQUIRED)
if (NOT HAS_OPENACC_MACRO)
# On LUMI, we only have OpenACC_Fortran, but no OpenACC_C
find_package(OpenACC QUIET)
if (NOT OpenACC_Fortran_FOUND)
message(FATAL_ERROR
"Could NOT find OpenACC_Fortran.")
endif ()
target_compile_options(fortran-support PRIVATE ${OpenACC_Fortran_OPTIONS})
# This make sures that unit tests (FortUTF) compiles without the need of
# passing OpenACC compile option.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment