diff --git a/MPI1/CMakeLists.txt b/MPI1/CMakeLists.txt index d399b9b36..a843976d2 100644 --- a/MPI1/CMakeLists.txt +++ b/MPI1/CMakeLists.txt @@ -78,7 +78,11 @@ prk_mpi1_executable(p2p DIR Synch_p2p SOURCES p2p.c # --- Stencil ------------------------------------------------------------ # stencil.c #includes "loop_body_star.incl"/"loop_body_compact.incl" # unconditionally, same as SERIAL's -- generated at build time. -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" @@ -140,7 +144,9 @@ target_link_libraries(mpi1_pic PRIVATE Threads::Threads MPI::MPI_C m) # --- AMR -------------------------------------------------------------- # AMR also compiles timestep.c (COMOBJS += timestep.o) and needs all four # loop_gen/loop_gen_amr variants. -set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR") +# Generated dir is "AMR_gen", not "AMR": same case-insensitive-APFS +# collision with OUTPUT_NAME "amr" as Stencil_gen above. +set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR_gen") file(MAKE_DIRECTORY ${_amr_gen_dir}) add_custom_command( OUTPUT "${_amr_gen_dir}/loop_body_star.incl" @@ -175,7 +181,9 @@ set_source_files_properties( # --- Branch (not part of ci/build-run-prk.sh's allmpi) coverage, but a # normal kernel with its own subdirectory like the rest) ------------------- -set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch") +# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS +# collision with OUTPUT_NAME "branch" as Stencil_gen above. +set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen") file(MAKE_DIRECTORY ${_branch_gen_dir}) add_custom_command( OUTPUT "${_branch_gen_dir}/func.c" diff --git a/MPIOPENMP/CMakeLists.txt b/MPIOPENMP/CMakeLists.txt index f7ad55658..d1853646e 100644 --- a/MPIOPENMP/CMakeLists.txt +++ b/MPIOPENMP/CMakeLists.txt @@ -85,7 +85,11 @@ prk_mpiopenmp_executable(p2p DIR Synch_p2p SOURCES p2p.c # DOUBLE=1, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0, VERBOSE=0. # stencil.c #includes the generated loop_body_star.incl/loop_body_compact.incl # unconditionally, same as SERIAL/Stencil -- generate via common/Stencil/loop_gen. -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" diff --git a/MPIRMA/CMakeLists.txt b/MPIRMA/CMakeLists.txt index aac7107ff..6f193ab38 100644 --- a/MPIRMA/CMakeLists.txt +++ b/MPIRMA/CMakeLists.txt @@ -77,7 +77,11 @@ prk_mpirma_executable(p2p DIR Synch_p2p SOURCES p2p.c # these aren't checked in, generated by common/Stencil/loop_gen at build # time, same as the Makefile's own pattern rule (and SERIAL's own Stencil # target). -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" diff --git a/MPISHM/CMakeLists.txt b/MPISHM/CMakeLists.txt index 785983656..615a99c2e 100644 --- a/MPISHM/CMakeLists.txt +++ b/MPISHM/CMakeLists.txt @@ -71,7 +71,11 @@ prk_mpishm_executable(p2p DIR Synch_p2p SOURCES p2p.c # DOUBLE=1, STAR=1, LOCAL_BARRIER_SYNCH=0, RESTRICT_KEYWORD=0, RADIUS=2, # LOOPGEN=0, VERBOSE=0. Same generated-.incl-file pattern as SERIAL's # Stencil/AMR targets (common/Stencil/loop_gen). -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" diff --git a/OPENMP/CMakeLists.txt b/OPENMP/CMakeLists.txt index 9d2612b5f..8138015f1 100644 --- a/OPENMP/CMakeLists.txt +++ b/OPENMP/CMakeLists.txt @@ -77,7 +77,11 @@ prk_openmp_executable(p2p DIR Synch_p2p SOURCES p2p.c # DOUBLE=1, PARALLELFOR=0, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0, # MAXTHREADS=512, VERBOSE=0. stencil.c #includes the generated .incl files # unconditionally, same as SERIAL/Stencil. -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" @@ -154,10 +158,23 @@ prk_openmp_executable(random DIR Random SOURCES random.c DEFS RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0 HPCC=1 ATOMIC=0 ERRORPERCENT=1 LONG_IS_64BITS=0) # --- Branch ------------------------------------------------------------- -# func.c is checked into the repo here already (unlike SERIAL/Branch, -# where it's generated) -- just compile it directly. -prk_openmp_executable(branch DIR Branch SOURCES branch.c func.c - DEFS RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0) +# func.c is not checked into the repo -- like SERIAL/Branch, it's generated +# by the checked-in ./func_gen script (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40 +# defaults, matching the Makefile's own ifndef defaults). +# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS +# collision with OUTPUT_NAME "branch" as Stencil_gen above. +set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen") +file(MAKE_DIRECTORY ${_branch_gen_dir}) +add_custom_command( + OUTPUT "${_branch_gen_dir}/func.c" + COMMAND "${CMAKE_CURRENT_LIST_DIR}/Branch/func_gen" 10 40 + WORKING_DIRECTORY ${_branch_gen_dir} + COMMENT "Generating Branch/func.c (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40)") +add_executable(openmp_branch Branch/branch.c "${_branch_gen_dir}/func.c" $ $) +set_target_properties(openmp_branch PROPERTIES OUTPUT_NAME branch) +target_include_directories(openmp_branch PRIVATE ${PRK_INCLUDE_DIR} "${CMAKE_CURRENT_LIST_DIR}/Branch") +target_compile_definitions(openmp_branch PRIVATE RESTRICT_KEYWORD=0 MAXTHREADS=512 VERBOSE=0) +target_link_libraries(openmp_branch PRIVATE Threads::Threads OpenMP::OpenMP_C) # --- CTest: reproduces ci/build-run-prk.sh's allopenmp) run commands ----- # OMP_NUM_THREADS=4, passed both as the env var (matching what a real user diff --git a/SERIAL/CMakeLists.txt b/SERIAL/CMakeLists.txt index 19bb61ee7..252fa7314 100644 --- a/SERIAL/CMakeLists.txt +++ b/SERIAL/CMakeLists.txt @@ -87,7 +87,11 @@ prk_serial_executable(p2p DIR Synch_p2p SOURCES p2p.c # unconditionally (both code paths compiled in, selected at runtime) -- # these aren't checked in, generated by common/Stencil/loop_gen at build # time, same as the Makefile's own pattern rule. -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl" @@ -145,7 +149,9 @@ target_link_libraries(serial_pic PRIVATE Threads::Threads m) # DOUBLE=1, STAR=1, RESTRICT_KEYWORD=0, RADIUS=2, LOOPGEN=0, VERBOSE=0. # amr.c needs all four loop_gen/loop_gen_amr variants (star/compact, # regular/amr). -set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR") +# Generated dir is "AMR_gen", not "AMR": same case-insensitive-APFS +# collision with OUTPUT_NAME "amr" as Stencil_gen above. +set(_amr_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/AMR_gen") file(MAKE_DIRECTORY ${_amr_gen_dir}) add_custom_command( OUTPUT "${_amr_gen_dir}/loop_body_star.incl" @@ -184,7 +190,9 @@ set_source_files_properties( # (matches the Makefile's OBJS = $(PROGRAM).o $(COMOBJS) func.o), generated # by the checked-in ./func_gen script (MATRIX_RANK=10, NUMBER_OF_FUNCTIONS=40 # defaults). -set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch") +# Generated dir is "Branch_gen", not "Branch": same case-insensitive-APFS +# collision with OUTPUT_NAME "branch" as Stencil_gen above. +set(_branch_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Branch_gen") file(MAKE_DIRECTORY ${_branch_gen_dir}) add_custom_command( OUTPUT "${_branch_gen_dir}/func.c" diff --git a/SHMEM/CMakeLists.txt b/SHMEM/CMakeLists.txt index 5efe19f96..bf1ea6931 100644 --- a/SHMEM/CMakeLists.txt +++ b/SHMEM/CMakeLists.txt @@ -119,7 +119,11 @@ prk_shmem_executable(p2p DIR Synch_p2p SOURCES p2p.c # VERBOSE=0. stencil.c #includes "loop_body_star.incl"/ # "loop_body_compact.incl" unconditionally, same generated-.incl-file # pattern as SERIAL/MPIRMA's Stencil targets (common/Stencil/loop_gen). -set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil") +# Generated dir is "Stencil_gen", not "Stencil": the executable's +# OUTPUT_NAME is "stencil", and on macOS's default case-insensitive APFS +# that collides with a sibling directory literally named "Stencil" in the +# same build root, making the linker fail with "Is a directory". +set(_stencil_gen_dir "${CMAKE_CURRENT_BINARY_DIR}/Stencil_gen") file(MAKE_DIRECTORY ${_stencil_gen_dir}) add_custom_command( OUTPUT "${_stencil_gen_dir}/loop_body_star.incl"