Skip to content

Commit 066d6fc

Browse files
committed
build: fix per-target loop and vestigial lines in MFCTargets
Flagged by Copilot review on MFlowCode#1572; all pre-existing on master, carried verbatim by the CMakeLists split. Unified-memory flags (NVHPC managedalloc pair, FRONTIER_UNIFIED x2) now apply to a_target so the NVHPC two-pass IPO lib target gets them too; the set(ENV{OMP_TARGET_OFFLOAD} [MANDATORY]) line is deleted outright - set(ENV) only affects the configure-time process so it never influenced built binaries, and its bracketed value was a literal besides; a leftover debug message(STATUS) removed.
1 parent f011350 commit 066d6fc

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

cmake/MFCTargets.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ exit 0
7474

7575
foreach (a_target ${IPO_TARGETS})
7676
set_target_properties(${a_target} PROPERTIES Fortran_PREPROCESS ON)
77-
message(STATUS ${CMAKE_Fortran_COMPILER_ID})
7877

7978
target_include_directories(${a_target} PRIVATE
8079
"${CMAKE_SOURCE_DIR}/src/common"
@@ -161,7 +160,6 @@ exit 0
161160
if (NOT TARGET OpenMP::OpenMP_Fortran)
162161
message(FATAL_ERROR "OpenMP + Fortran is unsupported.")
163162
endif()
164-
set(ENV{OMP_TARGET_OFFLOAD} [MANDATORY])
165163
# target_link_libraries(${a_target} PRIVATE OpenMP::OpenMP_Fortran)
166164
target_compile_definitions(${a_target} PRIVATE MFC_OpenMP MFC_GPU)
167165

@@ -209,11 +207,11 @@ exit 0
209207

210208
# GH-200 Unified Memory Support
211209
if (MFC_Unified)
212-
target_compile_options(${ARGS_TARGET}
210+
target_compile_options(${a_target}
213211
PRIVATE -gpu=mem:unified:managedalloc -cuda
214212
)
215213
# "This option must appear in both the compile and link lines" -- NVHPC Docs
216-
target_link_options(${ARGS_TARGET}
214+
target_link_options(${a_target}
217215
PRIVATE -gpu=mem:unified:managedalloc -cuda
218216
)
219217
endif()
@@ -226,7 +224,7 @@ exit 0
226224
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
227225
# Frontier Unified Memory Support
228226
if (MFC_Unified)
229-
target_compile_options(${ARGS_TARGET}
227+
target_compile_options(${a_target}
230228
PRIVATE -DFRONTIER_UNIFIED)
231229
endif()
232230

@@ -239,7 +237,7 @@ exit 0
239237
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
240238

241239
if (MFC_Unified)
242-
target_compile_options(${ARGS_TARGET}
240+
target_compile_options(${a_target}
243241
PRIVATE -DFRONTIER_UNIFIED)
244242
endif()
245243

0 commit comments

Comments
 (0)