Skip to content

Commit

Permalink
NVHPC BUG: workaround for nvhpc module import scoping bug
Browse files Browse the repository at this point in the history
  • Loading branch information
awnawab committed Sep 4, 2024
1 parent b58acc6 commit 7c5d404
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/ecwam/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,11 @@ ecbuild_add_library(
PUBLIC_DEFINITIONS ${ECWAM_DEFINITIONS}
)

# Workaround for import scoping bug in nvhpc
get_target_property(FIELD_API_INCLUDE_DIRS field_api_${prec} INTERFACE_INCLUDE_DIRECTORIES)
target_include_directories( ${ecwam} INTERFACE $<BUILD_INTERFACE:${FIELD_API_INCLUDE_DIRS}> )
target_include_directories( ${ecwam} INTERFACE $<INSTALL_INTERFACE:${FIELD_API_INCLUDE_DIRS}> )

ecwam_target_fortran_module_directory(
TARGET ${ecwam}
MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/module/${ecwam}
Expand Down
2 changes: 1 addition & 1 deletion src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ foreach( program
ecbuild_add_executable(
TARGET ${PROJECT_NAME}-${program}
SOURCES ${program}.F90
LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES} $<${HAVE_ACC}:OpenACC::OpenACC_Fortran> field_api_${prec}
LIBS ${PROJECT_NAME} ${OpenMP_Fortran_LIBRARIES} $<${HAVE_ACC}:OpenACC::OpenACC_Fortran>
LINKER_LANGUAGE Fortran
)
ecwam_target_compile_definitions_FILENAME(${PROJECT_NAME}-${program})
Expand Down

0 comments on commit 7c5d404

Please sign in to comment.