From 35457456edcee4768da326f0477c4fb735a2fc25 Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Thu, 24 Oct 2024 15:42:51 -0700 Subject: [PATCH 1/8] Consolidate visit_add_libarary and visit_add_parallel_library. Added `DO_PARALLEL` option to visit_add_libary, indicating the library should be considered parallel. Added `SKIP_INSTALL` option to visit_add_library indicating the library isn't to be installed. Added `visit_patch_parallel_target` which adds all the parallel flags, defines, includes, libs, etc to a parallel target. Added `visit_patch_target` to add SOURCES, INCLUDES, DEFINES, etc to an already created target. --- src/CMake/VisItMacros.cmake | 211 +++++++++++++++++++++--------------- 1 file changed, 126 insertions(+), 85 deletions(-) diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index 9e87d26b4e6..63e229b8522 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -255,9 +255,116 @@ macro(visit_append_list) endmacro() ############################################################################## -# Adds a library target. Wrapper around blt_add_library so that CACHE vars -# possibly created by visit_append_list for forming SOURCES/INCLUDES, etc -# can be unset. +# patch a target with new sources, headers, etc: +# Any non-visit-specific args are passed directly to blt_patch_target. +# +# ARGUMENTS: +# NAME target name REQUIRED +# +# visit-specific (not handled by blt_patch_target) +# +# SOURCES [source1 [source2 ...]] OPTIONAL +# HEADERS [header1 [header2 ...]] OPTIONAL +# LINKDIR OPTIONAL +# +# pass-through to blt_patch_target: +# +# INCLUDES [dir1 [dir2 ...]] OPTIONAL +# DEFINES [define1 [define2 ...]] OPTIONAL +# DEPENDS_ON [dep1 ...] OPTIONAL +# LIBRARIES [lib1 [lib2 ...]] OPTIONAL +# COMPILE_FLAGS [flag1 [flag2 ..]] OPTIONAL +# LINK_FLAGS [flag1 [flag2 ..]] OPTIONAL +# +############################################################################## + +macro(visit_patch_target) + set(singleValueArgs NAME) + set(multiValueArgs SOURCES HEADERS LINKDIR) + + # parse the arguments + cmake_parse_arguments(vpt "" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT vpt_NAME) + message(FATAL_ERROR "visit_patch_target() must be called with argument NAME ") + endif() + + if (vpt_SOURCES) + target_sources(${vpt_NAME} PRIVATE ${vpt_SOURCES}) + endif() + if (vpt_HEADERS) + target_sources(${vpt_NAME} PRIVATE ${vpt_HEADERS}) + endif() + if (vpt_lINKDIR) + target_link_directories(${vpt_NAME} PRIVATE ${vpt_LINKDIR}) + endif() + + if(vpt_UNUSED_ARUGMENTS) + blt_patch_target(NAME ${vpt_NAME} ${vpt_UNUSED_ARGUMENTS}) + endif() +endmacro() + + +############################################################################## +# Patches target with parallel specific additions common to all VisIt +# parallel targets whether library or executable. +# +# ARGUMENTS: +# NAME target name REQUIRED +# +############################################################################## + +function(visit_patch_parallel_target) + + cmake_parse_arguments(vppt "" "NAME" "" ${ARGN}) + if(NOT vppt_NAME) + message(FATAL_ERROR "visit_patch_parallel_target() must be called with argument NAME ") + endif() + + if(UNIX) + if(VISIT_PARALLEL_CXXFLAGS) + string(REPLACE " " ";" PAR_COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + set_property(TARGET ${vppt_NAME} APPEND + PROPERTY COMPILE_FLAGS ${PAR_COMPILE_FLAGS}) + endif() + if(VISIT_PARALLEL_LINKER_FLAGS) + string(REPLACE " " ";" PAR_LINK_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + set_property(TARGET ${vppt_NAME} APPEND + PROPERTY LINK_FLAGS ${PAR_LINK_FLAGS}) + endif() + + if(${CMAKE_INSTALL_RPATH}) + string(REPLACE " " ";" CPAR_RPATHS ${CAKE_INSTALL_RPATH}) + set_property(TARGET ${vppt_NAME} APPEND PROPERTY + INSTALL_RPATH ${CPAR_RPATHS}) + endif() + + if(VISIT_PARALLEL_RPATH) + string(REPLACE " " ";" VPAR_RPATHS ${VISIT_PARALLEL_RPATH}) + set_property(TARGET ${vppt_NAME} APPEND PROPERTY + INSTALL_RPATH ${VPAR_RPATHS}) + endif() + visit_patch_target( + NAME ${vppt_NAME} + DEFINES ${VISIT_PARALLEL_DEFS}) + else() + visit_patch_target( + NAME ${vppt_NAME} + INCLUDES ${VISIT_PARALLEL_INCLUDE} + DEFINES ${VISIT_PARALLEL_DEFS}) + endif() + if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) + visit_patch_target( + NAME ${vppt_NAME} + DEPENDS_ON ${VISIT_PARALLEL_LIBS}) + endif() +endfunction() + +############################################################################## +# Adds a library target. +# calls blt_add_library +# handles parallel +# clears cache vars. # # ARGUMENTS: # NAME library name REQUIRED @@ -268,12 +375,19 @@ endmacro() # DEPENDS_ON [dep1 ...] OPTIONAL # OUTPUT_NAME [name] OPTIONAL # FEATURES [feat1 [feat2 ...]] OPTIONAL -# FOLDER [name]) OPTIONAL +# FOLDER [name] OPTIONAL +# SKIP_INSTALL OPTIONAL (visit only) +# DO_PARALLEL OPTIONAL (visit only) +# +# Modifications: +# Kathleen Biags, Thu Oct 24, 2024 +# Added DO_PARALLEL so that we can use 1 macro for adding libraries +# Added SKIP_INSTALL to indicate the target should not be installed. # ############################################################################## macro(visit_add_library) - set(options) + set(options SKIP_INSTALL DO_PARALLEL) set(singleValueArgs NAME OUTPUT_NAME FOLDER) set(multiValueArgs SOURCES HEADERS INCLUDES DEFINES DEPENDS_ON FEATURES) @@ -305,7 +419,13 @@ macro(visit_add_library) target_compile_features(${val_NAME} PRIVATE ${val_FEATURES}) endif() - visit_install_export_targets(${val_NAME}) + if(NOT ${val_SKIP_INSTALL}) + visit_install_export_targets(${val_NAME}) + endif() + + if(${val_DO_PARALLEL}) + visit_patch_parallel_target(NAME ${val_NAME}) + endif() # vars that may have been created by calls to visit_append_list unset(${val_NAME}_SOURCES CACHE) @@ -316,82 +436,3 @@ macro(visit_add_library) unset(${val_NAME}_FEATURES CACHE) endmacro() -############################################################################## -# Like visit_add_library, but adds parallel compile/link options. -# Taken mostly from VISIT_ADD_PARALLEL_LIBRARY -# -# ARGUMENTS: -# NAME target name REQUIRED -# SOURCES [source1 [source2 ...]] REQUIRED -# HEADERS [header1 [header2 ...]] OPTIONAL -# INCLUDES [dir1 [dir2 ...]] OPTIONAL -# DEFINES [define1 [define2 ...]] OPTIONAL -# DEPENDS_ON [dep1 ...] OPTIONAL -# FOLDER [name]) OPTIONAL -# -############################################################################## - -macro(visit_add_parallel_library) - - visit_add_library(${ARGV}) - - cmake_parse_arguments(vapl "" "NAME" "" ${ARGN}) - - if(UNIX) - if(VISIT_PARALLEL_CXXFLAGS) - # check for compile flags vs includes - set(PAR_COMPILE_FLAGS "") - set(PAR_INCLUDE "") - string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) - foreach(X ${VISIT_PARALLEL_CXXFLAGS}) - string(SUBSTRING ${X} 0 2 is_include) - if(is_include STREQUAL "-I") - string(SUBSTRING ${X} 2 -1 x_as_include) - list(APPEND PAR_INCLUDE $) - else() - list(APPEND PAR_COMPILE_FLAGS "${X}") - endif() - endforeach() - target_include_directories(${vapl_NAME} PUBLIC ${PAR_INCLUDE}) - target_compile_options(${vapl_NAME} PUBLIC ${PAR_COMPILE_FLAGS}) - - endif() - - if(VISIT_PARALLEL_LINKER_FLAGS) - set(PAR_LINK_FLAGS "") - set(PAR_LINK_DIR "") - string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) - foreach(X ${VISIT_PARALLEL_LINKER_FLAGS}) - string(SUBSTRING ${X} 0 2 is_link_dir) - if(is_link_dir STREQUAL "-L") - string(SUBSTRING ${X} 2 -1 x_as_link) - list(APPEND PAR_LINK_DIR ${x_as_link}) - else() - list(APPEND PAR_LINK_FLAGS "${X}") - endif() - endforeach() - target_link_options(${vapl_NAME} PUBLIC ${PAR_LINK_FLAGS}) - target_link_directories(${vapl_NAME} PUBLIC ${PAR_LINK_DIR}) - endif() - - if(VISIT_PARALLEL_RPATH) - set(PAR_RPATHS "") - foreach(X ${CMAKE_INSTALL_RPATH}) - list(APPEND PAR_RPATHS ${X}) - endforeach() - foreach(X ${VISIT_PARALLEL_RPATH}) - list(APPEND PAR_RPATHS ${X}) - endforeach() - set_property(TARGET ${vapl_NAME} - APPEND PROPERTY INSTALL_RPATH ${PAR_RPATHS}) - endif() - else() # not on unix - target_include_directories(${vapl_NAME} PUBLIC $) - target_compile_definitions(${vapl_NAME} PUBLIC ${VISIT_PARALLEL_DEFS}) - endif() - - if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) - target_link_libraries(${vapl_NAME} PUBLIC ${VISIT_PARALLEL_LIBS}) - endif() -endmacro() - From bb73f92430a5eaf2f33a125d6cd4eea31eac65ab Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Thu, 24 Oct 2024 15:44:38 -0700 Subject: [PATCH 2/8] Separate PARALLEL compile definitions from other flags. --- src/CMake/VisItParallel.cmake | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/CMake/VisItParallel.cmake b/src/CMake/VisItParallel.cmake index 334c8ba9c52..2665c2271e8 100644 --- a/src/CMake/VisItParallel.cmake +++ b/src/CMake/VisItParallel.cmake @@ -3,7 +3,7 @@ # details. No copyright assignment is required to contribute to VisIt. -function(DETECT_MPI_SETTINGS COMP mlibs mflags mlflags mrpath) +function(DETECT_MPI_SETTINGS COMP mlibs mdefs mflags mlflags mrpath) # Unset any variables that may have been set before by FindMPI unset(MPI_FOUND CACHE) unset(MPI_INCLUDE_PATH CACHE) @@ -31,7 +31,8 @@ function(DETECT_MPI_SETTINGS COMP mlibs mflags mlflags mrpath) endforeach() set(${mlibs} ${MPI_LIBRARIES} CACHE STRING "MPI libraries") - set(${mflags} "-DPARALLEL -DMPICH_IGNORE_CXX_SEEK ${MPI_INCLUDE_PATH_CONV} ${MPI_COMPILE_FLAGS}" CACHE STRING "Parallel compiler flags") + set(${mdefs} "PARALLEL MPICH_IGNORE_CXX_SEEK" CACHE STRING "Parallel compiler defines") + set(${mflags} "${MPI_INCLUDE_PATH_CONV} ${MPI_COMPILE_FLAGS}" CACHE STRING "Parallel compiler flags") set(${mlflags} "${MPI_LINK_FLAGS}" CACHE STRING "Parallel linker flags") # @@ -153,11 +154,7 @@ function(PARALLEL_EXECUTABLE_LINK_LIBRARIES target) endfunction() -if(WIN32) - set(VPFLAGS "PARALLEL MPICH_IGNORE_CXX_SEEK MPICH_SKIP_MPICXX OMPI_SKIP_MPICXX MPI_NO_CPPBIND") -else() - set(VPFLAGS "-DPARALLEL -DMPICH_IGNORE_CXX_SEEK -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX -DMPI_NO_CPPBIND") -endif() +set(VPDEFS "PARALLEL MPICH_IGNORE_CXX_SEEK MPICH_SKIP_MPICXX OMPI_SKIP_MPICXX MPI_NO_CPPBIND") if(VISIT_MPI_COMPILER) message(STATUS "Setting up MPI using compiler wrapper") @@ -165,23 +162,22 @@ if(VISIT_MPI_COMPILER) # Detect the MPI settings that C++ wants DETECT_MPI_SETTINGS(${VISIT_MPI_COMPILER} VISIT_PARALLEL_LIBS + VISIT_PARALLEL_DEFS VISIT_PARALLEL_CFLAGS VISIT_PARALLEL_LINKER_FLAGS VISIT_PARALLEL_RPATH) set(VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CFLAGS} CACHE STRING "Parallel CXXFLAGS") - set(VISIT_PARALLEL_CFLAGS "${VPFLAGS} ${VISIT_PARALLEL_CFLAGS}") - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS} ${VISIT_PARALLEL_CXXFLAGS}") # Detect the MPI settings that Fortran wants if(VISIT_FORTRAN AND VISIT_MPI_FORTRAN_COMPILER) DETECT_MPI_SETTINGS(${VISIT_MPI_FORTRAN_COMPILER} VISIT_PARALLEL_FORTRAN_LIBS + VISIT_PARALLEL_FORTRAN_DEFS VISIT_PARALLEL_FORTRAN_FLAGS VISIT_PARALLEL_FORTRAN_LINKER_FLAGS VISIT_PARALLEL_RPATH ) - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS} ${VISIT_PARALLEL_FORTRAN_FLAGS}") endif() else() @@ -193,26 +189,26 @@ else() CACHE STRING "MPI libraries for Fortran") if(VISIT_MPI_C_FLAGS) - set(VISIT_PARALLEL_CFLAGS " ${VPFLAGS} ${VISIT_MPI_C_FLAGS}" + set(VISIT_PARALLEL_CFLAGS "${VISIT_MPI_C_FLAGS}" CACHE STRING "Parallel CFLAGS") else() - set(VISIT_PARALLEL_CFLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_CFLAGS "" CACHE STRING "Parallel CFLAGS") endif() if(VISIT_MPI_CXX_FLAGS) - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS} ${VISIT_MPI_CXX_FLAGS}" + set(VISIT_PARALLEL_CXXFLAGS "${VISIT_MPI_CXX_FLAGS}" CACHE STRING "Parallel CXXFLAGS") else() - set(VISIT_PARALLEL_CXXFLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_CXXFLAGS "" CACHE STRING "Parallel CXXFLAGS") endif() if(VISIT_MPI_FORTRAN_FLAGS) - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS} ${VISIT_MPI_FORTRAN_FLAGS}" + set(VISIT_PARALLEL_FORTRAN_FLAGS "${VISIT_MPI_FORTRAN_FLAGS}" CACHE STRING "Parallel Fortran flags") else() - set(VISIT_PARALLEL_FORTRAN_FLAGS "${VPFLAGS}" + set(VISIT_PARALLEL_FORTRAN_FLAGS "" CACHE STRING "Parallel flags for Fortran") endif() @@ -232,9 +228,7 @@ else() if(NOT MPI_FOUND) include(${CMAKE_ROOT}/Modules/FindMPI.cmake) if(MPI_FOUND) - string(REPLACE " " ";" VPFLAGS "${VPFLAGS}") - set(VISIT_PARALLEL_DEFS "${VPFLAGS}" - CACHE STRING "parallel defines") + string(REPLACE " " ";" VISIT_PARALLEL_DEFS ${VPDEFS}) set(VISIT_PARALLEL_LIBS "${MPI_LIBRARY}" CACHE STRING "MPI libraries") set(VISIT_PARALLEL_INCLUDE "${MPI_INCLUDE_PATH}" From d3da78998dc0facd424621a434fd781a8c768ef6 Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Thu, 24 Oct 2024 15:47:44 -0700 Subject: [PATCH 3/8] Convert visit_add_parallel_library calls to visit_add_library with DO_PARALLEL. Use visit_patch_target where feasible. --- src/avt/DataBinning/CMakeLists.txt | 3 +- src/avt/Database/CMakeLists.txt | 3 +- src/avt/Expressions/CMakeLists.txt | 3 +- src/avt/FileWriter/CMakeLists.txt | 3 +- src/avt/Filters/CMakeLists.txt | 3 +- src/avt/IVP/CMakeLists.txt | 3 +- src/avt/MIR/CMakeLists.txt | 3 +- src/avt/Pipeline/CMakeLists.txt | 3 +- src/avt/Plotter/CMakeLists.txt | 3 +- src/avt/PythonFilters/CMakeLists.txt | 12 +- src/avt/QtVisWindow/vtk/CMakeLists.txt | 16 +-- src/avt/Queries/CMakeLists.txt | 11 +- src/avt/VisWindow/CMakeLists.txt | 3 +- src/engine/main/CMakeLists.txt | 25 ++-- .../cognomen/CMakeLists.txt | 7 +- src/viewer/core/CMakeLists.txt | 7 +- src/viewer/core/actions/CMakeLists.txt | 18 ++- src/viewer/main/ddt/CMakeLists.txt | 21 ++-- src/viewer/main/ui/CMakeLists.txt | 108 +++++++++--------- 19 files changed, 141 insertions(+), 114 deletions(-) diff --git a/src/avt/DataBinning/CMakeLists.txt b/src/avt/DataBinning/CMakeLists.txt index 77b856e3767..91084192ca8 100644 --- a/src/avt/DataBinning/CMakeLists.txt +++ b/src/avt/DataBinning/CMakeLists.txt @@ -64,7 +64,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtdbin_par SOURCES ${avtdbin_SOURCES} HEADERS ${avtdbin_HEADERS} diff --git a/src/avt/Database/CMakeLists.txt b/src/avt/Database/CMakeLists.txt index e4758dee850..bd04a61c183 100644 --- a/src/avt/Database/CMakeLists.txt +++ b/src/avt/Database/CMakeLists.txt @@ -44,7 +44,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtdatabase_par SOURCES ${avtdatabase_par_SOURCES} HEADERS ${avtdatabase_par_HEADERS} diff --git a/src/avt/Expressions/CMakeLists.txt b/src/avt/Expressions/CMakeLists.txt index 6cc881ecc82..dd4dc5c2cd2 100644 --- a/src/avt/Expressions/CMakeLists.txt +++ b/src/avt/Expressions/CMakeLists.txt @@ -127,7 +127,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtexpressions_par SOURCES ${avtexpressions_par_SOURCES} HEADERS ${avtexpressions_par_HEADERS} diff --git a/src/avt/FileWriter/CMakeLists.txt b/src/avt/FileWriter/CMakeLists.txt index 55f6d96dfc8..16faf23b231 100644 --- a/src/avt/FileWriter/CMakeLists.txt +++ b/src/avt/FileWriter/CMakeLists.txt @@ -40,7 +40,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtwriter_par SOURCES ${avtwriter_SOURCES} HEADERS ${avtwriter_HEADERS} diff --git a/src/avt/Filters/CMakeLists.txt b/src/avt/Filters/CMakeLists.txt index 618786b6790..b0ff904d846 100644 --- a/src/avt/Filters/CMakeLists.txt +++ b/src/avt/Filters/CMakeLists.txt @@ -243,7 +243,8 @@ visit_add_library( if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtfilters_par SOURCES ${avtfilters_SOURCES} HEADERS ${avtfilters_HEADERS} diff --git a/src/avt/IVP/CMakeLists.txt b/src/avt/IVP/CMakeLists.txt index 48897b3badc..d48327860ac 100644 --- a/src/avt/IVP/CMakeLists.txt +++ b/src/avt/IVP/CMakeLists.txt @@ -143,7 +143,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtivp_par SOURCES ${avtivp_SOURCES} HEADERS ${avtivp_HEADERS} diff --git a/src/avt/MIR/CMakeLists.txt b/src/avt/MIR/CMakeLists.txt index cf41762a940..a5c5a2be114 100644 --- a/src/avt/MIR/CMakeLists.txt +++ b/src/avt/MIR/CMakeLists.txt @@ -37,7 +37,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtmir_par SOURCES ${avtmir_par_SOURCES} HEADERS ${avtmir_par_HEADERS} diff --git a/src/avt/Pipeline/CMakeLists.txt b/src/avt/Pipeline/CMakeLists.txt index df2e66a8f83..b75a124464b 100644 --- a/src/avt/Pipeline/CMakeLists.txt +++ b/src/avt/Pipeline/CMakeLists.txt @@ -117,7 +117,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtpipeline_par SOURCES ${avtpipeline_par_SOURCES} HEADERS ${avtpipeline_par_HEADERS} diff --git a/src/avt/Plotter/CMakeLists.txt b/src/avt/Plotter/CMakeLists.txt index 3a33ec18862..97cb6034a0e 100644 --- a/src/avt/Plotter/CMakeLists.txt +++ b/src/avt/Plotter/CMakeLists.txt @@ -200,7 +200,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALELL NAME avtplotter_par SOURCES ${avtplotter_par_SOURCES} HEADERS ${avtplotter_par_HEADERS} diff --git a/src/avt/PythonFilters/CMakeLists.txt b/src/avt/PythonFilters/CMakeLists.txt index b49e3103c1f..dbe09b180ed 100644 --- a/src/avt/PythonFilters/CMakeLists.txt +++ b/src/avt/PythonFilters/CMakeLists.txt @@ -50,17 +50,23 @@ visit_add_library( INCLUDES ${avtpythonfilters_INCLUDES} DEPENDS_ON ${avtpythonfilters_DEPENDS} avtpipeline_ser) - target_link_directories(avtpythonfilters_ser PUBLIC ${PYTHON_DIR}) + +visit_patch_target( + NAME avtpythonfilters_ser + LINKDIR ${PYTHON_DIR}) #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtpythonfilters_par SOURCES ${avtpythonfilters_SOURCES} HEADERS ${avtpythonfilters_HEADERS} INCLUDES ${avtpythonfilters_INCLUDES} DEPENDS_ON ${avtpythonfilters_DEPENDS} avtpipeline_par) - target_link_directories(avtpythonfilters_par PUBLIC ${PYTHON_DIR}) + visit_patch_target( + NAME avtpythonfilters_par + LINKDIR ${PYTHON_DIR}) endif() diff --git a/src/avt/QtVisWindow/vtk/CMakeLists.txt b/src/avt/QtVisWindow/vtk/CMakeLists.txt index 34b8e637098..377db3f261e 100644 --- a/src/avt/QtVisWindow/vtk/CMakeLists.txt +++ b/src/avt/QtVisWindow/vtk/CMakeLists.txt @@ -4,14 +4,18 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Utilize visit_patch_target. # #**************************************************************************** -target_sources(avtqtviswindow PRIVATE - vtkDashedXorGridMapper2D.C - vtkRubberBandMapper2D.C - vtkDashedXorGridMapper2D.h - vtkRubberBandMapper2D.h) +visit_patch_target( + NAME avtqtviswindow + SOURCES vtkDashedXorGridMapper2D.C + vtkRubberBandMapper2D.C + HEADERS vtkDashedXorGridMapper2D.h + vtkRubberBandMapper2D.h + INCLUDES $) if(NOT APPLE AND X11_FOUND) set_source_files_properties( @@ -19,6 +23,4 @@ if(NOT APPLE AND X11_FOUND) PROPERTIES COMPILE_FLAGS "-DHAVE_XLIB") endif() -target_include_directories(avtqtviswindow PRIVATE - $) diff --git a/src/avt/Queries/CMakeLists.txt b/src/avt/Queries/CMakeLists.txt index c9054b212f9..86ac89a2f54 100644 --- a/src/avt/Queries/CMakeLists.txt +++ b/src/avt/Queries/CMakeLists.txt @@ -81,7 +81,8 @@ visit_add_library( if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtquery_par SOURCES ${avtquery_par_SOURCES} HEADERS ${avtquery_par_HEADERS} @@ -90,10 +91,14 @@ if(VISIT_PARALLEL) avtexpressions_par avtfilters_par) if(VISIT_PYTHON_FILTERS) - target_link_libraries(avtquery_par PUBLIC avtpythonfilters_par) + visit_patch_target( + NAME avtquery_par + DEPENDS_ON avtpythonfilters_par) endif() if(CONDUIT_FOUND) - target_link_libraries(avtquery_par PUBLIC conduit_mpi) + visit_patch_target( + NAME avtquery_par + DEPENDS_ON conduit_mpi) endif() endif() diff --git a/src/avt/VisWindow/CMakeLists.txt b/src/avt/VisWindow/CMakeLists.txt index 7dfa38fae8b..a19fd3921ae 100644 --- a/src/avt/VisWindow/CMakeLists.txt +++ b/src/avt/VisWindow/CMakeLists.txt @@ -56,7 +56,8 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME avtviswindow_par SOURCES ${avtviswindow_par_SOURCES} HEADERS ${avtviswindow_par_HEADERS} diff --git a/src/engine/main/CMakeLists.txt b/src/engine/main/CMakeLists.txt index 28c1c49290c..268828464d5 100644 --- a/src/engine/main/CMakeLists.txt +++ b/src/engine/main/CMakeLists.txt @@ -128,10 +128,10 @@ visit_add_library( avtpipeline_ser) if(WIN32) - set_target_properties(engine_ser PROPERTIES OUTPUT_NAME enginelib_ser) + visit_patch_target(NAME engine_ser OUTPUT_NAME enginelib_ser) else() # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(engine_ser PRIVATE COMM_EXPORTS) + visit_patch_target(NAME engine_ser DEFINES COMM_EXPORTS) endif() @@ -154,7 +154,8 @@ if(VISIT_PARALLEL) endif() endif() - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME engine_par SOURCES ${LIBENGINE_SOURCES} ${ICET_SOURCES} @@ -173,19 +174,21 @@ if(VISIT_PARALLEL) cognomen) if(WIN32) - set_target_properties(engine_par PROPERTIES OUTPUT_NAME enginelib_par) + visit_patch_target(NAME engine_par OUTPUT_NAME enginelib_par) endif() if(ICET_FOUND) - target_include_directories(engine_par PUBLIC - $ - $) - target_link_directories(engine_par PUBLIC ${ICET_LIBRARY_DIR}) + visit_patch_target( + NAME engine_par + INCLUDES $ + $ + DEFINES HAVE_ICET + LINKDIR ${ICET_LIBRARY_DIR}) if(VISIT_MESAGL_DIR) - target_include_directories(engine_par PUBLIC - $) + visit_patch_target( + NAME engine_par + INCLUDES $) endif() - target_compile_definitions(engine_par PRIVATE HAVE_ICET) endif() endif() diff --git a/src/third_party_builtin/cognomen/CMakeLists.txt b/src/third_party_builtin/cognomen/CMakeLists.txt index 41127003e6e..431529f252f 100644 --- a/src/third_party_builtin/cognomen/CMakeLists.txt +++ b/src/third_party_builtin/cognomen/CMakeLists.txt @@ -8,7 +8,7 @@ # Make cognomen always build static lib on windows. # # Kathleen Biagas, Mon Oct 7, 2024 -# Utilize visit_add_parallel_library. +# Utilize visit_add_library. # #**************************************************************************** @@ -18,7 +18,8 @@ else() set(is_shared ${BUILD_SHARED_LIBS}) endif() -visit_add_parallel_library( +visit_add_library( + DO_PARALLEL NAME cognomen SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/cognomen.c HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/cognomen.h @@ -34,6 +35,6 @@ visit_add_parallel_library( FOLDER thirdparty_builtin/cognomen) if(WIN32) - target_link_libraries(cognomen PUBLIC ws2_32) + visit_patch_target(NAME cognomen DEPENDS_ON ws2_32) endif() diff --git a/src/viewer/core/CMakeLists.txt b/src/viewer/core/CMakeLists.txt index 6d957476e7b..568b85b4752 100644 --- a/src/viewer/core/CMakeLists.txt +++ b/src/viewer/core/CMakeLists.txt @@ -132,7 +132,7 @@ visit_add_library( if(NOT WIN32) # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(viewercore_ser PRIVATE COMM_EXPORTS) + visit_patch_target(NAME viewercore_ser DEFINES COMM_EXPORTS) endif() set_target_properties(viewercore_ser PROPERTIES HAS_CXX ON) @@ -143,7 +143,8 @@ set_target_properties(viewercore_ser PROPERTIES HAS_CXX ON) # We build a _par version of viewercore because we can't allow it to have any _ser # library dependencies when we use it in the simV2 parallel runtime. if(VISIT_PARALLEL) - visit_add_parallel_library( + visit_add_library( + DO_PARALLEL NAME viewercore_par SOURCES ${VIEWERCORE_SOURCES} HEADERS ${VIEWERCORE_HEADERS} @@ -160,7 +161,7 @@ if(VISIT_PARALLEL) if(NOT WIN32) # This keeps comm's exceptions visible when using -fvisibility=hidden - target_compile_definitions(viewercore_par PRIVATE COMM_EXPORTS) + visit_patch_target(NAME viewercore_par DEFINES COMM_EXPORTS) endif() endif() diff --git a/src/viewer/core/actions/CMakeLists.txt b/src/viewer/core/actions/CMakeLists.txt index 738d62f584e..a224d45249c 100644 --- a/src/viewer/core/actions/CMakeLists.txt +++ b/src/viewer/core/actions/CMakeLists.txt @@ -4,6 +4,8 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** @@ -39,22 +41,18 @@ set(VIEWERCORE_ACTION_HEADERS ViewActions.h WindowActions.h) -target_sources(viewercore_ser PRIVATE - ${VIEWERCORE_ACTION_SOURCES} - ${VIEWERCORE_ACTION_HEADERS}) - -blt_patch_target( +visit_patch_target( NAME viewercore_ser + SOURCES ${VIEWERCORE_ACTION_SOURCES} + HEADERS ${VIEWERCORE_ACTION_HEADERS} INCLUDES $ $) if(VISIT_PARALLEL) - target_sources(viewercore_par PRIVATE - ${VIEWERCORE_ACTION_SOURCES} - ${VIEWERCORE_ACTION_HEADERS}) - - blt_patch_target( + visit_patch_target( NAME viewercore_par + SOURCES ${VIEWERCORE_ACTION_SOURCES} + HEADERS ${VIEWERCORE_ACTION_HEADERS} INCLUDES $ $) endif() diff --git a/src/viewer/main/ddt/CMakeLists.txt b/src/viewer/main/ddt/CMakeLists.txt index 97411014437..f62c113cb51 100644 --- a/src/viewer/main/ddt/CMakeLists.txt +++ b/src/viewer/main/ddt/CMakeLists.txt @@ -4,21 +4,22 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** -target_sources(viewer PRIVATE - DDTActions.C - DDTActionsUI.C - DDTManager.C - DDTSession.C - DDTActions.h - DDTActionsUI.h - DDTManager.h - DDTSession.h) -blt_patch_target( +visit_patch_target( NAME viewer + SOURCES DDTActions.C + DDTActionsUI.C + DDTManager.C + DDTSession.C + HEADERS DDTActions.h + DDTActionsUI.h + DDTManager.h + DDTSession.h INCLUDES $ $) diff --git a/src/viewer/main/ui/CMakeLists.txt b/src/viewer/main/ui/CMakeLists.txt index 3f79c1c2727..c04d25dad64 100644 --- a/src/viewer/main/ui/CMakeLists.txt +++ b/src/viewer/main/ui/CMakeLists.txt @@ -4,64 +4,64 @@ #**************************************************************************** # Modifications: +# Kathleen Biagas, Thu Oct 24, 2024 +# Use visit_patch_target instead of blt_patch_target. # #**************************************************************************** -target_sources(viewer PRIVATE - AnimationActionsUI.C - LockActionsUI.C - PlotAndOperatorActionsUI.C - PrintWindowAction.C - SetAppearanceAction.C - ToolbarActionsUI.C - ViewActionsUI.C - ViewerActionManagerUI.C - ViewerActionUI.C - ViewerActionUIMultiple.C - ViewerActionUISingle.C - ViewerActionUIToggle.C - ViewerChangeUsernameUI.C - ViewerConnectionPrinterUI.C - ViewerConnectionProgressDialog.C - ViewerFactoryUI.C - ViewerHostProfileSelectorWithWin.C - ViewerMessagingUI.C - ViewerPasswordWindow.C - ViewerPopupMenu.C - ViewerToolbar.C - ViewerWindowUI.C - VisItChangeUsernameWindow.C - VisItPasswordWindow.C - WindowActionsUI.C - AnimationActionsUI.h - ClientActionsUI.h - LockActionsUI.h - PlotAndOperatorActionsUI.h - PrintWindowAction.h - SetAppearanceAction.h - ToolbarActionsUI.h - ViewActionsUI.h - ViewerActionManagerUI.h - ViewerActionUI.h - ViewerActionUIMultiple.h - ViewerActionUISingle.h - ViewerActionUIToggle.h - ViewerChangeUsernameUI.h - ViewerConnectionPrinterUI.h - ViewerConnectionProgressDialog.h - ViewerFactoryUI.h - ViewerHostProfileSelectorWithWin.h - ViewerMessagingUI.h - ViewerPasswordWindow.h - ViewerPopupMenu.h - ViewerToolbar.h - ViewerWindowUI.h - VisItChangeUsernameWindow.h - VisItPasswordWindow.h - WindowActionsUI.h) - -blt_patch_target( +visit_patch_target( NAME viewer + SOURCES AnimationActionsUI.C + LockActionsUI.C + PlotAndOperatorActionsUI.C + PrintWindowAction.C + SetAppearanceAction.C + ToolbarActionsUI.C + ViewActionsUI.C + ViewerActionManagerUI.C + ViewerActionUI.C + ViewerActionUIMultiple.C + ViewerActionUISingle.C + ViewerActionUIToggle.C + ViewerChangeUsernameUI.C + ViewerConnectionPrinterUI.C + ViewerConnectionProgressDialog.C + ViewerFactoryUI.C + ViewerHostProfileSelectorWithWin.C + ViewerMessagingUI.C + ViewerPasswordWindow.C + ViewerPopupMenu.C + ViewerToolbar.C + ViewerWindowUI.C + VisItChangeUsernameWindow.C + VisItPasswordWindow.C + WindowActionsUI.C + HEADERS AnimationActionsUI.h + ClientActionsUI.h + LockActionsUI.h + PlotAndOperatorActionsUI.h + PrintWindowAction.h + SetAppearanceAction.h + ToolbarActionsUI.h + ViewActionsUI.h + ViewerActionManagerUI.h + ViewerActionUI.h + ViewerActionUIMultiple.h + ViewerActionUISingle.h + ViewerActionUIToggle.h + ViewerChangeUsernameUI.h + ViewerConnectionPrinterUI.h + ViewerConnectionProgressDialog.h + ViewerFactoryUI.h + ViewerHostProfileSelectorWithWin.h + ViewerMessagingUI.h + ViewerPasswordWindow.h + ViewerPopupMenu.h + ViewerToolbar.h + ViewerWindowUI.h + VisItChangeUsernameWindow.h + VisItPasswordWindow.h + WindowActionsUI.h INCLUDES $ $) From 1de29f8a2c417094fd15d651821069b5caf647ac Mon Sep 17 00:00:00 2001 From: biagas Date: Wed, 30 Oct 2024 12:30:29 -0700 Subject: [PATCH 4/8] Update parallel target handling to fix issues on Linux. --- src/CMake/PluginVsInstallHelpers.cmake | 10 +-- src/CMake/VisItMacros.cmake | 67 ++++++++-------- src/CMake/VisItParallel.cmake | 79 +++++++++---------- src/avt/Plotter/CMakeLists.txt | 3 +- src/engine/main/CMakeLists.txt | 10 ++- .../Simulations/CMakeLists.txt | 3 + src/visitpy/mpicom/CMakeLists.txt | 2 +- 7 files changed, 93 insertions(+), 81 deletions(-) diff --git a/src/CMake/PluginVsInstallHelpers.cmake b/src/CMake/PluginVsInstallHelpers.cmake index e11217648b8..2a4a6c1ccdb 100644 --- a/src/CMake/PluginVsInstallHelpers.cmake +++ b/src/CMake/PluginVsInstallHelpers.cmake @@ -274,17 +274,17 @@ if(VISIT_MPICH_INSTALL) "${f0_VISIT_PARALLEL_INCLUDE}") string(REPLACE "${VISIT_MPICH_DIR}/lib" "\${VISIT_LIBRARY_DIR}" - f0_VISIT_PARALLEL_DEFS - "${VISIT_PARALLEL_DEFS}") + f0_VISIT_PARALLEL_DEFINES + "${VISIT_PARALLEL_DEFINES}") string(REPLACE "${VISIT_MPICH_DIR}/include" "\${VISIT_ROOT_INCLUDE_DIR}/mpich/include" - filtered_VISIT_PARALLEL_DEFS - "${f0_VISIT_PARALLEL_DEFS}") + filtered_VISIT_PARALLEL_DEFINES + "${f0_VISIT_PARALLEL_DEFINES}") else(VISIT_MPICH_INSTALL) set(filtered_VISIT_PARALLEL_CXXFLAGS "${VISIT_PARALLEL_CXXFLAGS}") set(filtered_VISIT_PARALLEL_LINKER_FLAGS "${VISIT_PARALLEL_LINKER_FLAGS}") set(filtered_VISIT_PARALLEL_LIBS "${VISIT_PARALLEL_LIBS}") set(filtered_VISIT_PARALLEL_INCLUDE "${VISIT_PARALLEL_INCLUDE}") - set(filtered_VISIT_PARALLEL_DEFS "${VISIT_PARALLEL_DEFS}") + set(filtered_VISIT_PARALLEL_DEFINES "${VISIT_PARALLEL_DEFINES}") endif(VISIT_MPICH_INSTALL) # Fix some third-party include paths that are different on windows than unix. diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index 63e229b8522..9ca0952003d 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -77,7 +77,7 @@ function(ADD_PARALLEL_LIBRARY target) else() ADD_TARGET_INCLUDE(${target} ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFS}) + ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFINES}) endif() if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) target_link_libraries(${target} ${VISIT_PARALLEL_LIBS}) @@ -256,8 +256,17 @@ endmacro() ############################################################################## # patch a target with new sources, headers, etc: +# # Any non-visit-specific args are passed directly to blt_patch_target. # +# The visit-specific args must appear first in the caller argument list +# before blt-specific, otherwise blt swallows them up with one of the args it +# does understand, causing issues. +# +# I tried to parse only the args visit needs, then use the _UNPARSED_ARGUMENTS +# feature to pass the rest to blt, but _UNPARSED_ARGUMENTS never contained +# the correct arguments, possibly due to the parsing order ? +# # ARGUMENTS: # NAME target name REQUIRED # @@ -272,36 +281,30 @@ endmacro() # INCLUDES [dir1 [dir2 ...]] OPTIONAL # DEFINES [define1 [define2 ...]] OPTIONAL # DEPENDS_ON [dep1 ...] OPTIONAL -# LIBRARIES [lib1 [lib2 ...]] OPTIONAL -# COMPILE_FLAGS [flag1 [flag2 ..]] OPTIONAL -# LINK_FLAGS [flag1 [flag2 ..]] OPTIONAL # ############################################################################## macro(visit_patch_target) + # need to parse everything that VisIt recognizes and everything that + # BLT recognizes, otherwise there ends up being issues. set(singleValueArgs NAME) - set(multiValueArgs SOURCES HEADERS LINKDIR) - + set(multiValueArgs SOURCES HEADERS LINKDIR INCLUDES DEFINES DEPENDS_ON) # parse the arguments cmake_parse_arguments(vpt "" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) if(NOT vpt_NAME) message(FATAL_ERROR "visit_patch_target() must be called with argument NAME ") endif() - - if (vpt_SOURCES) - target_sources(${vpt_NAME} PRIVATE ${vpt_SOURCES}) + if(NOT TARGET ${vpt_NAME}) + message(FATAL_ERROR " attempting to patch ${vpt_NAME} but it is NOT a target!") endif() - if (vpt_HEADERS) - target_sources(${vpt_NAME} PRIVATE ${vpt_HEADERS}) + if (vpt_SOURCES OR vpt_HEADERS) + target_sources(${vpt_NAME} PRIVATE ${vpt_SOURCES} ${vpt_HEADERS}) endif() - if (vpt_lINKDIR) + if (vpt_LINKDIR) target_link_directories(${vpt_NAME} PRIVATE ${vpt_LINKDIR}) endif() - - if(vpt_UNUSED_ARUGMENTS) - blt_patch_target(NAME ${vpt_NAME} ${vpt_UNUSED_ARGUMENTS}) - endif() + blt_patch_target(${ARGV}) endmacro() @@ -314,7 +317,7 @@ endmacro() # ############################################################################## -function(visit_patch_parallel_target) +macro(visit_patch_parallel_target) cmake_parse_arguments(vppt "" "NAME" "" ${ARGN}) if(NOT vppt_NAME) @@ -323,14 +326,12 @@ function(visit_patch_parallel_target) if(UNIX) if(VISIT_PARALLEL_CXXFLAGS) - string(REPLACE " " ";" PAR_COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) set_property(TARGET ${vppt_NAME} APPEND - PROPERTY COMPILE_FLAGS ${PAR_COMPILE_FLAGS}) + PROPERTY COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) endif() - if(VISIT_PARALLEL_LINKER_FLAGS) - string(REPLACE " " ";" PAR_LINK_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + if(VISIT_PARALLEL_LINK_FLAGS) set_property(TARGET ${vppt_NAME} APPEND - PROPERTY LINK_FLAGS ${PAR_LINK_FLAGS}) + PROPERTY LINK_FLAGS ${VISIT_PARALLEL_LINK_FLAGS}) endif() if(${CMAKE_INSTALL_RPATH}) @@ -340,29 +341,32 @@ function(visit_patch_parallel_target) endif() if(VISIT_PARALLEL_RPATH) - string(REPLACE " " ";" VPAR_RPATHS ${VISIT_PARALLEL_RPATH}) set_property(TARGET ${vppt_NAME} APPEND PROPERTY - INSTALL_RPATH ${VPAR_RPATHS}) + INSTALL_RPATH ${VISIT_PARALLEL_RPATH}) + endif() + if(VISIT_PARALLEL_DEFINES) + visit_patch_target( + NAME ${vppt_NAME} + DEFINES ${VISIT_PARALLEL_DEFINES}) + endif() - visit_patch_target( - NAME ${vppt_NAME} - DEFINES ${VISIT_PARALLEL_DEFS}) else() visit_patch_target( NAME ${vppt_NAME} INCLUDES ${VISIT_PARALLEL_INCLUDE} - DEFINES ${VISIT_PARALLEL_DEFS}) + DEFINES ${VISIT_PARALLEL_DEFINES}) endif() - if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES) + if(NOT VISIT_NOLINK_MPI_WITH_LIBRARIES AND VISIT_PARALLEL_LIBS) visit_patch_target( NAME ${vppt_NAME} + LINKDIR ${VISIT_PARALLEL_LINK_DIRS} DEPENDS_ON ${VISIT_PARALLEL_LIBS}) endif() -endfunction() +endmacro() ############################################################################## # Adds a library target. -# calls blt_add_library +# calls blt_add_library # handles parallel # clears cache vars. # @@ -399,7 +403,6 @@ macro(visit_add_library) if(NOT val_NAME) message(FATAL_ERROR "visit_add_library() must be called with argument NAME ") endif() - if (NOT val_SOURCES AND NOT val_HEADERS) message(FATAL_ERROR "visit_add_library(NAME ${val_NAME} ...) called with no given sources or headers (at least one is required).") endif() diff --git a/src/CMake/VisItParallel.cmake b/src/CMake/VisItParallel.cmake index 2665c2271e8..ef5b04ee5e2 100644 --- a/src/CMake/VisItParallel.cmake +++ b/src/CMake/VisItParallel.cmake @@ -3,7 +3,7 @@ # details. No copyright assignment is required to contribute to VisIt. -function(DETECT_MPI_SETTINGS COMP mlibs mdefs mflags mlflags mrpath) +function(DETECT_MPI_SETTINGS COMP mlibs mflags mlflags mrpath) # Unset any variables that may have been set before by FindMPI unset(MPI_FOUND CACHE) unset(MPI_INCLUDE_PATH CACHE) @@ -31,7 +31,6 @@ function(DETECT_MPI_SETTINGS COMP mlibs mdefs mflags mlflags mrpath) endforeach() set(${mlibs} ${MPI_LIBRARIES} CACHE STRING "MPI libraries") - set(${mdefs} "PARALLEL MPICH_IGNORE_CXX_SEEK" CACHE STRING "Parallel compiler defines") set(${mflags} "${MPI_INCLUDE_PATH_CONV} ${MPI_COMPILE_FLAGS}" CACHE STRING "Parallel compiler flags") set(${mlflags} "${MPI_LINK_FLAGS}" CACHE STRING "Parallel linker flags") @@ -60,41 +59,28 @@ function(ADD_PARALLEL_EXECUTABLE target) if(UNIX) if(VISIT_PARALLEL_CXXFLAGS) - set(PAR_COMPILE_FLAGS "") - foreach(X ${VISIT_PARALLEL_CXXFLAGS}) - set(PAR_COMPILE_FLAGS "${PAR_COMPILE_FLAGS} ${X}") - endforeach() set_target_properties(${target} PROPERTIES - COMPILE_FLAGS ${PAR_COMPILE_FLAGS} - ) + COMPILE_FLAGS ${VISIT_PARALLEL_CXXFLAGS}) + endif() + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) - if(VISIT_PARALLEL_LINKER_FLAGS) - set(PAR_LINK_FLAGS "") - foreach(X ${VISIT_PARALLEL_LINKER_FLAGS}) - set(PAR_LINK_FLAGS "${PAR_LINK_FLAGS} ${X}") - endforeach() - set_target_properties(${target} PROPERTIES - LINK_FLAGS ${PAR_LINK_FLAGS} - ) - endif() + if(VISIT_PARALLEL_LINK_FLAGS) + set_target_properties(${target} PROPERTIES + LINK_FLAGS ${VISIT_PARALLEL_LINK_FLAGS}) + endif() + if(VISIT_PARALLEL_LINK_DIRS) + set_target_properties(${target} PROPERTIES + LINK_DIRECTORIES ${VISIT_PARALLEL_LINK_DIRS}) + endif() - if(VISIT_PARALLEL_RPATH) - set(PAR_RPATHS "") - foreach(X ${CMAKE_INSTALL_RPATH}) - set(PAR_RPATHS "${PAR_RPATHS} ${X}") - endforeach() - foreach(X ${VISIT_PARALLEL_RPATH}) - set(PAR_RPATHS "${PAR_RPATHS} ${X}") - endforeach() - set_target_properties(${target} PROPERTIES - INSTALL_RPATH ${PAR_RPATHS} - ) - endif() + if(VISIT_PARALLEL_RPATH) + set_target_properties(${target} PROPERTIES + INSTALL_RPATH "${VISIT_PARALLEL_RPATH};${CMAKE_INSTALL_RPATH}") endif() else() - ADD_TARGET_INCLUDE(${target} ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(${target} ${VISIT_PARALLEL_DEFS}) - target_link_libraries(${target} ${VISIT_PARALLEL_LIBS}) + target_include_directories(${target} PRIVATE ${VISIT_PARALLEL_INCLUDE}) + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) + target_link_libraries(${target} PRIVATE ${VISIT_PARALLEL_LINK_LIBS}) endif() # If we're on doing this "nolink mpi" option, we rely on the @@ -113,8 +99,8 @@ function(ADD_PARALLEL_FORTRAN_EXECUTABLE target) set(PAR_COMPILE_FLAGS "${PAR_COMPILE_FLAGS} ${X}") endforeach() set_target_properties(${target} PROPERTIES - COMPILE_FLAGS ${PAR_COMPILE_FLAGS} - ) + COMPILE_FLAGS ${PAR_COMPILE_FLAGS}) + target_compile_definitions(${target} PRIVATE ${VISIT_PARALLEL_DEFINES}) if(VISIT_PARALLEL_FORTRAN_LINKER_FLAGS) set(PAR_LINK_FLAGS "") @@ -154,7 +140,7 @@ function(PARALLEL_EXECUTABLE_LINK_LIBRARIES target) endfunction() -set(VPDEFS "PARALLEL MPICH_IGNORE_CXX_SEEK MPICH_SKIP_MPICXX OMPI_SKIP_MPICXX MPI_NO_CPPBIND") +set(VISIT_PARALLEL_DEFINES "PARALLEL;MPICH_IGNORE_CXX_SEEK;MPICH_SKIP_MPICXX;OMPI_SKIP_MPICXX;MPI_NO_CPPBIND" CACHE STRING "Parallel compiler defines") if(VISIT_MPI_COMPILER) message(STATUS "Setting up MPI using compiler wrapper") @@ -162,7 +148,6 @@ if(VISIT_MPI_COMPILER) # Detect the MPI settings that C++ wants DETECT_MPI_SETTINGS(${VISIT_MPI_COMPILER} VISIT_PARALLEL_LIBS - VISIT_PARALLEL_DEFS VISIT_PARALLEL_CFLAGS VISIT_PARALLEL_LINKER_FLAGS VISIT_PARALLEL_RPATH) @@ -228,7 +213,6 @@ else() if(NOT MPI_FOUND) include(${CMAKE_ROOT}/Modules/FindMPI.cmake) if(MPI_FOUND) - string(REPLACE " " ";" VISIT_PARALLEL_DEFS ${VPDEFS}) set(VISIT_PARALLEL_LIBS "${MPI_LIBRARY}" CACHE STRING "MPI libraries") set(VISIT_PARALLEL_INCLUDE "${MPI_INCLUDE_PATH}" @@ -263,17 +247,32 @@ else() endif() endif() - unset(VPFLAGS) endif() +string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) +string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) +string(REPLACE " " ";" VISIT_PARALLEL_RPATH ${VISIT_PARALLEL_RPATH}) + +# Separate link dirs from other flags +foreach(plf ${VISIT_PARALLEL_LINKER_FLAGS}) + string(SUBSTRING ${plf} 0 2 lf_type) + if(lf_type STREQUAL "-L") + string(SUBSTRING ${plf} 2 -1 lf_dir) + list(APPEND VISIT_PARALLEL_LINK_DIRS ${lf_dir}) + else() + list(APPEND VISIT_PARALLEL_LINK_FLAGS ${plf}) + endif() +endforeach() + message(STATUS "Parallel version of VisIt") message(STATUS " VISIT_PARALLEL_CFLAGS = ${VISIT_PARALLEL_CFLAGS}") message(STATUS " VISIT_PARALLEL_CXXFLAGS = ${VISIT_PARALLEL_CXXFLAGS}") -message(STATUS " VISIT_PARALLEL_LINKER_FLAGS = ${VISIT_PARALLEL_LINKER_FLAGS}") +message(STATUS " VISIT_PARALLEL_LINK_FLAGS = ${VISIT_PARALLEL_LINK_FLAGS}") +message(STATUS " VISIT_PARALLEL_LINK_DIRS = ${VISIT_PARALLEL_LINK_DIRS}") message(STATUS " VISIT_PARALLEL_LIBS = ${VISIT_PARALLEL_LIBS}") message(STATUS " VISIT_PARALLEL_RPATH = ${VISIT_PARALLEL_RPATH}") -message(STATUS " VISIT_PARALLEL_DEFS = ${VISIT_PARALLEL_DEFS}") +message(STATUS " VISIT_PARALLEL_DEFINES = ${VISIT_PARALLEL_DEFINES}") message(STATUS " VISIT_PARALLEL_INCLUDE = ${VISIT_PARALLEL_INCLUDE}") if(VISIT_FORTRAN AND VISIT_PARALLEL_FORTRAN_LIBS) diff --git a/src/avt/Plotter/CMakeLists.txt b/src/avt/Plotter/CMakeLists.txt index 97cb6034a0e..e2832c6a8f0 100644 --- a/src/avt/Plotter/CMakeLists.txt +++ b/src/avt/Plotter/CMakeLists.txt @@ -200,8 +200,9 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) +message("adding avtplotter_par") visit_add_library( - DO_PARALELL + DO_PARALLEL NAME avtplotter_par SOURCES ${avtplotter_par_SOURCES} HEADERS ${avtplotter_par_HEADERS} diff --git a/src/engine/main/CMakeLists.txt b/src/engine/main/CMakeLists.txt index 268828464d5..8fba1ec67a5 100644 --- a/src/engine/main/CMakeLists.txt +++ b/src/engine/main/CMakeLists.txt @@ -175,15 +175,18 @@ if(VISIT_PARALLEL) if(WIN32) visit_patch_target(NAME engine_par OUTPUT_NAME enginelib_par) + else() + # This keeps comm's exceptions visible when using -fvisibility=hidden + visit_patch_target(NAME engine_par DEFINES COMM_EXPORTS) endif() if(ICET_FOUND) visit_patch_target( NAME engine_par + LINKDIR ${ICET_LIBRARY_DIR} INCLUDES $ $ - DEFINES HAVE_ICET - LINKDIR ${ICET_LIBRARY_DIR}) + DEFINES HAVE_ICET) if(VISIT_MESAGL_DIR) visit_patch_target( NAME engine_par @@ -283,6 +286,9 @@ if(VISIT_PARALLEL) ${ZLIB_LIBRARY} ) + if(ICET_FOUND) + target_link_directories(engine_par_exe PRIVATE ${ICET_LIBRARY_DIR}) + endif() # If we're building statically then the engine can't be linked until the plugin # sources are built if(VISIT_STATIC) diff --git a/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt b/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt index a358309191a..ec2ea8b4359 100644 --- a/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt +++ b/src/tools/data/DataManualExamples/Simulations/CMakeLists.txt @@ -152,6 +152,9 @@ FUNCTION(ADD_PARALLEL_SIMV2_SIMULATION target) ${EXTRA_SIM_LIBS}) ENDIF() ADD_TARGET_INCLUDE(sim_${target} ${VISIT_SOURCE_DIR}/sim/V2/lib) + if(ICET_FOUND) + target_link_directories(sim_${target} PRIVATE ${ICET_LIBRARY_DIR}) + endif() IF(BLUEGENEQ) SET(VISIT_NOLINK_MPI_WITH_LIBRARIES ${TMP_NOLINK}) ENDIF(BLUEGENEQ) diff --git a/src/visitpy/mpicom/CMakeLists.txt b/src/visitpy/mpicom/CMakeLists.txt index 3566e0deaff..84318eac479 100644 --- a/src/visitpy/mpicom/CMakeLists.txt +++ b/src/visitpy/mpicom/CMakeLists.txt @@ -65,7 +65,7 @@ IF(VISIT_PARALLEL) ENDIF(VISIT_PARALLEL_LINKER_FLAGS) ELSE(UNIX) ADD_TARGET_INCLUDE(mpicom ${VISIT_PARALLEL_INCLUDE}) - ADD_TARGET_DEFINITIONS(mpicom ${VISIT_PARALLEL_DEFS}) + ADD_TARGET_DEFINITIONS(mpicom ${VISIT_PARALLEL_DEFINES}) ENDIF(UNIX) TARGET_LINK_LIBRARIES(mpicom From 956b2a2fe804f2f9aceeb6fa447205a2efec0e94 Mon Sep 17 00:00:00 2001 From: biagas Date: Wed, 30 Oct 2024 15:37:19 -0700 Subject: [PATCH 5/8] Re-add visit_add_parallel_library, but in simplified form. It now calls visit_add_library, then visit_patch_parallel_target. --- src/CMake/VisItMacros.cmake | 16 +++++++++------- src/avt/DataBinning/CMakeLists.txt | 3 +-- src/avt/Database/CMakeLists.txt | 3 +-- src/avt/Expressions/CMakeLists.txt | 3 +-- src/avt/FileWriter/CMakeLists.txt | 3 +-- src/avt/Filters/CMakeLists.txt | 3 +-- src/avt/IVP/CMakeLists.txt | 3 +-- src/avt/MIR/CMakeLists.txt | 3 +-- src/avt/Pipeline/CMakeLists.txt | 3 +-- src/avt/Plotter/CMakeLists.txt | 4 +--- src/avt/PythonFilters/CMakeLists.txt | 3 +-- src/avt/Queries/CMakeLists.txt | 3 +-- src/avt/VisWindow/CMakeLists.txt | 3 +-- src/engine/main/CMakeLists.txt | 3 +-- src/third_party_builtin/cognomen/CMakeLists.txt | 3 +-- src/viewer/core/CMakeLists.txt | 3 +-- 16 files changed, 24 insertions(+), 38 deletions(-) diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index 9ca0952003d..d07d7428ceb 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -381,17 +381,15 @@ endmacro() # FEATURES [feat1 [feat2 ...]] OPTIONAL # FOLDER [name] OPTIONAL # SKIP_INSTALL OPTIONAL (visit only) -# DO_PARALLEL OPTIONAL (visit only) # # Modifications: # Kathleen Biags, Thu Oct 24, 2024 -# Added DO_PARALLEL so that we can use 1 macro for adding libraries # Added SKIP_INSTALL to indicate the target should not be installed. # ############################################################################## macro(visit_add_library) - set(options SKIP_INSTALL DO_PARALLEL) + set(options SKIP_INSTALL) set(singleValueArgs NAME OUTPUT_NAME FOLDER) set(multiValueArgs SOURCES HEADERS INCLUDES DEFINES DEPENDS_ON FEATURES) @@ -426,10 +424,6 @@ macro(visit_add_library) visit_install_export_targets(${val_NAME}) endif() - if(${val_DO_PARALLEL}) - visit_patch_parallel_target(NAME ${val_NAME}) - endif() - # vars that may have been created by calls to visit_append_list unset(${val_NAME}_SOURCES CACHE) unset(${val_NAME}_HEADERS CACHE) @@ -439,3 +433,11 @@ macro(visit_add_library) unset(${val_NAME}_FEATURES CACHE) endmacro() +macro(visit_add_parallel_library) + + visit_add_library(${ARGV}) + cmake_parse_arguments(vapl "" "NAME" "" ${ARGN}) + visit_patch_parallel_target(NAME ${vapl_NAME}) + +endmacro() + diff --git a/src/avt/DataBinning/CMakeLists.txt b/src/avt/DataBinning/CMakeLists.txt index 91084192ca8..77b856e3767 100644 --- a/src/avt/DataBinning/CMakeLists.txt +++ b/src/avt/DataBinning/CMakeLists.txt @@ -64,8 +64,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtdbin_par SOURCES ${avtdbin_SOURCES} HEADERS ${avtdbin_HEADERS} diff --git a/src/avt/Database/CMakeLists.txt b/src/avt/Database/CMakeLists.txt index bd04a61c183..e4758dee850 100644 --- a/src/avt/Database/CMakeLists.txt +++ b/src/avt/Database/CMakeLists.txt @@ -44,8 +44,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtdatabase_par SOURCES ${avtdatabase_par_SOURCES} HEADERS ${avtdatabase_par_HEADERS} diff --git a/src/avt/Expressions/CMakeLists.txt b/src/avt/Expressions/CMakeLists.txt index dd4dc5c2cd2..6cc881ecc82 100644 --- a/src/avt/Expressions/CMakeLists.txt +++ b/src/avt/Expressions/CMakeLists.txt @@ -127,8 +127,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtexpressions_par SOURCES ${avtexpressions_par_SOURCES} HEADERS ${avtexpressions_par_HEADERS} diff --git a/src/avt/FileWriter/CMakeLists.txt b/src/avt/FileWriter/CMakeLists.txt index 16faf23b231..55f6d96dfc8 100644 --- a/src/avt/FileWriter/CMakeLists.txt +++ b/src/avt/FileWriter/CMakeLists.txt @@ -40,8 +40,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtwriter_par SOURCES ${avtwriter_SOURCES} HEADERS ${avtwriter_HEADERS} diff --git a/src/avt/Filters/CMakeLists.txt b/src/avt/Filters/CMakeLists.txt index b0ff904d846..618786b6790 100644 --- a/src/avt/Filters/CMakeLists.txt +++ b/src/avt/Filters/CMakeLists.txt @@ -243,8 +243,7 @@ visit_add_library( if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtfilters_par SOURCES ${avtfilters_SOURCES} HEADERS ${avtfilters_HEADERS} diff --git a/src/avt/IVP/CMakeLists.txt b/src/avt/IVP/CMakeLists.txt index d48327860ac..48897b3badc 100644 --- a/src/avt/IVP/CMakeLists.txt +++ b/src/avt/IVP/CMakeLists.txt @@ -143,8 +143,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtivp_par SOURCES ${avtivp_SOURCES} HEADERS ${avtivp_HEADERS} diff --git a/src/avt/MIR/CMakeLists.txt b/src/avt/MIR/CMakeLists.txt index a5c5a2be114..cf41762a940 100644 --- a/src/avt/MIR/CMakeLists.txt +++ b/src/avt/MIR/CMakeLists.txt @@ -37,8 +37,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtmir_par SOURCES ${avtmir_par_SOURCES} HEADERS ${avtmir_par_HEADERS} diff --git a/src/avt/Pipeline/CMakeLists.txt b/src/avt/Pipeline/CMakeLists.txt index b75a124464b..df2e66a8f83 100644 --- a/src/avt/Pipeline/CMakeLists.txt +++ b/src/avt/Pipeline/CMakeLists.txt @@ -117,8 +117,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtpipeline_par SOURCES ${avtpipeline_par_SOURCES} HEADERS ${avtpipeline_par_HEADERS} diff --git a/src/avt/Plotter/CMakeLists.txt b/src/avt/Plotter/CMakeLists.txt index e2832c6a8f0..3a33ec18862 100644 --- a/src/avt/Plotter/CMakeLists.txt +++ b/src/avt/Plotter/CMakeLists.txt @@ -200,9 +200,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) -message("adding avtplotter_par") - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtplotter_par SOURCES ${avtplotter_par_SOURCES} HEADERS ${avtplotter_par_HEADERS} diff --git a/src/avt/PythonFilters/CMakeLists.txt b/src/avt/PythonFilters/CMakeLists.txt index dbe09b180ed..81cc25534bd 100644 --- a/src/avt/PythonFilters/CMakeLists.txt +++ b/src/avt/PythonFilters/CMakeLists.txt @@ -57,8 +57,7 @@ visit_patch_target( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtpythonfilters_par SOURCES ${avtpythonfilters_SOURCES} HEADERS ${avtpythonfilters_HEADERS} diff --git a/src/avt/Queries/CMakeLists.txt b/src/avt/Queries/CMakeLists.txt index 86ac89a2f54..62cdebab69c 100644 --- a/src/avt/Queries/CMakeLists.txt +++ b/src/avt/Queries/CMakeLists.txt @@ -81,8 +81,7 @@ visit_add_library( if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtquery_par SOURCES ${avtquery_par_SOURCES} HEADERS ${avtquery_par_HEADERS} diff --git a/src/avt/VisWindow/CMakeLists.txt b/src/avt/VisWindow/CMakeLists.txt index a19fd3921ae..7dfa38fae8b 100644 --- a/src/avt/VisWindow/CMakeLists.txt +++ b/src/avt/VisWindow/CMakeLists.txt @@ -56,8 +56,7 @@ visit_add_library( #********************************* PARALLEL ********************************** if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME avtviswindow_par SOURCES ${avtviswindow_par_SOURCES} HEADERS ${avtviswindow_par_HEADERS} diff --git a/src/engine/main/CMakeLists.txt b/src/engine/main/CMakeLists.txt index 8fba1ec67a5..e20a8ed9610 100644 --- a/src/engine/main/CMakeLists.txt +++ b/src/engine/main/CMakeLists.txt @@ -154,8 +154,7 @@ if(VISIT_PARALLEL) endif() endif() - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME engine_par SOURCES ${LIBENGINE_SOURCES} ${ICET_SOURCES} diff --git a/src/third_party_builtin/cognomen/CMakeLists.txt b/src/third_party_builtin/cognomen/CMakeLists.txt index 431529f252f..623a272ea25 100644 --- a/src/third_party_builtin/cognomen/CMakeLists.txt +++ b/src/third_party_builtin/cognomen/CMakeLists.txt @@ -18,8 +18,7 @@ else() set(is_shared ${BUILD_SHARED_LIBS}) endif() -visit_add_library( - DO_PARALLEL +visit_add_parallel_library( NAME cognomen SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/cognomen.c HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/cognomen.h diff --git a/src/viewer/core/CMakeLists.txt b/src/viewer/core/CMakeLists.txt index 568b85b4752..b4b8eb6ab4c 100644 --- a/src/viewer/core/CMakeLists.txt +++ b/src/viewer/core/CMakeLists.txt @@ -143,8 +143,7 @@ set_target_properties(viewercore_ser PROPERTIES HAS_CXX ON) # We build a _par version of viewercore because we can't allow it to have any _ser # library dependencies when we use it in the simV2 parallel runtime. if(VISIT_PARALLEL) - visit_add_library( - DO_PARALLEL + visit_add_parallel_library( NAME viewercore_par SOURCES ${VIEWERCORE_SOURCES} HEADERS ${VIEWERCORE_HEADERS} From aaa15579366d752fbfad33d8adc55dff87320033 Mon Sep 17 00:00:00 2001 From: biagas Date: Thu, 31 Oct 2024 09:00:32 -0700 Subject: [PATCH 6/8] Fix configure error when attempting string-replace on a CMake var that didn't exist. --- src/CMake/VisItParallel.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/CMake/VisItParallel.cmake b/src/CMake/VisItParallel.cmake index ef5b04ee5e2..2e7ade6f1af 100644 --- a/src/CMake/VisItParallel.cmake +++ b/src/CMake/VisItParallel.cmake @@ -249,9 +249,16 @@ else() endif() endif() -string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) -string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) -string(REPLACE " " ";" VISIT_PARALLEL_RPATH ${VISIT_PARALLEL_RPATH}) +# prepare these for direct use in cmake calls +if(VISIT_PARALLEL_CXXFLAGS) + string(REPLACE " " ";" VISIT_PARALLEL_CXXFLAGS ${VISIT_PARALLEL_CXXFLAGS}) +endif() +if(VISIT_PARALLEL_LINKER_FLAGS) + string(REPLACE " " ";" VISIT_PARALLEL_LINKER_FLAGS ${VISIT_PARALLEL_LINKER_FLAGS}) +endif() +if(VISIT_PARALLEL_RPATH) + string(REPLACE " " ";" VISIT_PARALLEL_RPATH ${VISIT_PARALLEL_RPATH}) +endif() # Separate link dirs from other flags foreach(plf ${VISIT_PARALLEL_LINKER_FLAGS}) From 5412cf49c2a6d2f053d25c0283531719eb8af724 Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Mon, 4 Nov 2024 15:17:07 -0800 Subject: [PATCH 7/8] Update comments for visit_patch_target. --- src/CMake/VisItMacros.cmake | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index d07d7428ceb..26ccc0aa6db 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -257,16 +257,13 @@ endmacro() ############################################################################## # patch a target with new sources, headers, etc: # -# Any non-visit-specific args are passed directly to blt_patch_target. +# After visit-specific args are parsed and handled, +# all args are passed directly to blt_patch_target. # # The visit-specific args must appear first in the caller argument list # before blt-specific, otherwise blt swallows them up with one of the args it # does understand, causing issues. # -# I tried to parse only the args visit needs, then use the _UNPARSED_ARGUMENTS -# feature to pass the rest to blt, but _UNPARSED_ARGUMENTS never contained -# the correct arguments, possibly due to the parsing order ? -# # ARGUMENTS: # NAME target name REQUIRED # From be9e19427d7ffa78c317f01167c986f7fd43e307 Mon Sep 17 00:00:00 2001 From: Kathleen Biagas Date: Wed, 13 Nov 2024 15:16:09 -0800 Subject: [PATCH 8/8] Fix comments. --- src/CMake/VisItMacros.cmake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/CMake/VisItMacros.cmake b/src/CMake/VisItMacros.cmake index 26ccc0aa6db..d91f7287e52 100644 --- a/src/CMake/VisItMacros.cmake +++ b/src/CMake/VisItMacros.cmake @@ -364,7 +364,6 @@ endmacro() ############################################################################## # Adds a library target. # calls blt_add_library -# handles parallel # clears cache vars. # # ARGUMENTS: @@ -430,11 +429,19 @@ macro(visit_add_library) unset(${val_NAME}_FEATURES CACHE) endmacro() -macro(visit_add_parallel_library) +############################################################################## +# Adds a parallel library target. +# calls visit_add_library +# calls visit_patch_parallel_target to set all the parallel options for the +# target +# +# See visit_add_library for arguments. +# +############################################################################## +macro(visit_add_parallel_library) visit_add_library(${ARGV}) cmake_parse_arguments(vapl "" "NAME" "" ${ARGN}) visit_patch_parallel_target(NAME ${vapl_NAME}) - endmacro()