### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/ida/parallel/CMakeLists.txt Installs the C source file and output file for the example to the specified installation path if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/parallel) endif() ``` -------------------------------- ### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/petsc/CMakeLists.txt Installs the example source file and its output file to a specific destination path if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/petsc) endif() ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/arkode/CXX_parhyp/CMakeLists.txt Installs the example's C++ source file and its corresponding .out files to a specified installation path if example installation is enabled. ```cmake install(FILES ${example}.cpp ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) ``` -------------------------------- ### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/idas/parallel/CMakeLists.txt Installs the example source file and its corresponding output files to a specified destination path if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install (FILES ${example}.c ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/idas/parallel) endif() ``` -------------------------------- ### Install Example README Source: https://github.com/llnl/sundials/blob/main/examples/cvode/C_openmp/CMakeLists.txt Installs the README file for the CVODE OpenMP examples if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/C_openmp) # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODE") set(SOLVER_LIB "sundials_cvode") if(SUNDIALS_ENABLE_PACKAGE_FUSED_KERNELS) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() examples2string(CVODE_examples EXAMPLES) # ... (rest of the installation logic) ... endif() ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/kinsol/C_openmp/CMakeLists.txt Installs the C source file and its corresponding output file for the example if example installation is enabled. ```cmake install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/kinsol/F2003_serial/CMakeLists.txt Installs the source (.f90) and output (.out) files for KINSOL examples if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) endif() ``` -------------------------------- ### Install KLU Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/F2003_serial/CMakeLists.txt Installs the Fortran source and output files for a FCVODE example using KLU if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/cvodes/C_openmp/CMakeLists.txt Installs the C source file and the expected output file for a SUNDIALS example if example installation is enabled. ```cmake install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) ``` -------------------------------- ### Install CVODE Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/serial/CMakeLists.txt Conditionally installs the C source file and associated .out files for each CVODE example to a specified installation path if example installation is enabled. ```cmake install(FILES ${example}.c ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/serial) ``` -------------------------------- ### Install FCVODE Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/F2003_serial/CMakeLists.txt Installs the Fortran source file and its corresponding output file for a FCVODE example if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() ``` -------------------------------- ### Install Example Files and Build Scripts Source: https://github.com/llnl/sundials/blob/main/examples/arkode/C_openmpdev/CMakeLists.txt Handles the installation of example source files, output files, README, and extra files when SUNDIALS examples installation is enabled. It also configures and installs CMakeLists.txt and Makefile templates for building examples. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) # Install the extra files foreach(extrafile ${ARKODE_extras_OMP}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "ARKODE") set(SOLVER_LIB "sundials_arkode") examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmpdev_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmpdev_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev RENAME Makefile) endif() # add test_install target sundials_add_test_install(arkode C_openmpdev) endif() ``` -------------------------------- ### Install Example Files and Templates Source: https://github.com/llnl/sundials/blob/main/examples/idas/C_openmp/CMakeLists.txt Handles the installation of example source files, output files, README, and extra files. It also configures and installs CMakeLists.txt and Makefile templates for building examples. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install (FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/idas/C_openmp) # Install the extra files foreach(extrafile ${IDAS_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/idas/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "IDAS") set(SOLVER_LIB "sundials_idas") examples2string(IDAS_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmp_C_ex.in ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt install(FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/idas/C_openmp) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmp_C_ex.in ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/idas/C_openmp RENAME Makefile) endif() # add test_install target sundials_add_test_install(idas C_openmp) endif() ``` -------------------------------- ### Install KINSOL Example Files Source: https://github.com/llnl/sundials/blob/main/examples/kinsol/parallel/CMakeLists.txt Installs the source code and expected output files for KINSOL parallel examples to a specified directory if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/parallel) endif() ``` -------------------------------- ### Install Example README Source: https://github.com/llnl/sundials/blob/main/examples/cvode/C_openmpdev/CMakeLists.txt Installs the README file for the CVODE OpenMPDEV examples to the specified installation path. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODE") set(SOLVER_LIB "sundials_cvode") if(SUNDIALS_ENABLE_PACKAGE_FUSED_KERNELS) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() examples2string(CVODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_openmpdev_ex.in ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_openmpdev_ex.in ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev RENAME Makefile) endif() # add test_install target sundials_add_test_install(cvode C_openmpdev) endif() ``` -------------------------------- ### Install CVODE MPIManyVector Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/C_mpimanyvector/CMakeLists.txt Installs the C source and output files for the CVODE MPIManyVector example to a specified destination path if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) endif() ``` -------------------------------- ### Install KINSOL Example Files Source: https://github.com/llnl/sundials/blob/main/examples/kinsol/serial/CMakeLists.txt Installs the C source file and its corresponding output file for a KINSOL example if installation is enabled. ```cmake install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/serial) ``` -------------------------------- ### Install ARKODE Example Files in CMakeLists.txt Source: https://github.com/llnl/sundials/blob/main/examples/arkode/C_openmp/CMakeLists.txt Installs the source (.c) and output (.out) files for ARKODE examples if example installation is enabled. Files are placed in a specific subdirectory. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_openmp) endif() ``` -------------------------------- ### Install CVODE Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/CXX_parhyp/CMakeLists.txt Installs the C++ source file and associated output files for a CVODE example if the installation of examples is enabled. Files are placed in a specific subdirectory. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install (FILES ${example}.cpp ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) endif() ``` -------------------------------- ### Install Extra Files for IDA Examples Source: https://github.com/llnl/sundials/blob/main/examples/ida/F2003_parallel/CMakeLists.txt Installs extra files for IDA examples into the specified installation path. This is part of the SUNDIALS example installation process. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${IDA_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "IDA") # Makefile: convert semi-colon separated target list to space separated string list2string(IDA_LIBS EXAMPLE_LIBS) # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM IDA_LIBS REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FIDA_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/F2003_parallel RENAME Makefile) endif() # add test_install target sundials_add_test_install(ida F2003_parallel) endif() ``` -------------------------------- ### Install ARKODE Example Files Source: https://github.com/llnl/sundials/blob/main/examples/arkode/F2003_parallel/CMakeLists.txt Installs extra files for ARKODE examples when SUNDIALS examples are enabled for installation. Files are placed in a specific installation path. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "ARKODE") # Makefile: convert semi-colon separated target list to space separated string set(EXAMPLE_LIBS_LIST sundials_farkode_mod sundials_nvecparallel sundials_fnvecparallel_mod sundials_arkode sundials_fnvecmpiplusx_mod sundials_nvecmpiplusx sundials_fnvecmpimanyvector_mod sundials_nvecmpimanyvector sundials_fcore_mod sundials_core) list2string(EXAMPLE_LIBS_LIST EXAMPLE_LIBS) # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM EXAMPLE_LIBS_LIST REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_parallel/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel RENAME Makefile) endif() # add test_install target sundials_add_test_install(arkode F2003_parallel) endif() ``` -------------------------------- ### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/cvodes/F2003_serial/CMakeLists.txt Installs the example source file and its corresponding output files if SUNDIALS_ENABLE_EXAMPLES_INSTALL is enabled. ```cmake file(GLOB example_out ${example}*.out) # install example source and out files if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) ``` -------------------------------- ### Install README for ARKODE CXX_parhyp Example Source: https://github.com/llnl/sundials/blob/main/examples/arkode/CXX_parhyp/CMakeLists.txt Installs the README file for the ARKODE CXX_parhyp example. This is part of the example installation process. ```cmake install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/F2003_parallel/CMakeLists.txt Installs the Fortran source file and corresponding output files for a SUNDIALS example if installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) endif() ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/ida/F2003_openmp/CMakeLists.txt Installs the Fortran source file and its corresponding output file for the example. This is conditional on SUNDIALS_ENABLE_EXAMPLES_INSTALL being enabled. ```cmake # install example source and out files if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.f90 ${test_name}.out DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) endif() ``` -------------------------------- ### Install README for CVodes Parallel Examples Source: https://github.com/llnl/sundials/blob/main/examples/cvodes/parallel/CMakeLists.txt Installs the README file for CVodes parallel examples to the specified destination. This is part of the example installation process. ```cmake install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvodes/parallel) ``` -------------------------------- ### Install Example Files and Build Configurations Source: https://github.com/llnl/sundials/blob/main/examples/ida/serial/CMakeLists.txt This CMake script block handles the installation of example files, including README and extra files. It also configures and installs CMakeLists.txt and Makefile templates for users to build examples. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/serial) # Install the extra files foreach(extrafile ${IDA_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "IDA") set(SOLVER_LIB "sundials_ida") examples2string(IDA_examples EXAMPLES) if(SUNDIALS_ENABLE_SUNLINSOL_LAPACKBAND AND SUNDIALS_ENABLE_SUNLINSOL_LAPACKDENSE) examples2string(IDA_examples_BL EXAMPLES_BL) else() set(EXAMPLES_BL "") endif() if(SUNDIALS_ENABLE_SUNLINSOL_KLU) examples2string(IDA_examples_KLU EXAMPLES_KLU) else() set(EXAMPLES_KLU "") endif() if(SUNDIALS_ENABLE_SUNLINSOL_SUPERLUMT) examples2string(IDA_examples_SUPERLUMT EXAMPLES_SLUMT) if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") endif() else() set(EXAMPLES_SLUMT "") set(THREAD_LIBRARY_SLUMT "") endif() # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install(FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/serial) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in ${PROJECT_BINARY_DIR}/examples/ida/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/ida/serial RENAME Makefile) endif() # add test_install target sundials_add_test_install(ida serial EXECUTABLE idaRoberts_dns) endif() ``` -------------------------------- ### Install ARKODE Example Auxiliary Files Source: https://github.com/llnl/sundials/blob/main/examples/arkode/C_manyvector/CMakeLists.txt Installs auxiliary files for ARKODE examples, such as plotting scripts and README files, if example installation is enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the README file install(FILES README DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) endforeach(extrafile ${ARKODE_EXAMPLES}) # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "ARKODE") set(SOLVER_LIB "sundials_arkode") examples2string(ARKODE_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_serial_C_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_C_ex.in ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_manyvector/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_manyvector RENAME Makefile) endif() # add test_install target sundials_add_test_install(arkode C_manyvector) endif() ``` -------------------------------- ### Install Example Source and Output Files Source: https://github.com/llnl/sundials/blob/main/examples/cvode/serial/CMakeLists.txt Installs the C source file and associated .out files for a SuperLU_MT example. This is done only if SUNDIALS_ENABLE_EXAMPLES_INSTALL is enabled. The files are placed in a specific subdirectory for serial examples. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/cvode/serial) endif() ``` -------------------------------- ### Install ARKODE Examples with SuperLU_MT Source: https://github.com/llnl/sundials/blob/main/examples/arkode/C_superlu-mt/CMakeLists.txt This CMake code block conditionally installs ARKODE examples and auxiliary files when SUNDIALS examples are enabled for installation. It specifies the destination path and the SUNDIALS targets to be installed. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${extras}) install (FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_superlumt) endforeach(extrafile ${extras}) sundials_install_examples( arkode examples_list CMAKE_TEMPLATE cmakelists_C_ex.in MAKE_TEMPLATE makefile_serial_C_ex.in SUNDIALS_TARGETS nvecserial arkode sunlinsolsuperlumt DESTINATION arkode/C_superlu-mt TEST_INSTALL C_superlu-mt) endif() ``` -------------------------------- ### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/arkode/C_parallel/CMakeLists.txt Installs the C source file and associated output files (.out) for an ARKODE example to a specified destination path. This is conditional on SUNDIALS_ENABLE_EXAMPLES_INSTALL being true. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/arkode/C_parallel) endif() ``` -------------------------------- ### Install CVODE Parallel Examples Source: https://github.com/llnl/sundials/blob/main/examples/cvode/parhyp/CMakeLists.txt Installs CVODE parallel examples, including necessary libraries and test files. Requires SUNDIALS to be configured with example installation enabled. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) if(SUNDIALS_ENABLE_PACKAGE_FUSED_KERNELS) set(_fused_stubs_target cvode_fused_stubs) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() sundials_install_examples( cvode CVODE_examples CMAKE_TEMPLATE cmakelists_C_MPI_ex.in MAKE_TEMPLATE makefile_parhyp_C_ex.in SOLVER_LIBRARY sundials_cvode SUNDIALS_TARGETS cvode nvecparhyp ${_fused_stubs_target} DESTINATION cvode/parhyp EXTRA_FILES README TEST_INSTALL parhyp) endif() ``` -------------------------------- ### Install Example Files Source: https://github.com/llnl/sundials/blob/main/examples/kinsol/F2003_parallel/CMakeLists.txt Installs extra files for KINSOL examples in the F2003_parallel directory. This is conditionally executed if SUNDIALS_ENABLE_EXAMPLES_INSTALL is true. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${KINSOL_extras}) install(FILES ${extrafile} DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "KINSOL") # Makefile: convert semi-colon separated target list to space separated string list2string(KINSOL_LIBS EXAMPLE_LIBS) # CMakeLists: replace sundials_ prefix and convert to space separated string list(TRANSFORM KINSOL_LIBS REPLACE "sundials_" "SUNDIALS::" OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FKINSOL_examples EXAMPLES) # Regardless of the platform we're on, we will generate and install # CMakeLists.txt file for building the examples. This file can then be used # as a template for the user's own programs. # generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/CMakeLists.txt DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) # On UNIX-type platforms, we also generate and install a makefile for # building the examples. This makefile can then be used as a template for the # user's own programs. if(UNIX) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_parallel_F2003_ex.in ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_parallel/Makefile_ex DESTINATION ${SUNDIALS_EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel RENAME Makefile) endif() # add test_install target sundials_add_test_install(kinsol F2003_parallel) endif() ``` -------------------------------- ### Install SUNDIALS Examples Source: https://github.com/llnl/sundials/blob/main/examples/arkode/CXX_parallel/CMakeLists.txt Installs SUNDIALS examples, including those for ARKODE and parallel NVectors. It conditionally includes CVODE examples and specifies installation directories and extra files. ```cmake if(SUNDIALS_ENABLE_EXAMPLES_INSTALL) set(examples_to_install "${parallel_examples}") set(_sundials_targets arkode nvecparallel) if(examples_cvode) list(APPEND examples_to_install "${examples_cvode}") list(APPEND _sundials_targets cvode nvecmpiplusx) endif() # For now do not install the RAJA examples because they need to built as CUDA # code when RAJA is built with CUDA if(serial_raja_examples) list(APPEND # examples_to_install "${serial_raja_examples}") list(APPEND _sundials_targets # nvecmpiplusx) # if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES # "OPENMP")) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") # endif() # if(RAJA_NEEDS_THREADS) set(EXAMPLES_FIND_PACKAGE # "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() sundials_install_examples( arkode examples_to_install CMAKE_TEMPLATE cmakelists_CXX_MPI_ex.in SUNDIALS_TARGETS ${_sundials_targets} OTHER_TARGETS ${EXE_EXTRA_LINK_LIBS} DESTINATION arkode/CXX_parallel EXTRA_FILES ${ARKODE_headers} ${ARKODE_extras} README TEST_INSTALL CXX_parallel) endif() ```