From d0a14ae320ac6416009963a818fd0709b9f52a2f Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Wed, 3 Jul 2024 16:49:21 -0700 Subject: [PATCH 1/6] Bugfix: Fix loading of default order 1 ERK method in ARKStep (#536) --- CHANGELOG.md | 2 ++ doc/shared/RecentChanges.rst | 2 ++ src/arkode/arkode_arkstep.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 141b16720c..3291523216 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bug Fixes +Fixed the loading of ARKStep's default first order explicit method. + ### Deprecation Notices ## Changes to SUNDIALS in release 7.1.1 diff --git a/doc/shared/RecentChanges.rst b/doc/shared/RecentChanges.rst index 4f1514700e..cc4a9f919c 100644 --- a/doc/shared/RecentChanges.rst +++ b/doc/shared/RecentChanges.rst @@ -4,4 +4,6 @@ **Bug Fixes** +Fixed the loading of ARKStep's default first order explicit method. + **Deprecation Notices** diff --git a/src/arkode/arkode_arkstep.c b/src/arkode/arkode_arkstep.c index 5f91285edb..4f6e403ccf 100644 --- a/src/arkode/arkode_arkstep.c +++ b/src/arkode/arkode_arkstep.c @@ -2254,7 +2254,7 @@ int arkStep_SetButcherTables(ARKodeMem ark_mem) { switch (step_mem->q) { - case (1): itable = ARKSTEP_DEFAULT_ERK_1; break; + case (1): etable = ARKSTEP_DEFAULT_ERK_1; break; case (2): etable = ARKSTEP_DEFAULT_ERK_2; break; case (3): etable = ARKSTEP_DEFAULT_ERK_3; break; case (4): etable = ARKSTEP_DEFAULT_ERK_4; break; From c6b9a02f24a27081c471d63dfc524684a9f5a9e3 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Mon, 8 Jul 2024 18:55:56 -0700 Subject: [PATCH 2/6] CMake: Formatting with cmake-format (#520) Add CMake formatter --- .cmake-format.py | 330 +++++++++++++++ ...heck-clang-format.yml => check-format.yml} | 27 +- CMakeLists.txt | 81 ++-- benchmarks/CMakeLists.txt | 14 +- .../advection_reaction_3D/CMakeLists.txt | 1 - .../kokkos/CMakeLists.txt | 55 +-- .../advection_reaction_3D/raja/CMakeLists.txt | 164 ++++---- benchmarks/diffusion_2D/CMakeLists.txt | 13 +- .../diffusion_2D/mpi_gpu/CMakeLists.txt | 45 +-- .../diffusion_2D/mpi_serial/CMakeLists.txt | 29 +- benchmarks/nvector/cuda/CMakeLists.txt | 6 +- benchmarks/nvector/hip/CMakeLists.txt | 6 +- benchmarks/nvector/kokkos/CMakeLists.txt | 11 +- benchmarks/nvector/mpiplusx/CMakeLists.txt | 6 +- benchmarks/nvector/openmp/CMakeLists.txt | 15 +- benchmarks/nvector/openmpdev/CMakeLists.txt | 11 +- benchmarks/nvector/parallel/CMakeLists.txt | 6 +- benchmarks/nvector/parhyp/CMakeLists.txt | 6 +- benchmarks/nvector/petsc/CMakeLists.txt | 6 +- benchmarks/nvector/pthreads/CMakeLists.txt | 6 +- benchmarks/nvector/raja/CMakeLists.txt | 11 +- benchmarks/nvector/serial/CMakeLists.txt | 6 +- benchmarks/nvector/sycl/CMakeLists.txt | 3 +- cmake/SundialsBuildOptionsPost.cmake | 259 +++++++----- cmake/SundialsBuildOptionsPre.cmake | 159 +++++--- cmake/SundialsDeprecated.cmake | 113 ++++-- cmake/SundialsExampleOptions.cmake | 63 ++- cmake/SundialsIndexSize.cmake | 24 +- cmake/SundialsSetupCXX.cmake | 15 +- cmake/SundialsSetupCompilers.cmake | 222 ++++++----- cmake/SundialsSetupConfig.cmake | 14 +- cmake/SundialsSetupCuda.cmake | 31 +- cmake/SundialsSetupFortran.cmake | 40 +- cmake/SundialsSetupHIP.cmake | 27 +- cmake/SundialsSetupTPLs.cmake | 5 +- cmake/SundialsSetupTesting.cmake | 117 ++++-- cmake/SundialsTPLOptions.cmake | 377 +++++++++++------- cmake/macros/SundialsAddBenchmark.cmake | 51 ++- cmake/macros/SundialsAddExamplesGinkgo.cmake | 27 +- cmake/macros/SundialsAddExecutable.cmake | 26 +- cmake/macros/SundialsAddLibrary.cmake | 318 ++++++++------- cmake/macros/SundialsAddTest.cmake | 163 +++++--- cmake/macros/SundialsAddTestInstall.cmake | 60 +-- cmake/macros/SundialsCMakeMacros.cmake | 27 +- cmake/macros/SundialsInstallExamples.cmake | 90 +++-- .../SundialsInstallExamplesGinkgo.cmake | 61 +-- cmake/macros/SundialsOption.cmake | 37 +- cmake/macros/SundialsTryCompileExecute.cmake | 49 ++- cmake/tpl/FindHYPRE.cmake | 78 ++-- cmake/tpl/FindKLU.cmake | 118 +++--- cmake/tpl/FindMAGMA.cmake | 68 ++-- cmake/tpl/FindPETSC.cmake | 52 ++- cmake/tpl/FindSUPERLUDIST.cmake | 100 +++-- cmake/tpl/FindSUPERLUMT.cmake | 64 +-- cmake/tpl/FindTrilinos.cmake | 28 +- cmake/tpl/FindXBRAID.cmake | 202 +++++----- cmake/tpl/SundialsAdiak.cmake | 30 +- cmake/tpl/SundialsCaliper.cmake | 36 +- cmake/tpl/SundialsGinkgo.cmake | 35 +- cmake/tpl/SundialsHypre.cmake | 78 ++-- cmake/tpl/SundialsKLU.cmake | 66 +-- cmake/tpl/SundialsKokkos.cmake | 19 +- cmake/tpl/SundialsKokkosKernels.cmake | 16 +- cmake/tpl/SundialsLapack.cmake | 163 ++++---- cmake/tpl/SundialsMAGMA.cmake | 18 +- cmake/tpl/SundialsMPI.cmake | 45 +-- cmake/tpl/SundialsONEMKL.cmake | 25 +- cmake/tpl/SundialsOpenMP.cmake | 35 +- cmake/tpl/SundialsPETSC.cmake | 43 +- cmake/tpl/SundialsPOSIXTimers.cmake | 36 +- cmake/tpl/SundialsRAJA.cmake | 71 ++-- cmake/tpl/SundialsSuperLUDIST.cmake | 48 ++- cmake/tpl/SundialsSuperLUMT.cmake | 30 +- cmake/tpl/SundialsTrilinos.cmake | 101 +++-- cmake/tpl/SundialsXBRAID.cmake | 31 +- .../developers/style_guide/SourceCode.rst | 20 +- examples/CMakeLists.txt | 15 +- examples/arkode/CMakeLists.txt | 9 +- examples/arkode/CXX_parallel/CMakeLists.txt | 121 +++--- examples/arkode/CXX_parhyp/CMakeLists.txt | 60 ++- examples/arkode/CXX_serial/CMakeLists.txt | 86 ++-- .../arkode/CXX_superludist/CMakeLists.txt | 34 +- examples/arkode/CXX_xbraid/CMakeLists.txt | 76 ++-- examples/arkode/C_manyvector/CMakeLists.txt | 42 +- examples/arkode/C_openmp/CMakeLists.txt | 55 +-- examples/arkode/C_openmpdev/CMakeLists.txt | 44 +- examples/arkode/C_parallel/CMakeLists.txt | 65 ++- examples/arkode/C_parhyp/CMakeLists.txt | 44 +- examples/arkode/C_petsc/CMakeLists.txt | 42 +- examples/arkode/C_serial/CMakeLists.txt | 236 +++++------ examples/arkode/F2003_custom/CMakeLists.txt | 70 ++-- examples/arkode/F2003_parallel/CMakeLists.txt | 94 +++-- examples/arkode/F2003_serial/CMakeLists.txt | 101 +++-- examples/cvode/CMakeLists.txt | 4 +- examples/cvode/CXX_onemkl/CMakeLists.txt | 43 +- examples/cvode/CXX_parallel/CMakeLists.txt | 50 +-- examples/cvode/CXX_parhyp/CMakeLists.txt | 56 ++- examples/cvode/CXX_serial/CMakeLists.txt | 58 +-- examples/cvode/CXX_sycl/CMakeLists.txt | 35 +- examples/cvode/C_mpimanyvector/CMakeLists.txt | 39 +- examples/cvode/C_openmp/CMakeLists.txt | 42 +- examples/cvode/C_openmpdev/CMakeLists.txt | 39 +- examples/cvode/F2003_parallel/CMakeLists.txt | 52 +-- examples/cvode/F2003_serial/CMakeLists.txt | 82 ++-- examples/cvode/cuda/CMakeLists.txt | 60 ++- examples/cvode/ginkgo/CMakeLists.txt | 39 +- examples/cvode/hip/CMakeLists.txt | 42 +- examples/cvode/kokkos/CMakeLists.txt | 63 ++- examples/cvode/magma/CMakeLists.txt | 39 +- examples/cvode/parallel/CMakeLists.txt | 44 +- examples/cvode/parhyp/CMakeLists.txt | 48 +-- examples/cvode/petsc/CMakeLists.txt | 41 +- examples/cvode/raja/CMakeLists.txt | 58 +-- examples/cvode/serial/CMakeLists.txt | 144 +++---- examples/cvode/superludist/CMakeLists.txt | 44 +- examples/cvodes/CMakeLists.txt | 2 +- examples/cvodes/C_openmp/CMakeLists.txt | 46 +-- examples/cvodes/F2003_serial/CMakeLists.txt | 46 +-- examples/cvodes/parallel/CMakeLists.txt | 59 ++- examples/cvodes/serial/CMakeLists.txt | 180 ++++----- examples/ida/CMakeLists.txt | 4 +- examples/ida/C_openmp/CMakeLists.txt | 43 +- examples/ida/F2003_openmp/CMakeLists.txt | 52 +-- examples/ida/F2003_parallel/CMakeLists.txt | 52 +-- examples/ida/F2003_serial/CMakeLists.txt | 47 +-- examples/ida/cuda/CMakeLists.txt | 42 +- examples/ida/mpicuda/CMakeLists.txt | 44 +- examples/ida/mpiraja/CMakeLists.txt | 60 ++- examples/ida/parallel/CMakeLists.txt | 44 +- examples/ida/petsc/CMakeLists.txt | 50 +-- examples/ida/raja/CMakeLists.txt | 56 +-- examples/ida/serial/CMakeLists.txt | 121 +++--- examples/ida/trilinos/CMakeLists.txt | 50 +-- examples/idas/CMakeLists.txt | 2 +- examples/idas/C_openmp/CMakeLists.txt | 55 +-- examples/idas/F2003_serial/CMakeLists.txt | 47 +-- examples/idas/parallel/CMakeLists.txt | 57 ++- examples/idas/serial/CMakeLists.txt | 138 +++---- examples/kinsol/CMakeLists.txt | 8 +- examples/kinsol/CUDA_mpi/CMakeLists.txt | 48 +-- examples/kinsol/CXX_parallel/CMakeLists.txt | 48 +-- examples/kinsol/CXX_parhyp/CMakeLists.txt | 58 ++- examples/kinsol/C_openmp/CMakeLists.txt | 42 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 49 +-- examples/kinsol/F2003_serial/CMakeLists.txt | 47 +-- examples/kinsol/parallel/CMakeLists.txt | 41 +- examples/kinsol/serial/CMakeLists.txt | 116 +++--- examples/nvector/CMakeLists.txt | 10 +- examples/nvector/C_openmp/CMakeLists.txt | 77 ++-- examples/nvector/cuda/CMakeLists.txt | 57 ++- examples/nvector/hip/CMakeLists.txt | 42 +- examples/nvector/kokkos/CMakeLists.txt | 48 +-- examples/nvector/manyvector/CMakeLists.txt | 74 ++-- examples/nvector/mpicuda/CMakeLists.txt | 62 ++- examples/nvector/mpimanyvector/CMakeLists.txt | 93 +++-- examples/nvector/mpiplusx/CMakeLists.txt | 94 ++--- examples/nvector/mpiraja/CMakeLists.txt | 69 ++-- examples/nvector/openmpdev/CMakeLists.txt | 53 +-- examples/nvector/parallel/CMakeLists.txt | 97 ++--- examples/nvector/parhyp/CMakeLists.txt | 61 ++- examples/nvector/petsc/CMakeLists.txt | 64 ++- examples/nvector/pthreads/CMakeLists.txt | 80 ++-- examples/nvector/raja/CMakeLists.txt | 53 +-- examples/nvector/serial/CMakeLists.txt | 72 ++-- examples/nvector/sycl/CMakeLists.txt | 42 +- examples/nvector/trilinos/CMakeLists.txt | 78 ++-- examples/sunlinsol/CMakeLists.txt | 6 +- examples/sunlinsol/band/CMakeLists.txt | 92 ++--- examples/sunlinsol/cusolversp/CMakeLists.txt | 65 ++- examples/sunlinsol/dense/CMakeLists.txt | 90 ++--- examples/sunlinsol/ginkgo/CMakeLists.txt | 45 +-- examples/sunlinsol/klu/CMakeLists.txt | 87 ++-- examples/sunlinsol/kokkos/CMakeLists.txt | 63 ++- examples/sunlinsol/lapackband/CMakeLists.txt | 66 ++- examples/sunlinsol/lapackdense/CMakeLists.txt | 99 ++--- examples/sunlinsol/magmadense/CMakeLists.txt | 58 ++- examples/sunlinsol/onemkldense/CMakeLists.txt | 57 ++- .../sunlinsol/pcg/parallel/CMakeLists.txt | 56 +-- examples/sunlinsol/pcg/serial/CMakeLists.txt | 84 ++-- .../sunlinsol/spbcgs/parallel/CMakeLists.txt | 56 ++- .../sunlinsol/spbcgs/serial/CMakeLists.txt | 81 ++-- .../sunlinsol/spfgmr/parallel/CMakeLists.txt | 56 ++- .../sunlinsol/spfgmr/serial/CMakeLists.txt | 82 ++-- .../sunlinsol/spgmr/parallel/CMakeLists.txt | 59 ++- .../sunlinsol/spgmr/serial/CMakeLists.txt | 85 ++-- .../sunlinsol/sptfqmr/parallel/CMakeLists.txt | 59 ++- .../sunlinsol/sptfqmr/serial/CMakeLists.txt | 79 ++-- examples/sunlinsol/superludist/CMakeLists.txt | 70 ++-- examples/sunlinsol/superlumt/CMakeLists.txt | 70 ++-- examples/sunmatrix/CMakeLists.txt | 6 +- examples/sunmatrix/band/CMakeLists.txt | 87 ++-- examples/sunmatrix/cusparse/CMakeLists.txt | 60 ++- examples/sunmatrix/dense/CMakeLists.txt | 86 ++-- examples/sunmatrix/ginkgo/CMakeLists.txt | 42 +- examples/sunmatrix/kokkos/CMakeLists.txt | 66 ++- examples/sunmatrix/magmadense/CMakeLists.txt | 63 ++- examples/sunmatrix/onemkldense/CMakeLists.txt | 61 ++- examples/sunmatrix/slunrloc/CMakeLists.txt | 68 ++-- examples/sunmatrix/sparse/CMakeLists.txt | 94 ++--- examples/sunnonlinsol/CMakeLists.txt | 4 +- .../sunnonlinsol/fixedpoint/CMakeLists.txt | 67 ++-- examples/sunnonlinsol/newton/CMakeLists.txt | 67 ++-- examples/sunnonlinsol/petsc/CMakeLists.txt | 44 +- scripts/format.sh | 11 +- src/arkode/CMakeLists.txt | 101 +++-- src/arkode/fmod_int32/CMakeLists.txt | 19 +- src/arkode/fmod_int64/CMakeLists.txt | 19 +- src/arkode/xbraid/CMakeLists.txt | 29 +- src/cvode/CMakeLists.txt | 125 +++--- src/cvode/fmod_int32/CMakeLists.txt | 19 +- src/cvode/fmod_int64/CMakeLists.txt | 19 +- src/cvodes/CMakeLists.txt | 62 ++- src/cvodes/fmod_int32/CMakeLists.txt | 19 +- src/cvodes/fmod_int64/CMakeLists.txt | 19 +- src/ida/CMakeLists.txt | 40 +- src/ida/fmod_int32/CMakeLists.txt | 19 +- src/ida/fmod_int64/CMakeLists.txt | 19 +- src/idas/CMakeLists.txt | 52 +-- src/idas/fmod_int32/CMakeLists.txt | 19 +- src/idas/fmod_int64/CMakeLists.txt | 19 +- src/kinsol/CMakeLists.txt | 38 +- src/kinsol/fmod_int32/CMakeLists.txt | 19 +- src/kinsol/fmod_int64/CMakeLists.txt | 19 +- src/nvector/CMakeLists.txt | 24 +- src/nvector/cuda/CMakeLists.txt | 28 +- src/nvector/hip/CMakeLists.txt | 31 +- src/nvector/manyvector/CMakeLists.txt | 53 +-- .../manyvector/fmod_int32/CMakeLists.txt | 38 +- .../manyvector/fmod_int64/CMakeLists.txt | 38 +- src/nvector/mpiplusx/CMakeLists.txt | 28 +- .../mpiplusx/fmod_int32/CMakeLists.txt | 19 +- .../mpiplusx/fmod_int64/CMakeLists.txt | 19 +- src/nvector/openmp/CMakeLists.txt | 28 +- src/nvector/openmp/fmod_int32/CMakeLists.txt | 19 +- src/nvector/openmp/fmod_int64/CMakeLists.txt | 19 +- src/nvector/openmpdev/CMakeLists.txt | 28 +- src/nvector/parallel/CMakeLists.txt | 25 +- .../parallel/fmod_int32/CMakeLists.txt | 19 +- .../parallel/fmod_int64/CMakeLists.txt | 19 +- src/nvector/parhyp/CMakeLists.txt | 30 +- src/nvector/petsc/CMakeLists.txt | 28 +- src/nvector/pthreads/CMakeLists.txt | 28 +- .../pthreads/fmod_int32/CMakeLists.txt | 19 +- .../pthreads/fmod_int64/CMakeLists.txt | 19 +- src/nvector/raja/CMakeLists.txt | 47 +-- src/nvector/serial/CMakeLists.txt | 25 +- src/nvector/serial/fmod_int32/CMakeLists.txt | 19 +- src/nvector/serial/fmod_int64/CMakeLists.txt | 19 +- src/nvector/sycl/CMakeLists.txt | 31 +- src/nvector/trilinos/CMakeLists.txt | 42 +- src/sunadaptcontroller/imexgus/CMakeLists.txt | 15 +- .../imexgus/fmod_int32/CMakeLists.txt | 14 +- .../imexgus/fmod_int64/CMakeLists.txt | 14 +- .../soderlind/CMakeLists.txt | 15 +- .../soderlind/fmod_int32/CMakeLists.txt | 15 +- .../soderlind/fmod_int64/CMakeLists.txt | 15 +- src/sundials/CMakeLists.txt | 154 ++++--- src/sundials/fmod_int32/CMakeLists.txt | 10 +- src/sundials/fmod_int64/CMakeLists.txt | 10 +- src/sunlinsol/CMakeLists.txt | 40 +- src/sunlinsol/band/CMakeLists.txt | 28 +- src/sunlinsol/band/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/band/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/cusolversp/CMakeLists.txt | 27 +- src/sunlinsol/dense/CMakeLists.txt | 28 +- src/sunlinsol/dense/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/dense/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/klu/CMakeLists.txt | 28 +- src/sunlinsol/klu/fmod_int32/CMakeLists.txt | 22 +- src/sunlinsol/klu/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/lapackband/CMakeLists.txt | 28 +- src/sunlinsol/lapackdense/CMakeLists.txt | 28 +- .../lapackdense/fmod_int32/CMakeLists.txt | 19 +- .../lapackdense/fmod_int64/CMakeLists.txt | 22 +- src/sunlinsol/magmadense/CMakeLists.txt | 28 +- src/sunlinsol/onemkldense/CMakeLists.txt | 35 +- src/sunlinsol/pcg/CMakeLists.txt | 25 +- src/sunlinsol/pcg/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/pcg/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spbcgs/CMakeLists.txt | 25 +- .../spbcgs/fmod_int32/CMakeLists.txt | 19 +- .../spbcgs/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spfgmr/CMakeLists.txt | 25 +- .../spfgmr/fmod_int32/CMakeLists.txt | 19 +- .../spfgmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/spgmr/CMakeLists.txt | 25 +- src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt | 19 +- src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/sptfqmr/CMakeLists.txt | 25 +- .../sptfqmr/fmod_int32/CMakeLists.txt | 19 +- .../sptfqmr/fmod_int64/CMakeLists.txt | 19 +- src/sunlinsol/superludist/CMakeLists.txt | 35 +- src/sunlinsol/superlumt/CMakeLists.txt | 33 +- src/sunmatrix/CMakeLists.txt | 40 +- src/sunmatrix/band/CMakeLists.txt | 25 +- src/sunmatrix/band/fmod_int32/CMakeLists.txt | 19 +- src/sunmatrix/band/fmod_int64/CMakeLists.txt | 19 +- src/sunmatrix/cusparse/CMakeLists.txt | 31 +- src/sunmatrix/dense/CMakeLists.txt | 25 +- src/sunmatrix/dense/fmod_int32/CMakeLists.txt | 19 +- src/sunmatrix/dense/fmod_int64/CMakeLists.txt | 19 +- src/sunmatrix/magmadense/CMakeLists.txt | 40 +- src/sunmatrix/onemkldense/CMakeLists.txt | 37 +- src/sunmatrix/slunrloc/CMakeLists.txt | 33 +- src/sunmatrix/sparse/CMakeLists.txt | 25 +- .../sparse/fmod_int32/CMakeLists.txt | 19 +- .../sparse/fmod_int64/CMakeLists.txt | 19 +- src/sunmemory/cuda/CMakeLists.txt | 18 +- src/sunmemory/hip/CMakeLists.txt | 19 +- src/sunmemory/sycl/CMakeLists.txt | 18 +- src/sunmemory/system/CMakeLists.txt | 18 +- src/sunnonlinsol/fixedpoint/CMakeLists.txt | 25 +- .../fixedpoint/fmod_int32/CMakeLists.txt | 19 +- .../fixedpoint/fmod_int64/CMakeLists.txt | 19 +- src/sunnonlinsol/newton/CMakeLists.txt | 25 +- .../newton/fmod_int32/CMakeLists.txt | 19 +- .../newton/fmod_int64/CMakeLists.txt | 19 +- src/sunnonlinsol/petscsnes/CMakeLists.txt | 28 +- test/unit_tests/arkode/CMakeLists.txt | 1 - .../arkode/CXX_parallel/CMakeLists.txt | 33 +- .../arkode/CXX_serial/CMakeLists.txt | 71 ++-- .../unit_tests/arkode/C_serial/CMakeLists.txt | 49 ++- .../arkode/F2003_serial/CMakeLists.txt | 14 +- test/unit_tests/arkode/gtest/CMakeLists.txt | 50 +-- test/unit_tests/cvode/CMakeLists.txt | 2 +- .../cvode/CXX_serial/CMakeLists.txt | 46 +-- test/unit_tests/cvode/C_serial/CMakeLists.txt | 22 +- test/unit_tests/cvode/gtest/CMakeLists.txt | 48 +-- .../cvodes/CXX_serial/CMakeLists.txt | 46 +-- .../unit_tests/cvodes/C_serial/CMakeLists.txt | 22 +- test/unit_tests/cvodes/gtest/CMakeLists.txt | 46 +-- test/unit_tests/ida/CXX_serial/CMakeLists.txt | 40 +- test/unit_tests/ida/C_serial/CMakeLists.txt | 22 +- test/unit_tests/ida/gtest/CMakeLists.txt | 46 +-- .../unit_tests/idas/CXX_serial/CMakeLists.txt | 38 +- test/unit_tests/idas/C_serial/CMakeLists.txt | 22 +- test/unit_tests/idas/gtest/CMakeLists.txt | 47 +-- .../kinsol/CXX_serial/CMakeLists.txt | 25 +- .../unit_tests/kinsol/C_serial/CMakeLists.txt | 21 +- test/unit_tests/kinsol/gtest/CMakeLists.txt | 46 +-- test/unit_tests/profiling/CMakeLists.txt | 15 +- test/unit_tests/sundials/CMakeLists.txt | 5 +- .../sundials/reductions/CMakeLists.txt | 11 +- test/unit_tests/sunmemory/CMakeLists.txt | 1 - test/unit_tests/sunmemory/cuda/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/hip/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/sycl/CMakeLists.txt | 15 +- test/unit_tests/sunmemory/sys/CMakeLists.txt | 15 +- 348 files changed, 7792 insertions(+), 8726 deletions(-) create mode 100644 .cmake-format.py rename .github/workflows/{check-clang-format.yml => check-format.yml} (71%) diff --git a/.cmake-format.py b/.cmake-format.py new file mode 100644 index 0000000000..c6d5938ef6 --- /dev/null +++ b/.cmake-format.py @@ -0,0 +1,330 @@ +# ---------------------------------- +# Options affecting listfile parsing +# ---------------------------------- +with section("parse"): + + # Specify structure for custom cmake functions + additional_commands = { + 'add_prefix': {'pargs': {'nargs': 2}}, + 'add_suffix': {'pargs': {'nargs': 2}}, + 'append_static_suffix': {'pargs': {'nargs': 2}}, + 'examples2string': {'pargs': {'nargs': 2}}, + 'force_variable': {'pargs': {'nargs': 4}}, + 'list2string': {'pargs': {'nargs': 2}}, + 'sundials_add_benchmark': { 'kwargs': { 'BENCHMARK_ARGS': 1, + 'IDENTIFIER': 1, + 'NUM_CORES': 1, + 'TEST_RUNNER_ARGS': '+'}, + 'pargs': { 'flags': ['ENABLE_GPU'], + 'nargs': '3+'}}, + 'sundials_add_examples_ginkgo': { 'kwargs': {'BACKENDS': '+', 'TARGETS': '+'}, + 'pargs': { 'flags': ['UNIT_TEST'], + 'nargs': '1+'}}, + 'sundials_add_f2003_library': { 'kwargs': { 'COMPILE_DEFINITIONS': '+', + 'COMPILE_OPTIONS': '+', + 'INCLUDE_DIRECTORIES': '+', + 'LINK_LIBRARIES': '+', + 'OBJECT_LIBRARIES': '+', + 'OUTPUT_NAME': 1, + 'PROPERTIES': '+', + 'SOURCES': '+', + 'SOVERSION': 1, + 'VERSION': 1}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_add_library': { 'kwargs': { 'COMPILE_DEFINITIONS': '+', + 'COMPILE_FEATURES': '+', + 'COMPILE_OPTIONS': '+', + 'HEADERS': '+', + 'INCLUDE_DIRECTORIES': '+', + 'INCLUDE_SUBDIR': 1, + 'LINK_LIBRARIES': '+', + 'OBJECT_LIBRARIES': '+', + 'OUTPUT_NAME': 1, + 'PROPERTIES': '+', + 'SOURCES': '+', + 'SOVERSION': 1, + 'VERSION': 1}, + 'pargs': { 'flags': [ 'STATIC_ONLY', + 'SHARED_ONLY', + 'OBJECT_LIB_ONLY'], + 'nargs': '1+'}}, + 'sundials_add_nvector_benchmark': { 'kwargs': { 'INSTALL_SUBDIR': '+', + 'LINK_LIBRARIES': '+', + 'SOURCES': '+', + 'SUNDIALS_TARGETS': '+'}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_add_test': { 'kwargs': { 'ANSWER_DIR': 1, + 'ANSWER_FILE': 1, + 'EXAMPLE_TYPE': 1, + 'EXTRA_ARGS': '+', + 'FLOAT_PRECISION': 1, + 'INTEGER_PRECISION': 1, + 'MPI_NPROCS': 1, + 'TEST_ARGS': '+'}, + 'pargs': {'flags': ['NODIFF'], 'nargs': '2+'}}, + 'sundials_add_test_install': { 'kwargs': {'EXECUTABLE': 1}, + 'pargs': {'flags': [], 'nargs': '2+'}}, + 'sundials_git_version': {'pargs': {'nargs': 0}}, + 'sundials_install_examples': { 'kwargs': { 'CMAKE_TEMPLATE': 1, + 'DESTINATION': 1, + 'EXAMPLES_DEPENDENCIES': '+', + 'EXTRA_FILES': '+', + 'EXTRA_INCLUDES': '+', + 'MAKE_TEMPLATE': 1, + 'OTHER_TARGETS': '+', + 'SOLVER_LIBRARY': 1, + 'SUNDIALS_COMPONENTS': '+', + 'SUNDIALS_TARGETS': '+', + 'TEST_INSTALL': 1}, + 'pargs': {'flags': [], 'nargs': '2+'}}, + 'sundials_install_examples_ginkgo': { 'kwargs': { 'CPU_EXAMPLES_VAR': '+', + 'CPU_GPU_EXAMPLES_VAR': '+', + 'DEPENDENCIES': '+', + 'DESTINATION': 1, + 'EXTRA_FILES': '+', + 'GPU_EXAMPLES_VAR': '+', + 'SUNDIALS_COMPONENTS': '+', + 'SUNDIALS_TARGETS': '+'}, + 'pargs': {'flags': [], 'nargs': '1+'}}, + 'sundials_option': { 'kwargs': {'DEPENDS_ON': '+', 'OPTIONS': '+'}, + 'pargs': { 'flags': [ 'DEPENDS_ON_THROW_ERROR', + 'ADVANCED'], + 'nargs': '4+'}}, + 'sundials_trycompile_execute': { 'kwargs': { 'COMPILE_OUTPUT': 1, + 'RUN_OUTPUT': 1}, + 'pargs': {'flags': [], 'nargs': '4+'}}, + 'add_local_ci_target': {'pargs': {'nargs': 3}} + } + + # Override configurations per-command where available + override_spec = {} + + # Specify variable tags. + vartags = [] + + # Specify property tags. + proptags = [] + +# ----------------------------- +# Options affecting formatting. +# ----------------------------- +with section("format"): + + # Disable formatting entirely, making cmake-format a no-op + disable = False + + # How wide to allow formatted cmake files + line_width = 80 + + # How many spaces to tab for indent + tab_size = 2 + + # If true, lines are indented using tab characters (utf-8 0x09) instead of + # space characters (utf-8 0x20). In cases where the layout would + # require a fractional tab character, the behavior of the fractional + # indentation is governed by + use_tabchars = False + + # If is True, then the value of this variable indicates how + # fractional indentions are handled during whitespace replacement. If set to + # 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set + # to `round-up` fractional indentation is replaced with a single tab character + # (utf-8 0x09) effectively shifting the column to the next tabstop + fractional_tab_policy = 'use-space' + + # If an argument group contains more than this many sub-groups (parg or kwarg + # groups) then force it to a vertical layout. + max_subgroups_hwrap = 2 + + # If a positional argument group contains more than this many arguments, then + # force it to a vertical layout. + max_pargs_hwrap = 6 + + # If a cmdline positional group consumes more than this many lines without + # nesting, then invalidate the layout (and nest) + max_rows_cmdline = 2 + + # If true, separate flow control names from their parentheses with a space + separate_ctrl_name_with_space = False + + # If true, separate function names from parentheses with a space + separate_fn_name_with_space = False + + # If a statement is wrapped to more than one line, than dangle the closing + # parenthesis on its own line. + dangle_parens = False + + # If the trailing parenthesis must be 'dangled' on its on line, then align it + # to this reference: `prefix`: the start of the statement, `prefix-indent`: + # the start of the statement, plus one indentation level, `child`: align to + # the column of the arguments + dangle_align = 'prefix' + + # If the statement spelling length (including space and parenthesis) is + # smaller than this amount, then force reject nested layouts. + min_prefix_chars = 4 + + # If the statement spelling length (including space and parenthesis) is larger + # than the tab width by more than this amount, then force reject un-nested + # layouts. + max_prefix_chars = 10 + + # If a candidate layout is wrapped horizontally but it exceeds this many + # lines, then reject the layout. + max_lines_hwrap = 2 + + # What style line endings to use in the output. + line_ending = 'unix' + + # Format command names consistently as 'lower' or 'upper' case + command_case = 'canonical' + + # Format keywords consistently as 'lower' or 'upper' case + keyword_case = 'unchanged' + + # A list of command names which should always be wrapped + always_wrap = [] + + # If true, the argument lists which are known to be sortable will be sorted + # lexicographicall + enable_sort = True + + # If true, the parsers may infer whether or not an argument list is sortable + # (without annotation). + autosort = False + + # By default, if cmake-format cannot successfully fit everything into the + # desired linewidth it will apply the last, most agressive attempt that it + # made. If this flag is True, however, cmake-format will print error, exit + # with non-zero status code, and write-out nothing + require_valid_layout = False + + # A dictionary mapping layout nodes to a list of wrap decisions. See the + # documentation for more information. + layout_passes = {} + +# ------------------------------------------------ +# Options affecting comment reflow and formatting. +# ------------------------------------------------ +with section("markup"): + + # What character to use for bulleted lists + bullet_char = '*' + + # What character to use as punctuation after numerals in an enumerated list + enum_char = '.' + + # If comment markup is enabled, don't reflow the first comment block in each + # listfile. Use this to preserve formatting of your copyright/license + # statements. + first_comment_is_literal = True + + # If comment markup is enabled, don't reflow any comment block which matches + # this (regex) pattern. Default is `None` (disabled). + literal_comment_pattern = None + + # Regular expression to match preformat fences in comments default= + # ``r'^\s*([`~]{3}[`~]*)(.*)$'`` + fence_pattern = '^\\s*([`~]{3}[`~]*)(.*)$' + + # Regular expression to match rulers in comments default= + # ``r'^\s*[^\w\s]{3}.*[^\w\s]{3}$'`` + ruler_pattern = '^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$' + + # If a comment line matches starts with this pattern then it is explicitly a + # trailing comment for the preceeding argument. Default is '#<' + explicit_trailing_pattern = '#<' + + # If a comment line starts with at least this many consecutive hash + # characters, then don't lstrip() them off. This allows for lazy hash rulers + # where the first hash char is not separated by space + hashruler_min_length = 10 + + # If true, then insert a space between the first hash char and remaining hash + # chars in a hash ruler, and normalize its length to fill the column + canonicalize_hashrulers = True + + # enable comment markup parsing and reflow + enable_markup = True + +# ---------------------------- +# Options affecting the linter +# ---------------------------- +with section("lint"): + + # a list of lint codes to disable + disabled_codes = [] + + # regular expression pattern describing valid function names + function_pattern = '[0-9a-z_]+' + + # regular expression pattern describing valid macro names + macro_pattern = '[0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with global + # (cache) scope + global_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with global + # scope (but internal semantic) + internal_var_pattern = '_[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for variables with local + # scope + local_var_pattern = '[a-z][a-z0-9_]+' + + # regular expression pattern describing valid names for privatedirectory + # variables + private_var_pattern = '_[0-9a-z_]+' + + # regular expression pattern describing valid names for public directory + # variables + public_var_pattern = '[A-Z][0-9A-Z_]+' + + # regular expression pattern describing valid names for function/macro + # arguments and loop variables. + argument_var_pattern = '[a-z][a-z0-9_]+' + + # regular expression pattern describing valid names for keywords used in + # functions or macros + keyword_pattern = '[A-Z][0-9A-Z_]+' + + # In the heuristic for C0201, how many conditionals to match within a loop in + # before considering the loop a parser. + max_conditionals_custom_parser = 2 + + # Require at least this many newlines between statements + min_statement_spacing = 1 + + # Require no more than this many newlines between statements + max_statement_spacing = 2 + max_returns = 6 + max_branches = 12 + max_arguments = 5 + max_localvars = 15 + max_statements = 50 + +# ------------------------------- +# Options affecting file encoding +# ------------------------------- +with section("encode"): + + # If true, emit the unicode byte-order mark (BOM) at the start of the file + emit_byteorder_mark = False + + # Specify the encoding of the input file. Defaults to utf-8 + input_encoding = 'utf-8' + + # Specify the encoding of the output file. Defaults to utf-8. Note that cmake + # only claims to support utf-8 so be careful when using anything else + output_encoding = 'utf-8' + +# ------------------------------------- +# Miscellaneous configurations options. +# ------------------------------------- +with section("misc"): + + # A dictionary containing any per-command configuration overrides. Currently + # only `command_case` is supported. + per_command = {} + diff --git a/.github/workflows/check-clang-format.yml b/.github/workflows/check-format.yml similarity index 71% rename from .github/workflows/check-clang-format.yml rename to .github/workflows/check-format.yml index 24f44b45ee..b3d0850ca9 100644 --- a/.github/workflows/check-clang-format.yml +++ b/.github/workflows/check-format.yml @@ -1,11 +1,11 @@ -name: Checks - clang-format +name: Checks - formatting on: pull_request: workflow_dispatch: jobs: - clang_format_check: + format_check: runs-on: ubuntu-latest container: image: ghcr.io/llnl/sundials_spack_cache:llvm-17.0.4-h4lflucc3v2vage45opbo2didtcuigsn.spack @@ -21,9 +21,21 @@ jobs: - name: Print black version run: black --version + - name: Install cmake-format + run: pip install cmakelang + + - name: Print cmake-format version + run: cmake-format --version + - name: Install fprettify run: pip install fprettify + - name: Print fprettify version + run: fprettify --version + + - name: Print clang-format version + run: clang-format --version + - name: Check out repository code uses: actions/checkout@v4 with: @@ -32,24 +44,21 @@ jobs: - name: Add safe directory run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Print clang-format version - run: clang-format --version - - name: Run checker on code run: | - ./scripts/format.sh benchmarks examples include src test + ./scripts/format.sh CMakeLists.txt benchmarks cmake examples include src test - name: Run git diff to see if anything changed run: /usr/bin/git diff --name-only --exit-code - name: Run git diff if we failed if: failure() - run: /usr/bin/git diff > clang_format.patch + run: /usr/bin/git diff > format.patch - name: Archive diff as a patch if we failed uses: actions/upload-artifact@v3 if: failure() with: - name: clang_format.patch + name: format.patch path: | - ${{ github.workspace }}/clang_format.patch + ${{ github.workspace }}/format.patch diff --git a/CMakeLists.txt b/CMakeLists.txt index b5cca95afd..989c1d7f7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,17 +26,14 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24") cmake_policy(SET CMP0135 NEW) endif() -# Project SUNDIALS (initially only C supported) -# sets PROJECT_SOURCE_DIR and PROJECT_BINARY_DIR variables. +# Project SUNDIALS (initially only C supported) sets PROJECT_SOURCE_DIR and +# PROJECT_BINARY_DIR variables. project(SUNDIALS C) # Specify the location of additional CMAKE modules set(CMAKE_MODULE_PATH - ${CMAKE_MODULE_PATH} - ${PROJECT_SOURCE_DIR}/cmake - ${PROJECT_SOURCE_DIR}/cmake/macros - ${PROJECT_SOURCE_DIR}/cmake/tpl - ) + ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake + ${PROJECT_SOURCE_DIR}/cmake/macros ${PROJECT_SOURCE_DIR}/cmake/tpl) # MACRO definitions include(SundialsCMakeMacros) @@ -44,7 +41,6 @@ include(CMakePrintHelpers) include(CheckCSourceCompiles) include(FindPackageHandleStandardArgs) - # Set some variables with info on the SUNDIALS project set(PACKAGE_BUGREPORT "sundials-users@llnl.gov") set(PACKAGE_NAME "SUNDIALS") @@ -123,9 +119,9 @@ endif() # Organize targets into folders when using an IDE set_property(GLOBAL PROPERTY USE_FOLDERS ON) -# Get correct build paths automatically, but expose LIBDIR and -# INCLUDEDIR as a regular cache variable so that a user can more -# easily see what they were set to by GNUInstallDirs. +# Get correct build paths automatically, but expose LIBDIR and INCLUDEDIR as a +# regular cache variable so that a user can more easily see what they were set +# to by GNUInstallDirs. include(GNUInstallDirs) mark_as_advanced(CLEAR CMAKE_INSTALL_LIBDIR) mark_as_advanced(CLEAR CMAKE_INSTALL_INCLUDEDIR) @@ -133,23 +129,28 @@ mark_as_advanced(CLEAR CMAKE_INSTALL_INCLUDEDIR) # Suffixes to use for static and shared targets. set(_STATIC_LIB_SUFFIX "_static" - CACHE INTERNAL "" FORCE -) + CACHE INTERNAL "" FORCE) set(_SHARED_LIB_SUFFIX "_shared" - CACHE INTERNAL "" FORCE -) + CACHE INTERNAL "" FORCE) # A list of all the alias targets created. -set(_SUNDIALS_ALIAS_TARGETS "" +set(_SUNDIALS_ALIAS_TARGETS + "" CACHE INTERNAL "" FORCE) # We default to release builds set(_DEFAULT_CMAKE_BUILD_TYPE RelWithDebInfo) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified.") - set(CMAKE_BUILD_TYPE "${_DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") + message( + STATUS + "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified." + ) + set(CMAKE_BUILD_TYPE + "${_DEFAULT_CMAKE_BUILD_TYPE}" + CACHE STRING "Choose the type of build." FORCE) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" + "MinSizeRel" "RelWithDebInfo") else() message(STATUS "Building SUNDIALS in '${CMAKE_BUILD_TYPE}' mode.") endif() @@ -192,8 +193,8 @@ include(SundialsSetupTPLs) include(SundialsBuildOptionsPost) # =============================================================== -# At this point all the configuration options are set. -# Setup the sundials_config.h. +# At this point all the configuration options are set. Setup the +# sundials_config.h. # =============================================================== include(SundialsSetupConfig) @@ -231,68 +232,56 @@ endif() # install sundials_export header file install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # install configured header file install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # install shared Fortran 2003 modules if(BUILD_FORTRAN_MODULE_INTERFACE) - # While the .mod files get generated for static and shared - # libraries, they are identical. So only install one set - # of the .mod files. + # While the .mod files get generated for static and shared libraries, they are + # identical. So only install one set of the .mod files. if(BUILD_STATIC_LIBS) install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_STATIC/ - DESTINATION ${Fortran_INSTALL_MODDIR} - ) + DESTINATION ${Fortran_INSTALL_MODDIR}) else() install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_SHARED/ - DESTINATION ${Fortran_INSTALL_MODDIR} - ) + DESTINATION ${Fortran_INSTALL_MODDIR}) endif() endif() # install license and notice files install(FILES "${PROJECT_SOURCE_DIR}/LICENSE" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") install(FILES "${PROJECT_SOURCE_DIR}/NOTICE" - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials" -) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials") # create package version file include(CMakePackageConfigHelpers) write_basic_package_version_file( SUNDIALSConfigVersion.cmake VERSION ${PACKAGE_VERSION} - COMPATIBILITY AnyNewerVersion -) + COMPATIBILITY AnyNewerVersion) # install targets install( EXPORT sundials-targets FILE SUNDIALSTargets.cmake NAMESPACE SUNDIALS:: - DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") # install SUNDIALSConfig.cmake configure_package_config_file( "${PROJECT_SOURCE_DIR}/cmake/SUNDIALSConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake" - INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfigVersion.cmake" - DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}" -) + DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}") # Export targets so build directory can be used directly export( EXPORT sundials-targets FILE "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSTargets.cmake" - NAMESPACE SUNDIALS:: -) + NAMESPACE SUNDIALS::) diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt index 980e1e230d..090c1f5b26 100644 --- a/benchmarks/CMakeLists.txt +++ b/benchmarks/CMakeLists.txt @@ -14,10 +14,10 @@ # benchmarks level CMakeLists.txt for SUNDIALS # --------------------------------------------------------------- -if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR - CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")) +if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL + "RelWithDebInfo")) message(WARNING "SUNDIALS is not being built in a \"Release\" mode, " - "benchmark performance will be affected") + "benchmark performance will be affected") endif() sundials_option(BENCHMARK_NVECTOR BOOL "NVector benchmarks are on" ON) @@ -28,13 +28,13 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-parameter") endif() -#---------------------------------------- +# ---------------------------------------- # Add specific benchmarks -#---------------------------------------- +# ---------------------------------------- if(ENABLE_MPI) -add_subdirectory(diffusion_2D) -add_subdirectory(advection_reaction_3D) + add_subdirectory(diffusion_2D) + add_subdirectory(advection_reaction_3D) endif() # Add the nvector benchmarks diff --git a/benchmarks/advection_reaction_3D/CMakeLists.txt b/benchmarks/advection_reaction_3D/CMakeLists.txt index 79c616818a..b4b953a437 100644 --- a/benchmarks/advection_reaction_3D/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/CMakeLists.txt @@ -19,4 +19,3 @@ endif() if(ENABLE_KOKKOS AND BUILD_NVECTOR_KOKKOS) add_subdirectory(kokkos) endif() - diff --git a/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt b/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt index 8a12ba022b..1bb7ac2c5e 100644 --- a/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/kokkos/CMakeLists.txt @@ -13,14 +13,17 @@ # --------------------------------------------------------------- # Add the build targets for each backend -if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) +if(BUILD_ARKODE + AND BUILD_CVODE + AND BUILD_IDA) foreach(backend ${KOKKOS_EXAMPLES_BACKENDS}) # set benchmark target name set(benchmark_target "advection_reaction_3D_kokkos.${backend}") # benchmark source files - add_executable(${benchmark_target} + add_executable( + ${benchmark_target} advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -29,32 +32,32 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) ParallelGrid.hpp check_retval.h) - # which backend to use - target_compile_definitions(${benchmark_target} PRIVATE USE_${backend}) - - # directories to include - target_include_directories(${benchmark_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS} - ) - - # libraries to link against - target_link_libraries(${benchmark_target} - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nveckokkos - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ) - - install(TARGETS ${benchmark_target} + # which backend to use + target_compile_definitions(${benchmark_target} PRIVATE USE_${backend}) + + # directories to include + target_include_directories( + ${benchmark_target} PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + # libraries to link against + target_link_libraries( + ${benchmark_target} + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nveckokkos + ${MPI_CXX_LIBRARIES} + ${EXE_EXTRA_LINK_LIBS}) + + install( + TARGETS ${benchmark_target} DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/kokkos") - install(FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py ../scripts/pickle_solution_output.py + install( + FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py + ../scripts/pickle_solution_output.py DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/kokkos") endforeach() diff --git a/benchmarks/advection_reaction_3D/raja/CMakeLists.txt b/benchmarks/advection_reaction_3D/raja/CMakeLists.txt index d816b35124..264e023b5a 100644 --- a/benchmarks/advection_reaction_3D/raja/CMakeLists.txt +++ b/benchmarks/advection_reaction_3D/raja/CMakeLists.txt @@ -13,24 +13,28 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) +if(BUILD_ARKODE + AND BUILD_CVODE + AND BUILD_IDA) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(OTHER_LIBS OpenMP::OpenMP_CXX) endif() # Set up parameters to run benchmarks with set(BENCHMARK_VAR - "--method ARK-IMEX --nls tl-newton --tf 0.01 --dont-save\;arkimex_tlnewton" - "--method ARK-DIRK --nls newton --tf 0.01 --dont-save\;arkdirk_newton" - "--method CV-BDF --nls newton --tf 0.01 --dont-save\;cvbdf_newton" - "--method IDA --nls newton --tf 0.01 --dont-save\;ida_newton") + "--method ARK-IMEX --nls tl-newton --tf 0.01 --dont-save\;arkimex_tlnewton" + "--method ARK-DIRK --nls newton --tf 0.01 --dont-save\;arkdirk_newton" + "--method CV-BDF --nls newton --tf 0.01 --dont-save\;cvbdf_newton" + "--method IDA --nls newton --tf 0.01 --dont-save\;ida_newton") # ---------------------------------------------------------------------------- # MPI only # ---------------------------------------------------------------------------- - add_executable(advection_reaction_3D_raja + add_executable( + advection_reaction_3D_raja advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -41,39 +45,41 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) backends.hpp) # ensure the linker language is reset to CXX - set_target_properties(advection_reaction_3D_raja PROPERTIES LINKER_LANGUAGE CXX) - - target_include_directories(advection_reaction_3D_raja - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nvecserial - RAJA - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) + set_target_properties(advection_reaction_3D_raja PROPERTIES LINKER_LANGUAGE + CXX) + + target_include_directories( + advection_reaction_3D_raja PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nvecserial + RAJA + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) install(TARGETS advection_reaction_3D_raja - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") - install(FILES README.md ../scripts/compare_error.py ../scripts/compute_error.py ../scripts/pickle_solution_output.py - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + install(FILES README.md ../scripts/compare_error.py + ../scripts/compute_error.py ../scripts/pickle_solution_output.py + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja advection_reaction_3D_raja advection_reaction_3D + sundials_add_benchmark( + advection_reaction_3D_raja advection_reaction_3D_raja + advection_reaction_3D NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS} BENCHMARK_ARGS ${benchmark_args} - IDENTIFIER ${identifier} - ) + IDENTIFIER ${identifier}) endforeach() # ---------------------------------------------------------------------------- @@ -82,13 +88,14 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) if(BUILD_NVECTOR_CUDA) - set_source_files_properties(advection_reaction_3D.cpp - PROPERTIES LANGUAGE CUDA) + set_source_files_properties(advection_reaction_3D.cpp PROPERTIES LANGUAGE + CUDA) set_source_files_properties(arkode_driver.cpp PROPERTIES LANGUAGE CUDA) set_source_files_properties(cvode_driver.cpp PROPERTIES LANGUAGE CUDA) set_source_files_properties(ida_driver.cpp PROPERTIES LANGUAGE CUDA) - add_executable(advection_reaction_3D_raja_mpicuda + add_executable( + advection_reaction_3D_raja_mpicuda advection_reaction_3D.cpp arkode_driver.cpp cvode_driver.cpp @@ -100,35 +107,36 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) # ensure the linker language is reset to CXX set_target_properties(advection_reaction_3D_raja_mpicuda - PROPERTIES LINKER_LANGUAGE CXX) - - target_include_directories(advection_reaction_3D_raja_mpicuda - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja_mpicuda - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nveccuda - RAJA - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) - - target_compile_definitions(advection_reaction_3D_raja_mpicuda PRIVATE USE_CUDA_NVEC) + PROPERTIES LINKER_LANGUAGE CXX) + + target_include_directories( + advection_reaction_3D_raja_mpicuda PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja_mpicuda + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nveccuda + RAJA + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) + + target_compile_definitions(advection_reaction_3D_raja_mpicuda + PRIVATE USE_CUDA_NVEC) install(TARGETS advection_reaction_3D_raja_mpicuda - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja_mpicuda advection_reaction_3D_raja_mpicuda advection_reaction_3D - ENABLE_GPU + sundials_add_benchmark( + advection_reaction_3D_raja_mpicuda advection_reaction_3D_raja_mpicuda + advection_reaction_3D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} BENCHMARK_ARGS ${benchmark_args} IDENTIFIER ${identifier}) @@ -141,7 +149,8 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) if(BUILD_NVECTOR_HIP) - add_executable(advection_reaction_3D_raja_mpihip + add_executable( + advection_reaction_3D_raja_mpihip advection_reaction_3D.cpp advection_reaction_3D.hpp arkode_driver.cpp @@ -152,34 +161,35 @@ if(BUILD_ARKODE AND BUILD_CVODE AND BUILD_IDA) check_retval.h backends.hpp) - target_include_directories(advection_reaction_3D_raja_mpihip - PRIVATE - ${PROJECT_SOURCE_DIR}/utilities - ${MPI_CXX_INCLUDE_DIRS}) - - target_link_libraries(advection_reaction_3D_raja_mpihip - PRIVATE - sundials_arkode - sundials_cvode - sundials_ida - sundials_nvecmpiplusx - sundials_nvechip - RAJA - hip::device - ${MPI_CXX_LIBRARIES} - ${OTHER_LIBS}) - - target_compile_definitions(advection_reaction_3D_raja_mpihip PRIVATE USE_HIP_NVEC) + target_include_directories( + advection_reaction_3D_raja_mpihip PRIVATE ${PROJECT_SOURCE_DIR}/utilities + ${MPI_CXX_INCLUDE_DIRS}) + + target_link_libraries( + advection_reaction_3D_raja_mpihip + PRIVATE sundials_arkode + sundials_cvode + sundials_ida + sundials_nvecmpiplusx + sundials_nvechip + RAJA + hip::device + ${MPI_CXX_LIBRARIES} + ${OTHER_LIBS}) + + target_compile_definitions(advection_reaction_3D_raja_mpihip + PRIVATE USE_HIP_NVEC) install(TARGETS advection_reaction_3D_raja_mpihip - DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/advection_reaction_3D/raja") foreach(benchmark_tuple ${BENCHMARK_VAR}) list(GET benchmark_tuple 0 benchmark_args) list(GET benchmark_tuple 1 identifier) - sundials_add_benchmark(advection_reaction_3D_raja_mpihip advection_reaction_3D_raja_mpihip advection_reaction_3D - ENABLE_GPU + sundials_add_benchmark( + advection_reaction_3D_raja_mpihip advection_reaction_3D_raja_mpihip + advection_reaction_3D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} BENCHMARK_ARGS ${benchmark_args} IDENTIFIER ${identifier}) diff --git a/benchmarks/diffusion_2D/CMakeLists.txt b/benchmarks/diffusion_2D/CMakeLists.txt index f64d3e90f3..f26f7397c2 100644 --- a/benchmarks/diffusion_2D/CMakeLists.txt +++ b/benchmarks/diffusion_2D/CMakeLists.txt @@ -12,13 +12,13 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -if(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA) +if(BUILD_ARKODE + OR BUILD_CVODE + OR BUILD_IDA) # Shared sources - set(shared_sources - diffusion_2D.hpp - diffusion_2D.cpp - preconditioner_jacobi.cpp) + set(shared_sources diffusion_2D.hpp diffusion_2D.cpp + preconditioner_jacobi.cpp) # Benchmark prefix set(benchmark_prefix ${SUNDIALS_SOURCE_DIR}/benchmarks/diffusion_2D/) @@ -33,7 +33,6 @@ if(BUILD_ARKODE OR BUILD_CVODE OR BUILD_IDA) add_subdirectory(mpi_gpu) endif() - install(FILES README.md - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + install(FILES README.md DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") endif() diff --git a/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt b/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt index beb5d1a439..bedab66e97 100644 --- a/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt +++ b/benchmarks/diffusion_2D/mpi_gpu/CMakeLists.txt @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------ # list of tests -set(tests ) +set(tests) if(BUILD_ARKODE) if(BUILD_NVECTOR_CUDA) @@ -50,13 +50,8 @@ foreach(test_tuple ${tests}) list(GET test_tuple 1 problem_type) list(GET test_tuple 2 backend) - set(sources - ${benchmark_prefix}/main_${package}.cpp - ${shared_sources} - buffers.cpp - diffusion.cpp - solution.cpp - utils.cpp) + set(sources ${benchmark_prefix}/main_${package}.cpp ${shared_sources} + buffers.cpp diffusion.cpp solution.cpp utils.cpp) if("${backend}" STREQUAL "USE_CUDA") @@ -74,18 +69,13 @@ foreach(test_tuple ${tests}) add_executable(${target} ${sources}) - # if("${backend}" STREQUAL "USE_CUDA") - # sundials_add_benchmark(${target} ${target} diffusion_2D - # ENABLE_GPU - # NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} - # ) - #endif() + # if("${backend}" STREQUAL "USE_CUDA") sundials_add_benchmark(${target} + # ${target} diffusion_2D ENABLE_GPU NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} ) + # endif() if("${backend}" STREQUAL "USE_HIP") - sundials_add_benchmark(${target} ${target} diffusion_2D - ENABLE_GPU - NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS} - ) + sundials_add_benchmark(${target} ${target} diffusion_2D ENABLE_GPU + NUM_CORES ${SUNDIALS_BENCHMARK_NUM_GPUS}) endif() @@ -99,11 +89,9 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecmpiplusx - sundials_nveccuda) + target_link_libraries( + ${target} PRIVATE sundials_${package} sundials_nvecmpiplusx + sundials_nveccuda) else() @@ -111,12 +99,9 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecmpiplusx - sundials_nvechip - hip::device) + target_link_libraries( + ${target} PRIVATE sundials_${package} sundials_nvecmpiplusx + sundials_nvechip hip::device) endif() @@ -125,6 +110,6 @@ foreach(test_tuple ${tests}) target_link_libraries(${target} PRIVATE ${MPI_CXX_LIBRARIES}) install(TARGETS ${target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") endforeach() diff --git a/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt b/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt index 5e1e5c8862..a5cccdf1ed 100644 --- a/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt +++ b/benchmarks/diffusion_2D/mpi_serial/CMakeLists.txt @@ -13,7 +13,7 @@ # ------------------------------------------------------------------------------ # list of tests -set(tests ) +set(tests) if(BUILD_ARKODE) list(APPEND tests "arkode\;BENCHMARK_ODE") @@ -34,13 +34,8 @@ foreach(test_tuple ${tests}) list(GET test_tuple 0 package) list(GET test_tuple 1 problem_type) - set(sources - ${benchmark_prefix}/main_${package}.cpp - ${shared_sources} - buffers.cpp - diffusion.cpp - solution.cpp - utils.cpp) + set(sources ${benchmark_prefix}/main_${package}.cpp ${shared_sources} + buffers.cpp diffusion.cpp solution.cpp utils.cpp) # set the target name set(target ${package}_diffusion_2D_mpi) @@ -56,25 +51,19 @@ foreach(test_tuple ${tests}) target_include_directories(${target} PRIVATE ${benchmark_prefix}) - target_link_libraries(${target} - PRIVATE - sundials_${package} - sundials_nvecparallel - MPI::MPI_CXX) + target_link_libraries(${target} PRIVATE sundials_${package} + sundials_nvecparallel MPI::MPI_CXX) if(BUILD_SUNLINSOL_SUPERLUDIST) target_compile_definitions(${target} PRIVATE USE_SUPERLU_DIST) - target_link_libraries(${target} - PRIVATE - sundials_sunlinsolsuperludist - sundials_sunmatrixslunrloc) + target_link_libraries(${target} PRIVATE sundials_sunlinsolsuperludist + sundials_sunmatrixslunrloc) endif() install(TARGETS ${target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/diffusion_2D") sundials_add_benchmark(${target} ${target} diffusion_2D - NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS} - ) + NUM_CORES ${SUNDIALS_BENCHMARK_NUM_CPUS}) endforeach() diff --git a/benchmarks/nvector/cuda/CMakeLists.txt b/benchmarks/nvector/cuda/CMakeLists.txt index d4db7b8c4d..2a6741fc40 100644 --- a/benchmarks/nvector/cuda/CMakeLists.txt +++ b/benchmarks/nvector/cuda/CMakeLists.txt @@ -14,8 +14,8 @@ message(STATUS "Added CUDA NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_cuda_benchmark +sundials_add_nvector_benchmark( + nvector_cuda_benchmark SOURCES test_nvector_performance_cuda.cu SUNDIALS_TARGETS sundials_nveccuda - INSTALL_SUBDIR nvector/cuda - ) + INSTALL_SUBDIR nvector/cuda) diff --git a/benchmarks/nvector/hip/CMakeLists.txt b/benchmarks/nvector/hip/CMakeLists.txt index f3b79304d1..f19d4df759 100644 --- a/benchmarks/nvector/hip/CMakeLists.txt +++ b/benchmarks/nvector/hip/CMakeLists.txt @@ -14,8 +14,8 @@ message(STATUS "Added HIP NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_hip_benchmark +sundials_add_nvector_benchmark( + nvector_hip_benchmark SOURCES test_nvector_performance_hip.cpp SUNDIALS_TARGETS sundials_nvechip - INSTALL_SUBDIR nvector/hip - ) + INSTALL_SUBDIR nvector/hip) diff --git a/benchmarks/nvector/kokkos/CMakeLists.txt b/benchmarks/nvector/kokkos/CMakeLists.txt index 43e7177166..2ca1539df0 100644 --- a/benchmarks/nvector/kokkos/CMakeLists.txt +++ b/benchmarks/nvector/kokkos/CMakeLists.txt @@ -14,15 +14,16 @@ message(STATUS "Added Kokkos NVECTOR benchmark") foreach(backend ${KOKKOS_EXAMPLES_BACKENDS}) - sundials_add_nvector_benchmark(test_nvector_performance_kokkos.${backend} + sundials_add_nvector_benchmark( + test_nvector_performance_kokkos.${backend} SOURCES test_nvector_performance_kokkos.cpp SUNDIALS_TARGETS sundials_core sundials_nveckokkos - INSTALL_SUBDIR nvector/kokkos - ) + INSTALL_SUBDIR nvector/kokkos) - target_compile_definitions(test_nvector_performance_kokkos.${backend} PRIVATE USE_${backend}) + target_compile_definitions(test_nvector_performance_kokkos.${backend} + PRIVATE USE_${backend}) install(TARGETS test_nvector_performance_kokkos.${backend} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/") endforeach() diff --git a/benchmarks/nvector/mpiplusx/CMakeLists.txt b/benchmarks/nvector/mpiplusx/CMakeLists.txt index ec6c3c49d9..6a1fd9c1f5 100644 --- a/benchmarks/nvector/mpiplusx/CMakeLists.txt +++ b/benchmarks/nvector/mpiplusx/CMakeLists.txt @@ -14,9 +14,9 @@ message(STATUS "Added MPIPlusX NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_mpiplusx_benchmark +sundials_add_nvector_benchmark( + nvector_mpiplusx_benchmark SOURCES test_nvector_performance_mpiplusx.c SUNDIALS_TARGETS sundials_nvecserial sundials_nvecmpiplusx LINK_LIBRARIES MPI::MPI_CXX - INSTALL_SUBDIR nvector/mpiplusx - ) \ No newline at end of file + INSTALL_SUBDIR nvector/mpiplusx) diff --git a/benchmarks/nvector/openmp/CMakeLists.txt b/benchmarks/nvector/openmp/CMakeLists.txt index 96c9f9e3b0..0980bb8ef4 100644 --- a/benchmarks/nvector/openmp/CMakeLists.txt +++ b/benchmarks/nvector/openmp/CMakeLists.txt @@ -16,14 +16,13 @@ message(STATUS "Added OpenMP NVECTOR benchmark") -# Set-up linker flags and link libraries -# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") -# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}") +# Set-up linker flags and link libraries set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} +# ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} +# ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} +# ${OpenMP_C_FLAGS}") -sundials_add_nvector_benchmark(nvector_openmp_benchmark +sundials_add_nvector_benchmark( + nvector_openmp_benchmark SOURCES test_nvector_performance_openmp.c SUNDIALS_TARGETS sundials_nvecopenmp - INSTALL_SUBDIR nvector/openmp - ) - + INSTALL_SUBDIR nvector/openmp) diff --git a/benchmarks/nvector/openmpdev/CMakeLists.txt b/benchmarks/nvector/openmpdev/CMakeLists.txt index c78d4821d6..54789c9a95 100644 --- a/benchmarks/nvector/openmpdev/CMakeLists.txt +++ b/benchmarks/nvector/openmpdev/CMakeLists.txt @@ -22,13 +22,14 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}") -add_executable(test_nvector_performance_openmpdev - test_nvector_performance_openmpdev.c - ../test_nvector_performance.c +add_executable( + test_nvector_performance_openmpdev + test_nvector_performance_openmpdev.c ../test_nvector_performance.c ../../../src/sundials/sundials_nvector.c) # folder to organize targets in an IDE -set_target_properties(test_nvector_performance_openmp PROPERTIES FOLDER "Benchmarks") +set_target_properties(test_nvector_performance_openmp PROPERTIES FOLDER + "Benchmarks") target_include_directories(test_nvector_performance_openmpdev PRIVATE ..) @@ -36,4 +37,4 @@ target_include_directories(test_nvector_performance_openmpdev PRIVATE ..) target_link_libraries(test_nvector_performance_openmpdev ${SUNDIALS_LIBS}) install(TARGETS test_nvector_performance_openmpdev - DESTINATION "${BENCHMARKS_INSTALL_PATH}/nvector/openmpdev") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/nvector/openmpdev") diff --git a/benchmarks/nvector/parallel/CMakeLists.txt b/benchmarks/nvector/parallel/CMakeLists.txt index c096594f3d..87ed3138ba 100644 --- a/benchmarks/nvector/parallel/CMakeLists.txt +++ b/benchmarks/nvector/parallel/CMakeLists.txt @@ -14,9 +14,9 @@ message(STATUS "Added Parallel NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_parallel_benchmark +sundials_add_nvector_benchmark( + nvector_parallel_benchmark SOURCES test_nvector_performance_parallel.c SUNDIALS_TARGETS sundials_nvecparallel LINK_LIBRARIES MPI::MPI_CXX - INSTALL_SUBDIR nvector/parallel - ) + INSTALL_SUBDIR nvector/parallel) diff --git a/benchmarks/nvector/parhyp/CMakeLists.txt b/benchmarks/nvector/parhyp/CMakeLists.txt index 7e05ff3a0f..216085064b 100644 --- a/benchmarks/nvector/parhyp/CMakeLists.txt +++ b/benchmarks/nvector/parhyp/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added hypre NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_parhyp_benchmark +sundials_add_nvector_benchmark( + nvector_parhyp_benchmark SOURCES test_nvector_performance_parhyp.c SUNDIALS_TARGETS sundials_nvecparhyp LINK_LIBRARIES MPI::MPI_C SUNDIALS::HYPRE - INSTALL_SUBDIR nvector/parhyp - ) + INSTALL_SUBDIR nvector/parhyp) diff --git a/benchmarks/nvector/petsc/CMakeLists.txt b/benchmarks/nvector/petsc/CMakeLists.txt index 63e2f8a1e9..fd9183593d 100644 --- a/benchmarks/nvector/petsc/CMakeLists.txt +++ b/benchmarks/nvector/petsc/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added PETSc NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_petsc_benchmark +sundials_add_nvector_benchmark( + nvector_petsc_benchmark SOURCES test_nvector_performance_petsc.c SUNDIALS_TARGETS sundials_nvecpetsc LINK_LIBRARIES MPI::MPI_C PUBLIC SUNDIALS::PETSC - INSTALL_SUBDIR nvector/petsc - ) + INSTALL_SUBDIR nvector/petsc) diff --git a/benchmarks/nvector/pthreads/CMakeLists.txt b/benchmarks/nvector/pthreads/CMakeLists.txt index ae7ec038c0..bc7cac35f2 100644 --- a/benchmarks/nvector/pthreads/CMakeLists.txt +++ b/benchmarks/nvector/pthreads/CMakeLists.txt @@ -16,9 +16,9 @@ message(STATUS "Added PThreads NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_pthreads_benchmark +sundials_add_nvector_benchmark( + nvector_pthreads_benchmark SOURCES test_nvector_performance_pthreads.c SUNDIALS_TARGETS sundials_nvecpthreads LINK_LIBRARIES Threads::Threads - INSTALL_SUBDIR nvector/pthreads - ) + INSTALL_SUBDIR nvector/pthreads) diff --git a/benchmarks/nvector/raja/CMakeLists.txt b/benchmarks/nvector/raja/CMakeLists.txt index 4fe8575dbe..9c37eb6d99 100644 --- a/benchmarks/nvector/raja/CMakeLists.txt +++ b/benchmarks/nvector/raja/CMakeLists.txt @@ -37,13 +37,12 @@ foreach(backend ${SUNDIALS_RAJA_BACKENDS}) continue() endif() - sundials_add_nvector_benchmark(${example_target} + sundials_add_nvector_benchmark( + ${example_target} SOURCES test_nvector_performance_raja.cpp - SUNDIALS_TARGETS sundials_nvecraja - ) + SUNDIALS_TARGETS sundials_nvecraja) - target_compile_definitions(${example_target} - PRIVATE ${_defines}) + target_compile_definitions(${example_target} PRIVATE ${_defines}) if(backend MATCHES "CUDA") set_target_properties(${example_target} PROPERTIES LINKER_LANGUAGE CXX) @@ -54,6 +53,6 @@ foreach(backend ${SUNDIALS_RAJA_BACKENDS}) endif() install(TARGETS ${example_target} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/benchmarks/nvector/raja") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/benchmarks/nvector/raja") endforeach() diff --git a/benchmarks/nvector/serial/CMakeLists.txt b/benchmarks/nvector/serial/CMakeLists.txt index 01bb5c1c54..edac263500 100644 --- a/benchmarks/nvector/serial/CMakeLists.txt +++ b/benchmarks/nvector/serial/CMakeLists.txt @@ -16,8 +16,8 @@ message(STATUS "Added Serial NVECTOR benchmark") -sundials_add_nvector_benchmark(nvector_serial_benchmark +sundials_add_nvector_benchmark( + nvector_serial_benchmark SOURCES test_nvector_performance_serial.c SUNDIALS_TARGETS sundials_nvecserial - INSTALL_SUBDIR nvector/serial - ) + INSTALL_SUBDIR nvector/serial) diff --git a/benchmarks/nvector/sycl/CMakeLists.txt b/benchmarks/nvector/sycl/CMakeLists.txt index 6ff0ffbb9f..b92c202b53 100644 --- a/benchmarks/nvector/sycl/CMakeLists.txt +++ b/benchmarks/nvector/sycl/CMakeLists.txt @@ -16,7 +16,8 @@ message(STATUS "Added SYCL NVECTOR benchmark") set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks) -sundials_add_nvector_benchmark(test_nvector_performance_sycl +sundials_add_nvector_benchmark( + test_nvector_performance_sycl SOURCES test_nvector_performance_sycl.cpp SUNDIALS_TARGETS sundials_nvecsycl INSTALL_SUBDIR nvector/sycl) diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index 01d6969bc6..2bf6acd14f 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -16,8 +16,8 @@ # --------------------------------------------------------------- # --------------------------------------------------------------- -# Option to use specialized fused kernels in the packages. -# Currently only available in CVODE. +# Option to use specialized fused kernels in the packages. Currently only +# available in CVODE. # --------------------------------------------------------------- if(ENABLE_CUDA OR ENABLE_HIP) @@ -26,9 +26,11 @@ else() set(CUDA_OR_HIP FALSE) endif() -sundials_option(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL "Build specialized fused GPU kernels" OFF - DEPENDS_ON BUILD_CVODE CUDA_OR_HIP - DEPENDS_ON_THROW_ERROR) +sundials_option( + SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL + "Build specialized fused GPU kernels" OFF + DEPENDS_ON BUILD_CVODE CUDA_OR_HIP + DEPENDS_ON_THROW_ERROR) # --------------------------------------------------------------- # Options to enable/disable build for NVECTOR modules. @@ -38,81 +40,100 @@ sundials_option(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS BOOL "Build specialized fus set(BUILD_NVECTOR_SERIAL TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_SERIAL") -sundials_option(BUILD_NVECTOR_CUDA BOOL "Build the NVECTOR_CUDA module (requires CUDA)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER - ADVANCED) +sundials_option( + BUILD_NVECTOR_CUDA BOOL "Build the NVECTOR_CUDA module (requires CUDA)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_CUDA") -sundials_option(BUILD_NVECTOR_HIP BOOL "Build the NVECTOR_HIP module (requires HIP)" ON - DEPENDS_ON ENABLE_HIP - ADVANCED) +sundials_option( + BUILD_NVECTOR_HIP BOOL "Build the NVECTOR_HIP module (requires HIP)" ON + DEPENDS_ON ENABLE_HIP + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_HIP") -sundials_option(BUILD_NVECTOR_SYCL BOOL "Build the NVECTOR_SYCL module (requires SYCL)" ON - DEPENDS_ON ENABLE_SYCL - ADVANCED) +sundials_option( + BUILD_NVECTOR_SYCL BOOL "Build the NVECTOR_SYCL module (requires SYCL)" ON + DEPENDS_ON ENABLE_SYCL + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_SYCL") -sundials_option(BUILD_NVECTOR_MANYVECTOR BOOL "Build the NVECTOR_MANYVECTOR module" ON - ADVANCED) +sundials_option(BUILD_NVECTOR_MANYVECTOR BOOL + "Build the NVECTOR_MANYVECTOR module" ON ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MANYVECTOR") -sundials_option(BUILD_NVECTOR_MPIMANYVECTOR BOOL "Build the NVECTOR_MPIMANYVECTOR module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND - ADVANCED) +sundials_option( + BUILD_NVECTOR_MPIMANYVECTOR BOOL + "Build the NVECTOR_MPIMANYVECTOR module (requires MPI)" ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MPIMANYVECTOR") -sundials_option(BUILD_NVECTOR_MPIPLUSX BOOL "Build the NVECTOR_MPIPLUSX module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND BUILD_NVECTOR_MPIMANYVECTOR - ADVANCED) +sundials_option( + BUILD_NVECTOR_MPIPLUSX BOOL "Build the NVECTOR_MPIPLUSX module (requires MPI)" + ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND BUILD_NVECTOR_MPIMANYVECTOR + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_MPIPLUSX") -sundials_option(BUILD_NVECTOR_PARALLEL BOOL "Build the NVECTOR_PARALLEL module (requires MPI)" ON - DEPENDS_ON ENABLE_MPI MPI_C_FOUND - ADVANCED) +sundials_option( + BUILD_NVECTOR_PARALLEL BOOL "Build the NVECTOR_PARALLEL module (requires MPI)" + ON + DEPENDS_ON ENABLE_MPI MPI_C_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PARALLEL") -sundials_option(BUILD_NVECTOR_OPENMP BOOL "Build the NVECTOR_OPENMP module" ON - DEPENDS_ON ENABLE_OPENMP - ADVANCED) +sundials_option( + BUILD_NVECTOR_OPENMP BOOL "Build the NVECTOR_OPENMP module" ON + DEPENDS_ON ENABLE_OPENMP + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_OPENMP") -sundials_option(BUILD_NVECTOR_OPENMPDEV BOOL "Build the NVECTOR_OPENMPDEV module" ON - DEPENDS_ON ENABLE_OPENMP_DEVICE OPENMP_SUPPORTS_DEVICE_OFFLOADING - ADVANCED) +sundials_option( + BUILD_NVECTOR_OPENMPDEV BOOL "Build the NVECTOR_OPENMPDEV module" ON + DEPENDS_ON ENABLE_OPENMP_DEVICE OPENMP_SUPPORTS_DEVICE_OFFLOADING + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_OPENMPDEV") -sundials_option(BUILD_NVECTOR_PARHYP BOOL "Build the NVECTOR_PARHYP module (requires hypre)" ON - DEPENDS_ON ENABLE_HYPRE HYPRE_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_PARHYP BOOL "Build the NVECTOR_PARHYP module (requires hypre)" + ON + DEPENDS_ON ENABLE_HYPRE HYPRE_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PARHYP") -sundials_option(BUILD_NVECTOR_PETSC BOOL "Build the NVECTOR_PETSC module (requires PETSc)" ON - DEPENDS_ON ENABLE_PETSC PETSC_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_PETSC BOOL "Build the NVECTOR_PETSC module (requires PETSc)" ON + DEPENDS_ON ENABLE_PETSC PETSC_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PETSC") -sundials_option(BUILD_NVECTOR_PTHREADS BOOL "Build the NVECTOR_PTHREADS module" ON - DEPENDS_ON ENABLE_PTHREAD - ADVANCED) +sundials_option( + BUILD_NVECTOR_PTHREADS BOOL "Build the NVECTOR_PTHREADS module" ON + DEPENDS_ON ENABLE_PTHREAD + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_PTHREADS") -sundials_option(BUILD_NVECTOR_RAJA BOOL "Build the NVECTOR_RAJA module (requires RAJA)" ON - DEPENDS_ON ENABLE_RAJA - ADVANCED) +sundials_option( + BUILD_NVECTOR_RAJA BOOL "Build the NVECTOR_RAJA module (requires RAJA)" ON + DEPENDS_ON ENABLE_RAJA + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_RAJA") -sundials_option(BUILD_NVECTOR_TRILINOS BOOL "Build the NVECTOR_TRILINOS module (requires Trilinos)" ON - DEPENDS_ON ENABLE_TRILINOS Trilinos_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_TRILINOS BOOL + "Build the NVECTOR_TRILINOS module (requires Trilinos)" ON + DEPENDS_ON ENABLE_TRILINOS Trilinos_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_TRILINOS") -sundials_option(BUILD_NVECTOR_KOKKOS BOOL "Build the NVECTOR_KOKKOS module (requires Kokkos)" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS - ADVANCED) +sundials_option( + BUILD_NVECTOR_KOKKOS BOOL "Build the NVECTOR_KOKKOS module (requires Kokkos)" + ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_NVECTOR_KOKKOS") - # --------------------------------------------------------------- # Options to enable/disable build for SUNMATRIX modules. # --------------------------------------------------------------- @@ -129,34 +150,47 @@ set(_COMPATIBLE_INDEX_SIZE FALSE) if(SUNDIALS_INDEX_SIZE MATCHES "32") set(_COMPATIBLE_INDEX_SIZE TRUE) endif() -sundials_option(BUILD_SUNMATRIX_CUSPARSE BOOL "Build the SUNMATRIX_CUSPARSE module (requires CUDA and 32-bit indexing)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER _COMPATIBLE_INDEX_SIZE BUILD_NVECTOR_CUDA - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_CUSPARSE BOOL + "Build the SUNMATRIX_CUSPARSE module (requires CUDA and 32-bit indexing)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER _COMPATIBLE_INDEX_SIZE + BUILD_NVECTOR_CUDA + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_CUSPARSE") -sundials_option(BUILD_SUNMATRIX_GINKGO BOOL "Build the SUNMATRIX_GINKGO module (requires Ginkgo)" ON - DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_GINKGO BOOL + "Build the SUNMATRIX_GINKGO module (requires Ginkgo)" ON + DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_GINKGO") -sundials_option(BUILD_SUNMATRIX_KOKKOSDENSE BOOL "Build the SUNMATRIX_KOKKOSDENSE module" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS KOKKOS_KERNELS_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_KOKKOSDENSE BOOL "Build the SUNMATRIX_KOKKOSDENSE module" ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS + KOKKOS_KERNELS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_KOKKOSDENSE") -sundials_option(BUILD_SUNMATRIX_MAGMADENSE BOOL "Build the SUNMATRIX_MAGMADENSE module (requires MAGMA)" ON - DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_MAGMADENSE BOOL + "Build the SUNMATRIX_MAGMADENSE module (requires MAGMA)" ON + DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_MAGMADENSE") -sundials_option(BUILD_SUNMATRIX_ONEMKLDENSE BOOL "Build the SUNMATRIX_ONEMKLDENSE module (requires oneMKL)" ON - DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_ONEMKLDENSE BOOL + "Build the SUNMATRIX_ONEMKLDENSE module (requires oneMKL)" ON + DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_ONEMKLDENSE") -sundials_option(BUILD_SUNMATRIX_SLUNRLOC BOOL "Build the SUNMATRIX_SLUNRLOC module (requires SuperLU_DIST)" ON - DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS - ADVANCED) +sundials_option( + BUILD_SUNMATRIX_SLUNRLOC BOOL + "Build the SUNMATRIX_SLUNRLOC module (requires SuperLU_DIST)" ON + DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNMATRIX_SLUNRLOC") # --------------------------------------------------------------- @@ -179,57 +213,76 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SPGMR") set(BUILD_SUNLINSOL_SPTFQMR TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SPTFQMR") -sundials_option(BUILD_SUNLINSOL_CUSOLVERSP BOOL "Build the SUNLINSOL_CUSOLVERSP module (requires CUDA and 32-bit indexing)" ON - DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER BUILD_NVECTOR_CUDA BUILD_SUNMATRIX_CUSPARSE - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_CUSOLVERSP BOOL + "Build the SUNLINSOL_CUSOLVERSP module (requires CUDA and 32-bit indexing)" ON + DEPENDS_ON ENABLE_CUDA CMAKE_CUDA_COMPILER BUILD_NVECTOR_CUDA + BUILD_SUNMATRIX_CUSPARSE + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_CUSOLVERSP") -sundials_option(BUILD_SUNLINSOL_GINKGO BOOL "Build the SUNLINSOL_GINKGO module (requires Ginkgo)" ON - DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_GINKGO BOOL + "Build the SUNLINSOL_GINKGO module (requires Ginkgo)" ON + DEPENDS_ON ENABLE_GINKGO GINKGO_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_GINKGO") -sundials_option(BUILD_SUNLINSOL_KLU BOOL "Build the SUNLINSOL_KLU module (requires KLU)" ON - DEPENDS_ON ENABLE_KLU KLU_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_KLU BOOL "Build the SUNLINSOL_KLU module (requires KLU)" ON + DEPENDS_ON ENABLE_KLU KLU_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_KLU") -sundials_option(BUILD_SUNLINSOL_KOKKOSDENSE BOOL "Build the SUNLINSOL_KOKKOSDENSE module" ON - DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS KOKKOS_KERNELS_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_KOKKOSDENSE BOOL "Build the SUNLINSOL_KOKKOSDENSE module" ON + DEPENDS_ON ENABLE_KOKKOS KOKKOS_WORKS ENABLE_KOKKOS_KERNELS + KOKKOS_KERNELS_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_KOKKOSDENSE") -sundials_option(BUILD_SUNLINSOL_LAPACKBAND BOOL "Build the SUNLINSOL_LAPACKBAND module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_LAPACKBAND BOOL + "Build the SUNLINSOL_LAPACKBAND module (requires LAPACK)" ON + DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKBAND") -sundials_option(BUILD_SUNLINSOL_LAPACKDENSE BOOL "Build the SUNLINSOL_LAPACKDENSE module (requires LAPACK)" ON - DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_LAPACKDENSE BOOL + "Build the SUNLINSOL_LAPACKDENSE module (requires LAPACK)" ON + DEPENDS_ON ENABLE_LAPACK LAPACK_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_LAPACKDENSE") -sundials_option(BUILD_SUNLINSOL_MAGMADENSE BOOL "Build the SUNLINSOL_MAGMADENSE module (requires MAGMA)" ON - DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_MAGMADENSE BOOL + "Build the SUNLINSOL_MAGMADENSE module (requires MAGMA)" ON + DEPENDS_ON ENABLE_MAGMA MAGMA_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_MAGMADENSE") -sundials_option(BUILD_SUNLINSOL_ONEMKLDENSE BOOL "Build the SUNLINSOL_ONEMKLDENSE module (requires oneMKL)" ON - DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_ONEMKLDENSE BOOL + "Build the SUNLINSOL_ONEMKLDENSE module (requires oneMKL)" ON + DEPENDS_ON ENABLE_ONEMKL ONEMKL_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_ONEMKLDENSE") -sundials_option(BUILD_SUNLINSOL_SUPERLUDIST BOOL "Build the SUNLINSOL_SUPERLUDIST module (requires SUPERLUDIST)" ON - DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS BUILD_SUNMATRIX_SLUNRLOC - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_SUPERLUDIST BOOL + "Build the SUNLINSOL_SUPERLUDIST module (requires SUPERLUDIST)" ON + DEPENDS_ON ENABLE_SUPERLUDIST SUPERLUDIST_WORKS BUILD_SUNMATRIX_SLUNRLOC + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SUPERLUDIST") -sundials_option(BUILD_SUNLINSOL_SUPERLUMT BOOL "Build the SUNLINSOL_SUPERLUMT module (requires SUPERLUMT)" ON - DEPENDS_ON ENABLE_SUPERLUMT SUPERLUMT_WORKS - ADVANCED) +sundials_option( + BUILD_SUNLINSOL_SUPERLUMT BOOL + "Build the SUNLINSOL_SUPERLUMT module (requires SUPERLUMT)" ON + DEPENDS_ON ENABLE_SUPERLUMT SUPERLUMT_WORKS + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNLINSOL_SUPERLUMT") - # --------------------------------------------------------------- # Options to enable/disable build for SUNNONLINSOL modules. # --------------------------------------------------------------- @@ -240,7 +293,9 @@ list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_NEWTON") set(BUILD_SUNNONLINSOL_FIXEDPOINT TRUE) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_FIXEDPOINT") -sundials_option(BUILD_SUNNONLINSOL_PETSCSNES BOOL "Build the SUNNONLINSOL_PETSCSNES module (requires PETSc)" ON - DEPENDS_ON ENABLE_PETSC PETSC_FOUND - ADVANCED) +sundials_option( + BUILD_SUNNONLINSOL_PETSCSNES BOOL + "Build the SUNNONLINSOL_PETSCSNES module (requires PETSc)" ON + DEPENDS_ON ENABLE_PETSC PETSC_FOUND + ADVANCED) list(APPEND SUNDIALS_BUILD_LIST "BUILD_SUNNONLINSOL_PETSCSNES") diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 3c3f6b16cb..048137ff2d 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -33,7 +33,8 @@ endif() set(DOCSTR "single, double, or extended") sundials_option(SUNDIALS_PRECISION STRING "${DOCSTR}" "DOUBLE") string(TOUPPER ${SUNDIALS_PRECISION} _upper_SUNDIALS_PRECISION) -force_variable(SUNDIALS_PRECISION STRING "${DOCSTR}" ${_upper_SUNDIALS_PRECISION}) +force_variable(SUNDIALS_PRECISION STRING "${DOCSTR}" + ${_upper_SUNDIALS_PRECISION}) # --------------------------------------------------------------- # Option to specify index type @@ -65,7 +66,9 @@ set(DOCSTR "Build with simulation profiling capabilities enabled") sundials_option(SUNDIALS_BUILD_WITH_PROFILING BOOL "${DOCSTR}" OFF) if(SUNDIALS_BUILD_WITH_PROFILING) - message(WARNING "SUNDIALS built with profiling turned on, performance may be affected.") + message( + WARNING + "SUNDIALS built with profiling turned on, performance may be affected.") endif() # --------------------------------------------------------------- @@ -78,24 +81,35 @@ else() set(_default_err_checks ON) endif() -set(DOCSTR "Build with error checking enabled/disabled. Enabling error checks may affect performance.") -sundials_option(SUNDIALS_ENABLE_ERROR_CHECKS BOOL "${DOCSTR}" ${_default_err_checks}) +set(DOCSTR + "Build with error checking enabled/disabled. Enabling error checks may affect performance." +) +sundials_option(SUNDIALS_ENABLE_ERROR_CHECKS BOOL "${DOCSTR}" + ${_default_err_checks}) if(SUNDIALS_ENABLE_ERROR_CHECKS) message(STATUS "SUNDIALS error checking enabled") - message(WARNING "SUNDIALS is being built with extensive error checks, performance may be affected.") + message( + WARNING + "SUNDIALS is being built with extensive error checks, performance may be affected." + ) endif() # --------------------------------------------------------------- # Option to enable logging # --------------------------------------------------------------- -set(DOCSTR "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras") +set(DOCSTR + "Build with logging capabilities enabled (0 = no logging, 1 = errors, 2 = +warnings, 3 = +info, 4 = +debug, 5 = +extras" +) sundials_option(SUNDIALS_LOGGING_LEVEL STRING "${DOCSTR}" 2 OPTIONS "0;1;2;3;4;5") if(SUNDIALS_LOGGING_LEVEL GREATER_EQUAL 3) message(STATUS "SUNDIALS logging level set to ${SUNDIALS_LOGGING_LEVEL}") - message(WARNING "SUNDIALS built with additional logging turned on, performance may be affected.") + message( + WARNING + "SUNDIALS built with additional logging turned on, performance may be affected." + ) endif() # --------------------------------------------------------------- @@ -103,9 +117,11 @@ endif() # --------------------------------------------------------------- if(UNIX) - sundials_option(SUNDIALS_MATH_LIBRARY PATH "Which math library (e.g., libm) to link to" "-lm" ADVANCED) + sundials_option(SUNDIALS_MATH_LIBRARY PATH + "Which math library (e.g., libm) to link to" "-lm" ADVANCED) else() - sundials_option(SUNDIALS_MATH_LIBRARY PATH "Which math library (e.g., libm) to link to" "" ADVANCED) + sundials_option(SUNDIALS_MATH_LIBRARY PATH + "Which math library (e.g., libm) to link to" "" ADVANCED) endif() # all executables will be linked against the math library set(EXE_EXTRA_LINK_LIBS "${SUNDIALS_MATH_LIBRARY}") @@ -119,15 +135,16 @@ sundials_option(BUILD_SHARED_LIBS BOOL "Build shared libraries" ON) # Make sure we build at least one type of libraries if(NOT BUILD_STATIC_LIBS AND NOT BUILD_SHARED_LIBS) - message(FATAL_ERROR "Both static and shared library generation were disabled.") + message( + FATAL_ERROR "Both static and shared library generation were disabled.") endif() # --------------------------------------------------------------- # Options to enable SUNDIALS packages and modules # --------------------------------------------------------------- -# For each SUNDIALS package available (i.e. for which we have the -# sources), give the user the option of enabling/disabling it. +# For each SUNDIALS package available (i.e. for which we have the sources), give +# the user the option of enabling/disabling it. if(IS_DIRECTORY "${SUNDIALS_SOURCE_DIR}/src/arkode") sundials_option(BUILD_ARKODE BOOL "Build the ARKODE library" ON) @@ -182,7 +199,10 @@ sundials_option(BUILD_FORTRAN_MODULE_INTERFACE BOOL "${DOCSTR}" OFF) if(BUILD_FORTRAN_MODULE_INTERFACE) # F2003 interface only supports double precision if(NOT (SUNDIALS_PRECISION MATCHES "DOUBLE")) - message(FATAL_ERROR "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "F2003 interface is not compatible with ${SUNDIALS_PRECISION} precision" + ) endif() # Allow a user to set where the Fortran modules will be installed @@ -196,7 +216,10 @@ endif() sundials_option(BUILD_BENCHMARKS BOOL "Build the SUNDIALS benchmark suite" OFF) -sundials_option(BENCHMARKS_INSTALL_PATH PATH "Output directory for installing benchmark executables" "${CMAKE_INSTALL_PREFIX}/benchmarks") +sundials_option( + BENCHMARKS_INSTALL_PATH PATH + "Output directory for installing benchmark executables" + "${CMAKE_INSTALL_PREFIX}/benchmarks") # --------------------------------------------------------------- # Options for CMake config installation @@ -210,14 +233,14 @@ sundials_option(SUNDIALS_INSTALL_CMAKEDIR STRING "${DOCSTR}" # Options to enable compiler warnings, address sanitizer # --------------------------------------------------------------- -sundials_option(ENABLE_ALL_WARNINGS BOOL - "Enable all compiler warnings" OFF ADVANCED) +sundials_option(ENABLE_ALL_WARNINGS BOOL "Enable all compiler warnings" OFF + ADVANCED) sundials_option(ENABLE_WARNINGS_AS_ERRORS BOOL - "Enable compiler warnings as errors" OFF ADVANCED) + "Enable compiler warnings as errors" OFF ADVANCED) -sundials_option(ENABLE_ADDRESS_SANITIZER BOOL - "Enable address sanitizer" OFF ADVANCED) +sundials_option(ENABLE_ADDRESS_SANITIZER BOOL "Enable address sanitizer" OFF + ADVANCED) # --------------------------------------------------------------- # Options to enable SUNDIALS debugging @@ -225,111 +248,127 @@ sundials_option(ENABLE_ADDRESS_SANITIZER BOOL # List of debugging options (used to add preprocessor directives) set(_SUNDIALS_DEBUG_OPTIONS - SUNDIALS_DEBUG - SUNDIALS_DEBUG_ASSERT - SUNDIALS_DEBUG_CUDA_LASTERROR - SUNDIALS_DEBUG_HIP_LASTERROR - SUNDIALS_DEBUG_PRINTVEC) + SUNDIALS_DEBUG SUNDIALS_DEBUG_ASSERT SUNDIALS_DEBUG_CUDA_LASTERROR + SUNDIALS_DEBUG_HIP_LASTERROR SUNDIALS_DEBUG_PRINTVEC) sundials_option(SUNDIALS_DEBUG BOOL - "Enable additional debugging output and options" OFF - ADVANCED) + "Enable additional debugging output and options" OFF ADVANCED) if(SUNDIALS_DEBUG AND SUNDIALS_LOGGING_LEVEL LESS 4) set(DOCSTR "SUNDIALS_DEBUG=ON forced the logging level to 4") message(STATUS "${DOCSTR}") - set(SUNDIALS_LOGGING_LEVEL "4" CACHE STRING "${DOCSTR}" FORCE) + set(SUNDIALS_LOGGING_LEVEL + "4" + CACHE STRING "${DOCSTR}" FORCE) endif() -sundials_option(SUNDIALS_DEBUG_ASSERT BOOL - "Enable assert when debugging" OFF +sundials_option( + SUNDIALS_DEBUG_ASSERT BOOL "Enable assert when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ADVANCED) -sundials_option(SUNDIALS_DEBUG_CUDA_LASTERROR BOOL +sundials_option( + SUNDIALS_DEBUG_CUDA_LASTERROR BOOL "Enable CUDA last error checks when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ENABLE_CUDA ADVANCED) -sundials_option(SUNDIALS_DEBUG_HIP_LASTERROR BOOL +sundials_option( + SUNDIALS_DEBUG_HIP_LASTERROR BOOL "Enable HIP last error checks when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ENABLE_HIP ADVANCED) -sundials_option(SUNDIALS_DEBUG_PRINTVEC BOOL - "Enable vector printing when debugging" OFF +sundials_option( + SUNDIALS_DEBUG_PRINTVEC BOOL "Enable vector printing when debugging" OFF DEPENDS_ON SUNDIALS_DEBUG ADVANCED) if(SUNDIALS_DEBUG_PRINTVEC AND SUNDIALS_LOGGING_LEVEL LESS 5) set(DOCSTR "SUNDIALS_DEBUG_PRINTVEC=ON forced the logging level to 5") message(STATUS "${DOCSTR}") - set(SUNDIALS_LOGGING_LEVEL "5" CACHE STRING "${DOCSTR}" FORCE) + set(SUNDIALS_LOGGING_LEVEL + "5" + CACHE STRING "${DOCSTR}" FORCE) endif() # --------------------------------------------------------------- # Options for SUNDIALS external # --------------------------------------------------------------- -sundials_option(SUNDIALS_ENABLE_EXTERNAL_ADDONS BOOL +sundials_option( + SUNDIALS_ENABLE_EXTERNAL_ADDONS BOOL "Enables including EXTERNALLY MAINTAINED addons in the SUNDIALS build." OFF) if(SUNDIALS_ENABLE_EXTERNAL_ADDONS) - message(WARNING "SUNDIALS_ENABLE_EXTERNAL_ADDONS=TRUE. External addons are not maintained by the SUNDIALS team. Use at your own risk.") + message( + WARNING + "SUNDIALS_ENABLE_EXTERNAL_ADDONS=TRUE. External addons are not maintained by the SUNDIALS team. Use at your own risk." + ) endif() # --------------------------------------------------------------- # Options for SUNDIALS testing # --------------------------------------------------------------- -sundials_option(SUNDIALS_TEST_FLOAT_PRECISION STRING +sundials_option( + SUNDIALS_TEST_FLOAT_PRECISION STRING "Precision for floating point comparisons (number of digits)" "-1" ADVANCED) -sundials_option(SUNDIALS_TEST_INTEGER_PRECISION STRING +sundials_option( + SUNDIALS_TEST_INTEGER_PRECISION STRING "Precision for integer comparisons (percent difference)" "-1" ADVANCED) sundials_option(SUNDIALS_TEST_OUTPUT_DIR PATH - "Location to write testing output files" "" ADVANCED) + "Location to write testing output files" "" ADVANCED) sundials_option(SUNDIALS_TEST_ANSWER_DIR PATH - "Location of testing answer files" "" ADVANCED) + "Location of testing answer files" "" ADVANCED) sundials_option(SUNDIALS_TEST_PROFILE BOOL - "Use Caliper to profile SUNDIALS tests" OFF ADVANCED) + "Use Caliper to profile SUNDIALS tests" OFF ADVANCED) -sundials_option(SUNDIALS_TEST_NODIFF BOOL +sundials_option( + SUNDIALS_TEST_NODIFF BOOL "Disable output comparison in the regression test suite" OFF ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_EXE PATH - "Path to docker or podman" "" ADVANCED) +sundials_option(SUNDIALS_TEST_CONTAINER_EXE PATH "Path to docker or podman" "" + ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS STRING - "Extra arguments to pass to docker/podman run command" "--tls-verify=false" ADVANCED) +sundials_option( + SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS STRING + "Extra arguments to pass to docker/podman run command" "--tls-verify=false" + ADVANCED) -sundials_option(SUNDIALS_TEST_CONTAINER_MNT STRING +sundials_option( + SUNDIALS_TEST_CONTAINER_MNT STRING "Path to project root inside the container" "/sundials" ADVANCED) # Include development examples in regression tests sundials_option(SUNDIALS_TEST_DEVTESTS BOOL - "Include development tests in make test" OFF ADVANCED) + "Include development tests in make test" OFF ADVANCED) # Include unit tests in regression tests -sundials_option(SUNDIALS_TEST_UNITTESTS BOOL - "Include unit tests in make test" OFF ADVANCED) +sundials_option(SUNDIALS_TEST_UNITTESTS BOOL "Include unit tests in make test" + OFF ADVANCED) # Include googletest unit tests in regression tests -sundials_option(SUNDIALS_TEST_ENABLE_GTEST BOOL - "Disable GTest unit tests" ON ADVANCED) +sundials_option(SUNDIALS_TEST_ENABLE_GTEST BOOL "Disable GTest unit tests" ON + ADVANCED) -sundials_option(SUNDIALS_DEV_IWYU BOOL - "Enable include-what-you-use" OFF ADVANCED) +sundials_option(SUNDIALS_DEV_IWYU BOOL "Enable include-what-you-use" OFF + ADVANCED) -sundials_option(SUNDIALS_DEV_CLANG_TIDY BOOL - "Enable clang-tidy" OFF ADVANCED) +sundials_option(SUNDIALS_DEV_CLANG_TIDY BOOL "Enable clang-tidy" OFF ADVANCED) -sundials_option(SUNDIALS_SCHEDULER_COMMAND STRING "Job scheduler command to use to launch SUNDIALS MPI tests" "" ADVANCED) +sundials_option( + SUNDIALS_SCHEDULER_COMMAND STRING + "Job scheduler command to use to launch SUNDIALS MPI tests" "" ADVANCED) -sundials_option(SUNDIALS_CALIPER_OUTPUT_DIR PATH "Location to write caliper output files" "" ADVANCED) +sundials_option(SUNDIALS_CALIPER_OUTPUT_DIR PATH + "Location to write caliper output files" "" ADVANCED) -sundials_option(SUNDIALS_BENCHMARK_NUM_CPUS STRING "Number of CPU cores to run benchmarks with" "40" ADVANCED) +sundials_option(SUNDIALS_BENCHMARK_NUM_CPUS STRING + "Number of CPU cores to run benchmarks with" "40" ADVANCED) -sundials_option(SUNDIALS_BENCHMARK_NUM_GPUS STRING "Number of GPUs to run benchmarks with" "4" ADVANCED) +sundials_option(SUNDIALS_BENCHMARK_NUM_GPUS STRING + "Number of GPUs to run benchmarks with" "4" ADVANCED) diff --git a/cmake/SundialsDeprecated.cmake b/cmake/SundialsDeprecated.cmake index 385a11361b..a426ac1814 100644 --- a/cmake/SundialsDeprecated.cmake +++ b/cmake/SundialsDeprecated.cmake @@ -18,8 +18,10 @@ if(DEFINED F2003_INTERFACE_ENABLE) message(DEPRECATION "The CMake option F2003_INTERFACE_ENABLE is deprecated. " - "Use BUILD_FORTRAN_MODULE_INTERFACE instead.") - set(BUILD_FORTRAN_MODULE_INTERFACE ${F2003_INTERFACE_ENABLE} CACHE BOOL "Enable Fortran 2003 module interfaces") + "Use BUILD_FORTRAN_MODULE_INTERFACE instead.") + set(BUILD_FORTRAN_MODULE_INTERFACE + ${F2003_INTERFACE_ENABLE} + CACHE BOOL "Enable Fortran 2003 module interfaces") endif() unset(F2003_INTERFACE_ENABLE CACHE) @@ -30,115 +32,146 @@ unset(F2003_INTERFACE_ENABLE CACHE) if(DEFINED MPI_ENABLE) message(DEPRECATION "The CMake option MPI_ENABLE is deprecated. " - "Use ENABLE_MPI instead.") - set(ENABLE_MPI ${MPI_ENABLE} CACHE BOOL "Enable MPI support" FORCE) + "Use ENABLE_MPI instead.") + set(ENABLE_MPI + ${MPI_ENABLE} + CACHE BOOL "Enable MPI support" FORCE) unset(MPI_ENABLE CACHE) endif() if(DEFINED OPENMP_ENABLE) message(DEPRECATION "The CMake option OPENMP_ENABLE is deprecated. " - "Use ENABLE_OPENMP instead.") - set(ENABLE_OPENMP ${OPENMP_ENABLE} CACHE BOOL "Enable OpenMP support" FORCE) + "Use ENABLE_OPENMP instead.") + set(ENABLE_OPENMP + ${OPENMP_ENABLE} + CACHE BOOL "Enable OpenMP support" FORCE) unset(OPENMP_ENABLE CACHE) endif() if(DEFINED OPENMP_DEVICE_ENABLE) message(DEPRECATION "The CMake option OPENMP_DEVICE_ENABLE is deprecated. " - "Use ENABLE_OPENMP_DEVICE instead.") - set(ENABLE_OPENMP_DEVICE ${OPENMP_DEVICE_ENABLE} CACHE BOOL - "Enable OpenMP device offloading support" FORCE) + "Use ENABLE_OPENMP_DEVICE instead.") + set(ENABLE_OPENMP_DEVICE + ${OPENMP_DEVICE_ENABLE} + CACHE BOOL "Enable OpenMP device offloading support" FORCE) unset(OPENMP_DEVICE_ENABLE CACHE) endif() if(DEFINED SKIP_OPENMP_DEVICE_CHECK) - message(DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. " - "Use OPENMP_DEVICE_WORKS instead.") - set(OPENMP_DEVICE_WORKS ${SKIP_OPENMP_DEVICE_CHECK} CACHE BOOL - "Skip the compiler check for OpenMP device offloading" FORCE) + message( + DEPRECATION "The CMake option SKIP_OPENMP_DEVICE_CHECK is deprecated. " + "Use OPENMP_DEVICE_WORKS instead.") + set(OPENMP_DEVICE_WORKS + ${SKIP_OPENMP_DEVICE_CHECK} + CACHE BOOL "Skip the compiler check for OpenMP device offloading" FORCE) unset(SKIP_OPENMP_DEVICE_CHECK CACHE) endif() if(DEFINED PTHREAD_ENABLE) message(DEPRECATION "The CMake option PTHREAD_ENABLE is deprecated. " - "Use ENABLE_PTHREAD instead") - set(ENABLE_PTHREAD ${PTHREAD_ENABLE} CACHE BOOL "Enable Pthreads support" FORCE) + "Use ENABLE_PTHREAD instead") + set(ENABLE_PTHREAD + ${PTHREAD_ENABLE} + CACHE BOOL "Enable Pthreads support" FORCE) unset(PTHREAD_ENABLE CACHE) endif() if(DEFINED CUDA_ENABLE) message(DEPRECATION "The CMake option CUDA_ENABLE is deprecated. " - "Use ENABLE_CUDA instead.") - set(ENABLE_CUDA ${CUDA_ENABLE} CACHE BOOL "Enable CUDA support" FORCE) + "Use ENABLE_CUDA instead.") + set(ENABLE_CUDA + ${CUDA_ENABLE} + CACHE BOOL "Enable CUDA support" FORCE) unset(CUDA_ENABLE CACHE) endif() if(DEFINED LAPACK_ENABLE) message(DEPRECATION "The CMake option LAPACK_ENABLE is deprecated. " - "Use ENABLE_LAPACK instead.") - set(ENABLE_LAPACK ${LAPACK_ENABLE} CACHE BOOL "Enable LAPACK support" FORCE) + "Use ENABLE_LAPACK instead.") + set(ENABLE_LAPACK + ${LAPACK_ENABLE} + CACHE BOOL "Enable LAPACK support" FORCE) unset(LAPACK_ENABLE CACHE) endif() if(DEFINED SUPERLUDIST_ENABLE) message(DEPRECATION "The CMake option SUPERLUDIST_ENABLE is deprecated. " - "Use ENABLE_SUPERLUDIST instead.") - set(ENABLE_SUPERLUDIST ${SUPERLUDIST_ENABLE} CACHE BOOL "Enable SuperLU_DIST support" FORCE) + "Use ENABLE_SUPERLUDIST instead.") + set(ENABLE_SUPERLUDIST + ${SUPERLUDIST_ENABLE} + CACHE BOOL "Enable SuperLU_DIST support" FORCE) unset(SUPERLUDIST_ENABLE CACHE) endif() # Deprecated with SUNDIALS 6.4.0 if(DEFINED SUPERLUDIST_LIBRARY_DIR) message(DEPRECATION "The CMake option SUPERLUDIST_LIBRARY_DIR is deprecated. " - "Use SUPERLUDIST_DIR instead.") - set(SUPERLUDIST_DIR "${SUPERLUDIST_LIBRARY_DIR}/../" CACHE BOOL "SuperLU_DIST root directory" FORCE) + "Use SUPERLUDIST_DIR instead.") + set(SUPERLUDIST_DIR + "${SUPERLUDIST_LIBRARY_DIR}/../" + CACHE BOOL "SuperLU_DIST root directory" FORCE) unset(SUPERLUDIST_LIBRARY_DIR CACHE) endif() if(DEFINED SUPERLUDIST_INCLUDE_DIR) message(DEPRECATION "The CMake option SUPERLUDIST_INCLUDE_DIR is deprecated. " - "Use SUPERLUDIST_INCLUDE_DIRS instead.") - set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIR}" CACHE BOOL "SuperLU_DIST include directoroes" FORCE) + "Use SUPERLUDIST_INCLUDE_DIRS instead.") + set(SUPERLUDIST_INCLUDE_DIRS + "${SUPERLUDIST_INCLUDE_DIR}" + CACHE BOOL "SuperLU_DIST include directoroes" FORCE) unset(SUPERLUDIST_INCLUDE_DIR CACHE) endif() if(DEFINED SUPERLUMT_ENABLE) message(DEPRECATION "The CMake option SUPERLUMT_ENABLE is deprecated. " - "Use ENABLE_SUPERLUMT instead.") - set(ENABLE_SUPERLUMT ${SUPERLUMT_ENABLE} CACHE BOOL "Enable SuperLU_MT support" FORCE) + "Use ENABLE_SUPERLUMT instead.") + set(ENABLE_SUPERLUMT + ${SUPERLUMT_ENABLE} + CACHE BOOL "Enable SuperLU_MT support" FORCE) unset(SUPERLUMT_ENABLE CACHE) endif() if(DEFINED KLU_ENABLE) message(DEPRECATION "The CMake option KLU_ENABLE is deprecated. " - "Use ENABLE_KLU instead.") - set(ENABLE_KLU ${KLU_ENABLE} CACHE BOOL "Enable KLU support" FORCE) + "Use ENABLE_KLU instead.") + set(ENABLE_KLU + ${KLU_ENABLE} + CACHE BOOL "Enable KLU support" FORCE) unset(KLU_ENABLE CACHE) endif() if(DEFINED HYPRE_ENABLE) message(DEPRECATION "The CMake option HYPRE_ENABLE is deprecated. " - "Use ENABLE_HYPRE instead.") - set(ENABLE_HYPRE ${HYPRE_ENABLE} CACHE BOOL "Enable HYPRE support" FORCE) + "Use ENABLE_HYPRE instead.") + set(ENABLE_HYPRE + ${HYPRE_ENABLE} + CACHE BOOL "Enable HYPRE support" FORCE) unset(HYPRE_ENABLE CACHE) endif() if(DEFINED PETSC_ENABLE) message(DEPRECATION "The CMake option PETSC_ENABLE is deprecated. " - "Use ENABLE_PETSC instead.") - set(ENABLE_PETSC ${PETSC_ENABLE} CACHE BOOL "Enable PETSC support" FORCE) + "Use ENABLE_PETSC instead.") + set(ENABLE_PETSC + ${PETSC_ENABLE} + CACHE BOOL "Enable PETSC support" FORCE) unset(PETSC_ENABLE CACHE) endif() if(DEFINED Trilinos_ENABLE) message(DEPRECATION "The CMake option Trilinos_ENABLE is deprecated. " - "Use ENABLE_TRILINOS instead.") - set(ENABLE_TRILINOS ${Trilinos_ENABLE} CACHE BOOL "Enable Trilinos support" FORCE) + "Use ENABLE_TRILINOS instead.") + set(ENABLE_TRILINOS + ${Trilinos_ENABLE} + CACHE BOOL "Enable Trilinos support" FORCE) unset(Trilinos_ENABLE CACHE) endif() if(DEFINED RAJA_ENABLE) message(DEPRECATION "The CMake option RAJA_ENABLE is deprecated. " - "Use ENABLE_RAJA instead.") - set(ENABLE_RAJA ${RAJA_ENABLE} CACHE BOOL "Enable RAJA support" FORCE) + "Use ENABLE_RAJA instead.") + set(ENABLE_RAJA + ${RAJA_ENABLE} + CACHE BOOL "Enable RAJA support" FORCE) unset(RAJA_ENABLE CACHE) endif() @@ -148,9 +181,11 @@ endif() if(DEFINED CUDA_ARCH) print_warning("The CMake option CUDA_ARCH is deprecated. " - "Use CMAKE_CUDA_ARCHITECTURES instead.") + "Use CMAKE_CUDA_ARCHITECTURES instead.") # convert sm_** to just ** string(REGEX MATCH "[0-9]+" arch_name "${CUDA_ARCH}") - set(CMAKE_CUDA_ARCHITECTURES ${arch_name} CACHE STRING "CUDA Architectures" FORCE) + set(CMAKE_CUDA_ARCHITECTURES + ${arch_name} + CACHE STRING "CUDA Architectures" FORCE) unset(CUDA_ARCH) endif() diff --git a/cmake/SundialsExampleOptions.cmake b/cmake/SundialsExampleOptions.cmake index 40d692771f..8d54377bd6 100644 --- a/cmake/SundialsExampleOptions.cmake +++ b/cmake/SundialsExampleOptions.cmake @@ -22,9 +22,16 @@ sundials_option(EXAMPLES_ENABLE_C BOOL "Build SUNDIALS C examples" ON) # Some TPLs only have C++ examples. Default the C++ examples to ON if any of # these are enabled on the initial configuration pass. -if (ENABLE_TRILINOS OR ENABLE_SUPERLUDIST OR ENABLE_XBRAID OR ENABLE_HIP OR - ENABLE_MAGMA OR ENABLE_SYCL OR ENABLE_ONEMKL OR ENABLE_RAJA OR ENABLE_GINKGO OR - ENABLE_KOKKOS) +if(ENABLE_TRILINOS + OR ENABLE_SUPERLUDIST + OR ENABLE_XBRAID + OR ENABLE_HIP + OR ENABLE_MAGMA + OR ENABLE_SYCL + OR ENABLE_ONEMKL + OR ENABLE_RAJA + OR ENABLE_GINKGO + OR ENABLE_KOKKOS) sundials_option(EXAMPLES_ENABLE_CXX BOOL "Build SUNDIALS C++ examples" ON) else() sundials_option(EXAMPLES_ENABLE_CXX BOOL "Build SUNDIALS C++ examples" OFF) @@ -34,24 +41,30 @@ endif() # Options for Fortran Examples # ----------------------------------------------------------------------------- -# F2003 examples (on by default) are an option only if the -# Fortran 2003 interface is enabled. +# F2003 examples (on by default) are an option only if the Fortran 2003 +# interface is enabled. set(DOCSTR "Build SUNDIALS Fortran 2003 examples") if(BUILD_FORTRAN_MODULE_INTERFACE) - set(EXAMPLES_ENABLE_F2003 ON CACHE BOOL "${DOCSTR}") + set(EXAMPLES_ENABLE_F2003 + ON + CACHE BOOL "${DOCSTR}") # Fortran 2003 examples only support double precision if(EXAMPLES_ENABLE_F2003 AND (NOT (SUNDIALS_PRECISION MATCHES "DOUBLE"))) - message(WARNING "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message( + WARNING + "F2003 examples are not compatible with ${SUNDIALS_PRECISION} precision. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() else() # set back to OFF (in case it was ON) if(EXAMPLES_ENABLE_F2003) - message(WARNING "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " - "Setting EXAMPLES_ENABLE_F2003 to OFF.") + message( + WARNING + "EXAMPLES_ENABLE_F2003 is ON but BUILD_FORTRAN_MODULE_INTERFACE is OFF. " + "Setting EXAMPLES_ENABLE_F2003 to OFF.") force_variable(EXAMPLES_ENABLE_F2003 BOOL "${DOCSTR}" OFF) endif() @@ -71,25 +84,33 @@ sundials_option(EXAMPLES_ENABLE_CUDA BOOL "Build SUNDIALS CUDA examples" ON # Enable installing examples by default sundials_option(EXAMPLES_INSTALL BOOL "Install SUNDIALS examples" ON) -sundials_option(EXAMPLES_INSTALL_PATH PATH "Output directory for installing example files" "${CMAKE_INSTALL_PREFIX}/examples") +sundials_option( + EXAMPLES_INSTALL_PATH PATH "Output directory for installing example files" + "${CMAKE_INSTALL_PREFIX}/examples") # If examples are to be exported, check where we should install them. if(EXAMPLES_INSTALL AND NOT EXAMPLES_INSTALL_PATH) - message(WARNING "The example installation path is empty. Example installation " - "path was reset to its default value") - set(EXAMPLES_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/examples" CACHE STRING - "Output directory for installing example files" FORCE) + message( + WARNING "The example installation path is empty. Example installation " + "path was reset to its default value") + set(EXAMPLES_INSTALL_PATH + "${CMAKE_INSTALL_PREFIX}/examples" + CACHE STRING "Output directory for installing example files" FORCE) endif() # ----------------------------------------------------------------------------- # Internal variables. # ----------------------------------------------------------------------------- -if(EXAMPLES_ENABLE_C OR - EXAMPLES_ENABLE_CXX OR - EXAMPLES_ENABLE_CUDA OR - EXAMPLES_ENABLE_F2003) - set(_BUILD_EXAMPLES TRUE CACHE INTERNAL "") +if(EXAMPLES_ENABLE_C + OR EXAMPLES_ENABLE_CXX + OR EXAMPLES_ENABLE_CUDA + OR EXAMPLES_ENABLE_F2003) + set(_BUILD_EXAMPLES + TRUE + CACHE INTERNAL "") else() - set(_BUILD_EXAMPLES FALSE CACHE INTERNAL "") + set(_BUILD_EXAMPLES + FALSE + CACHE INTERNAL "") endif() diff --git a/cmake/SundialsIndexSize.cmake b/cmake/SundialsIndexSize.cmake index 6498637bd3..f8f4836144 100644 --- a/cmake/SundialsIndexSize.cmake +++ b/cmake/SundialsIndexSize.cmake @@ -24,8 +24,9 @@ include(CheckTypeSize) if(SUNDIALS_INDEX_SIZE MATCHES "64") set(SUNDIALS_CINDEX_TYPE "") - # if the user specified an index type use it, otherwise try the standard options - if (SUNDIALS_INDEX_TYPE) + # if the user specified an index type use it, otherwise try the standard + # options + if(SUNDIALS_INDEX_TYPE) set(POSSIBLE_INT64 ${SUNDIALS_INDEX_TYPE}) else() set(POSSIBLE_INT64 int64_t;__int64;long long;long) @@ -42,8 +43,11 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - message(FATAL_ERROR "No integer type of size 8 was found. Tried " - "${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message( + FATAL_ERROR + "No integer type of size 8 was found. Tried " + "${POSSIBLE_INT64}. Try setting the advanced option SUNDIALS_INDEX_TYPE." + ) endif() # set Fortran integer size too @@ -51,8 +55,9 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") elseif(SUNDIALS_INDEX_SIZE MATCHES "32") set(SUNDIALS_CINDEX_TYPE "") - # if the user specified an index type use it, otherwise try the standard options - if (SUNDIALS_INDEX_TYPE) + # if the user specified an index type use it, otherwise try the standard + # options + if(SUNDIALS_INDEX_TYPE) set(POSSIBLE_INT32 ${SUNDIALS_INDEX_TYPE}) else() set(POSSIBLE_INT32 int32_t;int;long) @@ -69,8 +74,11 @@ elseif(SUNDIALS_INDEX_SIZE MATCHES "32") endforeach() if(NOT SUNDIALS_CINDEX_TYPE) - message(FATAL_ERROR "No integer type of size 4 was found. Tried " - "${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE.") + message( + FATAL_ERROR + "No integer type of size 4 was found. Tried " + "${POSSIBLE_INT32}. Try setting the advanced option SUNDIALS_INDEX_TYPE." + ) endif() # set Fortran integer size too diff --git a/cmake/SundialsSetupCXX.cmake b/cmake/SundialsSetupCXX.cmake index 32a6a9b003..f4967f16cc 100644 --- a/cmake/SundialsSetupCXX.cmake +++ b/cmake/SundialsSetupCXX.cmake @@ -19,24 +19,21 @@ enable_language(CXX) set(CXX_FOUND TRUE) # --------------------------------------------------------------- -# Option to specify the C++ standard SUNDIALS will use. Defined -# here so it is set in the same configuration pass as the C++ -# compiler and related options. +# Option to specify the C++ standard SUNDIALS will use. Defined here so it is +# set in the same configuration pass as the C++ compiler and related options. # --------------------------------------------------------------- # Do not allow decaying to previous standards -- generates error if the standard # is not supported -sundials_option(CMAKE_CXX_STANDARD_REQUIRED BOOL - "Require C++ standard version" ON) +sundials_option(CMAKE_CXX_STANDARD_REQUIRED BOOL "Require C++ standard version" + ON) if(ENABLE_SYCL) set(DOCSTR "The C++ standard to use if C++ is enabled (17, 20)") - sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "17" - OPTIONS "17;20") + sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "17" OPTIONS "17;20") else() set(DOCSTR "The C++ standard to use if C++ is enabled (14, 17, 20)") - sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "14" - OPTIONS "14;17;20") + sundials_option(CMAKE_CXX_STANDARD STRING "${DOCSTR}" "14" OPTIONS "14;17;20") endif() message(STATUS "CXX standard set to ${CMAKE_CXX_STANDARD}") diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 7790f61609..797c743a3f 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -25,12 +25,12 @@ include(SundialsIndexSize) # =============================================================== if(WIN32) - # Under Windows, add compiler directive to inhibit warnings - # about use of unsecure functions. + # Under Windows, add compiler directive to inhibit warnings about use of + # unsecure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) - # Under Windows, we need to have dll and exe files in the - # same directory to run the test suite properly. + # Under Windows, we need to have dll and exe files in the same directory to + # run the test suite properly. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib") @@ -38,7 +38,8 @@ endif() if(APPLE) # Allow undefined symbols that will be resolved by a user program. - set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") + set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS + "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") endif() # =============================================================== @@ -50,18 +51,20 @@ if(BUILD_SHARED_LIBS) # use, i.e. don't skip the full RPATH for the build tree set(CMAKE_SKIP_BUILD_RPATH FALSE) - # when building, don't use the install RPATH already - # (but later on when installing) + # when building, don't use the install RPATH already (but later on when + # installing) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_FULL_LIBDIR}") - # add the automatically determined parts of the RPATH - # which point to directories outside the build tree to the install RPATH + # add the automatically determined parts of the RPATH which point to + # directories outside the build tree to the install RPATH set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - # the RPATH to be used when installing, but only if it's not a system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" isSystemDir) + # the RPATH to be used when installing, but only if it's not a system + # directory + list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + "${CMAKE_INSTALL_FULL_LIBDIR}" isSystemDir) if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") endif() @@ -82,7 +85,8 @@ if(ENABLE_ALL_WARNINGS) set(CMAKE_CXX_FLAGS "-Wdouble-promotion ${CMAKE_CXX_FLAGS}") endif() - if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32")) + if((SUNDIALS_PRECISION MATCHES "DOUBLE") AND (SUNDIALS_INDEX_SIZE MATCHES "32" + )) set(CMAKE_C_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_C_FLAGS}") set(CMAKE_CXX_FLAGS "-Wconversion -Wno-sign-conversion ${CMAKE_CXX_FLAGS}") endif() @@ -100,15 +104,17 @@ if(ENABLE_ALL_WARNINGS) # to use gfortran > 5.5 which segfaults with -fcheck=array-temps,bounds,do,mem # no- options were added in gfortran 6 # - # Exclude run-time pointer checks (no-pointer) because passing null objects - # to SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a + # Exclude run-time pointer checks (no-pointer) because passing null objects to + # SUNDIALS functions (e.g., sunmat => null() to SetLinearSolver) causes a # run-time error with this check # # Exclude checks for subroutines and functions not marked as recursive # (no-recursion) e.g., ark_brusselator1D_task_local_nls_f2003 calls # SUNNonlinsolFree from within a custom nonlinear solver implementation of # SUNNonlinsolFree which causes a run-time error with this check - set(CMAKE_Fortran_FLAGS "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}") + set(CMAKE_Fortran_FLAGS + "-Wall -Wpedantic -Wno-unused-dummy-argument -Wno-c-binding-type -ffpe-summary=none ${CMAKE_Fortran_FLAGS}" + ) endif() if(ENABLE_WARNINGS_AS_ERRORS) @@ -122,16 +128,22 @@ endif() if(ENABLE_ADDRESS_SANITIZER) message(STATUS "Enabling address sanitizer") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined") + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) + set(CMAKE_Fortran_FLAGS + "${CMAKE_Fortran_FLAGS} -fsanitize=address -fsanitize=leak -fsanitize=undefined" + ) endif() if(SUNDIALS_DEBUG) message(STATUS "Adding debugging preprocessor directives") foreach(debug ${_SUNDIALS_DEBUG_OPTIONS}) - if (${${debug}}) + if(${${debug}}) add_compile_definitions(${debug}) endif() endforeach() @@ -142,8 +154,7 @@ endif() # =============================================================== set(DOCSTR "The C standard to use (99, 11, 17)") -sundials_option(CMAKE_C_STANDARD STRING "${DOCSTR}" "99" - OPTIONS "99;11;17") +sundials_option(CMAKE_C_STANDARD STRING "${DOCSTR}" "99" OPTIONS "99;11;17") message(STATUS "C standard set to ${CMAKE_C_STANDARD}") set(DOCSTR "Enable C compiler specific extensions") @@ -154,7 +165,8 @@ message(STATUS "C extensions set to ${CMAKE_C_EXTENSIONS}") # Check for __builtin_expect # --------------------------------------------------------------- -check_c_source_compiles(" +check_c_source_compiles( + " #include int main(void) { double a = 0.0; @@ -165,14 +177,16 @@ check_c_source_compiles(" printf(\"a=%g\", a); return 0; } -" SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT) +" + SUNDIALS_C_COMPILER_HAS_BUILTIN_EXPECT) # --------------------------------------------------------------- # Check for assume related extensions # --------------------------------------------------------------- # gcc >= 13 should have __attribute__((assume)) -check_c_source_compiles(" +check_c_source_compiles( + " #include int main(void) { double a = 0.0; @@ -188,11 +202,13 @@ check_c_source_compiles(" printf(\"a=%g\", a); return 0; } -" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) +" + SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) # LLVM based compilers should have __builtin_assume if(NOT SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) - check_c_source_compiles(" + check_c_source_compiles( + " #include int main(void) { double a = 0.0; @@ -201,12 +217,15 @@ if(NOT SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME) printf(\"a=%g\", a); return 0; } - " SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) + " + SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME) endif() # MSVC provides __assume -if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME)) - check_c_source_compiles(" +if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME + OR SUNDIALS_C_COMPILER_HAS_BUILTIN_ASSUME)) + check_c_source_compiles( + " #include int main(void) { double a = 0.0; @@ -215,19 +234,22 @@ if(NOT (SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_ASSUME OR SUNDIALS_C_COMPILER_HAS_BUIL printf(\"a=%g\", a); return 0; } - " SUNDIALS_C_COMPILER_HAS_ASSUME) + " + SUNDIALS_C_COMPILER_HAS_ASSUME) endif() # --------------------------------------------------------------- # Check for unused extension # --------------------------------------------------------------- -check_c_source_compiles(" +check_c_source_compiles( + " int main(void) { __attribute__((unused)) double a = 0.0; return 0; } -" SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) +" + SUNDIALS_C_COMPILER_HAS_ATTRIBUTE_UNUSED) # --------------------------------------------------------------- # Check for POSIX timers @@ -236,25 +258,29 @@ include(SundialsPOSIXTimers) if(SUNDIALS_POSIX_TIMERS AND POSIX_TIMERS_NEED_POSIX_C_SOURCE) set(DOCSTR "Value of _POSIX_C_SOURCE") - sundials_option(SUNDIALS_POSIX_C_SOURCE STRING "${DOCSTR}" "200112L" - ADVANCED) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=${SUNDIALS_POSIX_C_SOURCE}") + sundials_option(SUNDIALS_POSIX_C_SOURCE STRING "${DOCSTR}" "200112L" ADVANCED) + set(CMAKE_C_FLAGS + "${CMAKE_C_FLAGS} -D_POSIX_C_SOURCE=${SUNDIALS_POSIX_C_SOURCE}") endif() - # --------------------------------------------------------------- # Check for deprecated attribute with message # --------------------------------------------------------------- if(WIN32) - set(COMPILER_DEPRECATED_MSG_ATTRIBUTE "__declspec(deprecated(msg))" CACHE INTERNAL "") + set(COMPILER_DEPRECATED_MSG_ATTRIBUTE + "__declspec(deprecated(msg))" + CACHE INTERNAL "") else() - set(COMPILER_DEPRECATED_MSG_ATTRIBUTE "__attribute__ ((__deprecated__(msg)))" CACHE INTERNAL "") + set(COMPILER_DEPRECATED_MSG_ATTRIBUTE + "__attribute__ ((__deprecated__(msg)))" + CACHE INTERNAL "") endif() -check_c_source_compiles(" +check_c_source_compiles( + " #define msg \"test\" ${COMPILER_DEPRECATED_MSG_ATTRIBUTE} int somefunc(void) { return 0; } - int main(void) { return somefunc();}" COMPILER_HAS_DEPRECATED_MSG -) + int main(void) { return somefunc();}" + COMPILER_HAS_DEPRECATED_MSG) # =============================================================== # Fortran settings @@ -282,24 +308,22 @@ endif() # The case to use in the name-mangling scheme sundials_option(SUNDIALS_LAPACK_CASE STRING - "case of LAPACK function names (lower/upper)" - "" - ADVANCED) + "case of LAPACK function names (lower/upper)" "" ADVANCED) # The number of underscores of appended in the name-mangling scheme -sundials_option(SUNDIALS_LAPACK_UNDERSCORES STRING - "number of underscores appended to LAPACK function names (none/one/two)" - "" - ADVANCED) +sundials_option( + SUNDIALS_LAPACK_UNDERSCORES STRING + "number of underscores appended to LAPACK function names (none/one/two)" "" + ADVANCED) # If used, both case and underscores must be set if((NOT SUNDIALS_LAPACK_CASE) AND SUNDIALS_LAPACK_UNDERSCORES) message(FATAL_ERROR "If SUNDIALS_LAPACK_UNDERSCORES is set, " - "SUNDIALS_LAPACK_CASE must also be set.") + "SUNDIALS_LAPACK_CASE must also be set.") endif() if(SUNDIALS_LAPACK_CASE AND (NOT SUNDIALS_LAPACK_UNDERSCORES)) message(FATAL_ERROR "If SUNDIALS_LAPACK_CASE is set, " - "SUNDIALS_LAPACK_UNDERSCORES must also be set.") + "SUNDIALS_LAPACK_UNDERSCORES must also be set.") endif() # Did the user provide a name-mangling scheme? @@ -318,11 +342,15 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") else() message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() @@ -331,11 +359,15 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "ONE") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") elseif(SUNDIALS_LAPACK_UNDERSCORES MATCHES "TWO") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") else() message(FATAL_ERROR "Invalid SUNDIALS_LAPACK_UNDERSCORES option.") endif() @@ -346,16 +378,13 @@ if(SUNDIALS_LAPACK_CASE AND SUNDIALS_LAPACK_UNDERSCORES) # name-mangling scheme has been manually set set(NEED_FORTRAN_NAME_MANGLING FALSE) - configure_file( - ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in - ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h - ) + configure_file(${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h) endif() # Do we need a Fortran compiler? -if(BUILD_FORTRAN_MODULE_INTERFACE OR - NEED_FORTRAN_NAME_MANGLING) +if(BUILD_FORTRAN_MODULE_INTERFACE OR NEED_FORTRAN_NAME_MANGLING) include(SundialsSetupFortran) endif() @@ -363,17 +392,19 @@ endif() # C++ settings # =============================================================== -if(BUILD_BENCHMARKS OR SUNDIALS_TEST_UNITTESTS OR EXAMPLES_ENABLE_CXX OR - ENABLE_CUDA OR - ENABLE_HIP OR - ENABLE_SYCL OR - ENABLE_RAJA OR - ENABLE_TRILINOS OR - ENABLE_SUPERLUDIST OR - ENABLE_MAGMA OR - ENABLE_GINKGO OR - ENABLE_KOKKOS OR - ENABLE_ADIAK) +if(BUILD_BENCHMARKS + OR SUNDIALS_TEST_UNITTESTS + OR EXAMPLES_ENABLE_CXX + OR ENABLE_CUDA + OR ENABLE_HIP + OR ENABLE_SYCL + OR ENABLE_RAJA + OR ENABLE_TRILINOS + OR ENABLE_SUPERLUDIST + OR ENABLE_MAGMA + OR ENABLE_GINKGO + OR ENABLE_KOKKOS + OR ENABLE_ADIAK) include(SundialsSetupCXX) endif() @@ -416,8 +447,8 @@ endif() # Upper case version of build type string(TOUPPER "${CMAKE_BUILD_TYPE}" _cmake_build_type) -# Make build type specific flag options ADVANCED, -# except for the one corresponding to the current build type +# Make build type specific flag options ADVANCED, except for the one +# corresponding to the current build type foreach(lang ${_SUNDIALS_ENABLED_LANGS}) foreach(build_type DEBUG;RELEASE;RELWITHDEBINFO;MINSIZEREL) if("${_cmake_build_type}" STREQUAL "${build_type}") @@ -431,7 +462,6 @@ foreach(lang ${_SUNDIALS_ENABLED_LANGS}) mark_as_advanced(CLEAR CMAKE_${lang}_COMPILER CMAKE_${lang}_FLAGS) endforeach() - # =============================================================== # Configure compilers for installed examples # =============================================================== @@ -439,14 +469,17 @@ endforeach() foreach(lang ${_SUNDIALS_ENABLED_LANGS}) if(ENABLE_MPI) if(DEFINED MPI_${lang}_COMPILER) - set(_EXAMPLES_${lang}_COMPILER "${MPI_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${MPI_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() else() - set(_EXAMPLES_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${CMAKE_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() endforeach() - # =============================================================== # Configure clang-tidy for linting # =============================================================== @@ -456,7 +489,7 @@ set(SUNDIALS_DEV_CLANG_TIDY_DIR ${CMAKE_BINARY_DIR}/clang-tidy/) if(SUNDIALS_DEV_CLANG_TIDY) find_program(CLANG_TIDY_PATH NAMES clang-tidy) if(NOT CLANG_TIDY_PATH) - message(FATAL_ERROR "Could not find the program clang-tidy") + message(FATAL_ERROR "Could not find the program clang-tidy") endif() message(STATUS "Found clang-tidy: ${CLANG_TIDY_PATH}") @@ -465,15 +498,12 @@ if(SUNDIALS_DEV_CLANG_TIDY) set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_PATH} -format-style='file' --fix) set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_PATH} -format-style='file' --fix) else() - set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_PATH} - -format-style='file' - --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-fixes.yaml - ) + set(CMAKE_C_CLANG_TIDY + ${CLANG_TIDY_PATH} -format-style='file' + --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-fixes.yaml) set(CMAKE_CXX_CLANG_TIDY - ${CLANG_TIDY_PATH} - -format-style='file' - --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-cxx-fixes.yaml - ) + ${CLANG_TIDY_PATH} -format-style='file' + --export-fixes=${SUNDIALS_DEV_CLANG_TIDY_DIR}/clang-tidy-cxx-fixes.yaml) endif() endif() @@ -483,10 +513,10 @@ if(SUNDIALS_DEV_IWYU) message(FATAL_ERROR "Could not find the program include-what-you-use") endif() message(STATUS "Found IWYU: ${IWYU_PATH}") - set(CMAKE_C_INCLUDE_WHAT_YOU_USE ${IWYU_PATH} - -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp - -Xiwyu --error_always) - set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH} - -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp - -Xiwyu --error_always) + set(CMAKE_C_INCLUDE_WHAT_YOU_USE + ${IWYU_PATH} -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp + -Xiwyu --error_always) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE + ${IWYU_PATH} -Xiwyu --mapping_file=${CMAKE_SOURCE_DIR}/scripts/iwyu.imp + -Xiwyu --error_always) endif() diff --git a/cmake/SundialsSetupConfig.cmake b/cmake/SundialsSetupConfig.cmake index 482a267ac4..e1ea1f1929 100644 --- a/cmake/SundialsSetupConfig.cmake +++ b/cmake/SundialsSetupConfig.cmake @@ -44,10 +44,9 @@ else() string(TIMESTAMP JOB_START_TIME "%Y%m%d%H%M%S") endif() - # ============================================================================ -# Generate macros and substitution variables related to TPLs -# that SUNDIALS is being built with. +# Generate macros and substitution variables related to TPLs that SUNDIALS is +# being built with. # ============================================================================ # prepare substitution variables for modules that have been built @@ -59,7 +58,8 @@ foreach(_item ${SUNDIALS_BUILD_LIST}) endif() endforeach() -# prepare substitution variable SUNDIALS_${TPL NAME}_ENABLED for sundials_config.h +# prepare substitution variable SUNDIALS_${TPL NAME}_ENABLED for +# sundials_config.h foreach(tpl ${SUNDIALS_TPL_LIST}) set(SUNDIALS_${tpl}_ENABLED TRUE) endforeach() @@ -94,7 +94,5 @@ endif() # Generate the header file and place it in the binary dir. # ============================================================================= -configure_file( - ${PROJECT_SOURCE_DIR}/include/sundials/sundials_config.in - ${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h - ) +configure_file(${PROJECT_SOURCE_DIR}/include/sundials/sundials_config.in + ${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h) diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index f971e691a6..8a0703336b 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -19,9 +19,11 @@ # =============================================================== if(NOT CMAKE_CUDA_HOST_COMPILER) - # If a user did not provide the host compiler, then we - # assume that they want to use the CXX compiler that was set. - set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER} CACHE FILEPATH "NVCC host compiler") + # If a user did not provide the host compiler, then we assume that they want + # to use the CXX compiler that was set. + set(CMAKE_CUDA_HOST_COMPILER + ${CMAKE_CXX_COMPILER} + CACHE FILEPATH "NVCC host compiler") endif() # =============================================================== @@ -31,18 +33,19 @@ endif() # Do not allow decaying to previous standards -- generates error if the standard # is not supported sundials_option(CMAKE_CUDA_STANDARD_REQUIRED BOOL - "Require C++ standard version" ON) + "Require C++ standard version" ON) set(DOCSTR "The CUDA standard to use if CUDA is enabled (14, 17, 20)") sundials_option(CMAKE_CUDA_STANDARD STRING "${DOCSTR}" "${CMAKE_CXX_STANDARD}" OPTIONS "14;17;20") message(STATUS "CUDA standard set to ${CMAKE_CUDA_STANDARD}") -set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") +set(CMAKE_CUDA_FLAGS + "${CMAKE_CUDA_FLAGS} --expt-extended-lambda --expt-relaxed-constexpr") -if( (CMAKE_CXX_COMPILER_ID MATCHES GNU) - OR (CMAKE_CXX_COMPILER_ID MATCHES Clang) - AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le) ) +if((CMAKE_CXX_COMPILER_ID MATCHES GNU) + OR (CMAKE_CXX_COMPILER_ID MATCHES Clang) + AND (CMAKE_SYSTEM_PROCESSOR MATCHES ppc64le)) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-mno-float128 _hasflag) if(_hasflag) @@ -75,15 +78,19 @@ message(STATUS "CUDA Library Directory: ${CUDAToolkit_LIBRARY_DIR}") message(STATUS "CUDA Compile Flags: ${CMAKE_CUDA_FLAGS}") message(STATUS "CUDA Link Flags: ${CMAKE_CUDA_LINK_FLAGS}") message(STATUS "CUDA Link Executable: ${CMAKE_CUDA_LINK_EXECUTABLE}") -message(STATUS "CUDA Separable Compilation: ${CMAKE_CUDA_SEPARABLE_COMPILATION}") - +message( + STATUS "CUDA Separable Compilation: ${CMAKE_CUDA_SEPARABLE_COMPILATION}") # =============================================================== # Configure compiler for installed examples # =============================================================== if(ENABLE_MPI) - set(_EXAMPLES_CUDA_HOST_COMPILER "${MPI_CXX_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_CUDA_HOST_COMPILER + "${MPI_CXX_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") else() - set(_EXAMPLES_CUDA_HOST_COMPILER "${CMAKE_CUDA_HOST_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_CUDA_HOST_COMPILER + "${CMAKE_CUDA_HOST_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() diff --git a/cmake/SundialsSetupFortran.cmake b/cmake/SundialsSetupFortran.cmake index de9beea905..bdef010422 100644 --- a/cmake/SundialsSetupFortran.cmake +++ b/cmake/SundialsSetupFortran.cmake @@ -39,7 +39,8 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) file(MAKE_DIRECTORY ${F2003Test_DIR}) # Create a CMakeLists.txt file - file(WRITE ${F2003Test_DIR}/CMakeLists.txt + file( + WRITE ${F2003Test_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ftest Fortran)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -54,29 +55,42 @@ if(BUILD_FORTRAN_MODULE_INTERFACE) # Create a Fortran source file which tries to use iso_c_binding file(WRITE ${F2003Test_DIR}/ftest.f90 - "program main\n" - "use, intrinsic :: iso_c_binding\n" - "end program main\n") + "program main\n" "use, intrinsic :: iso_c_binding\n" + "end program main\n") # Attempt compile the executable - try_compile(FTEST_OK ${F2003Test_DIR} ${F2003Test_DIR} - ftest OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + FTEST_OK ${F2003Test_DIR} + ${F2003Test_DIR} ftest + OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove + # the CMakeFiles directory. file(REMOVE_RECURSE ${F2003Test_DIR}/CMakeFiles) if(FTEST_OK) - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- yes") - set(F2003_FOUND TRUE CACHE BOOL "${CMAKE_Fortran_COMPILER} supports F2003" FORCE) + message( + STATUS + "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- yes") + set(F2003_FOUND + TRUE + CACHE BOOL "${CMAKE_Fortran_COMPILER} supports F2003" FORCE) else() - message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no") + message( + STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports F2003 -- no" + ) message(STATUS "Check output:") message("${COMPILE_OUTPUT}") - message(FATAL_ERROR "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003") + message( + FATAL_ERROR + "BUILD_FORTRAN_MODULE_INTERFACE is set to ON, but the CMAKE_Fortran_COMPILER does not support F2003" + ) endif() else() - message(STATUS "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE.") + message( + STATUS + "Skipped F2003 tests, assuming ${CMAKE_Fortran_COMPILER} supports the f2003 standard. To rerun the F2003 tests, set F2003_FOUND to FALSE." + ) endif() endif() diff --git a/cmake/SundialsSetupHIP.cmake b/cmake/SundialsSetupHIP.cmake index bc5a6c3776..709e335d55 100644 --- a/cmake/SundialsSetupHIP.cmake +++ b/cmake/SundialsSetupHIP.cmake @@ -16,25 +16,37 @@ if(NOT DEFINED ROCM_PATH) if(NOT DEFINED ENV{ROCM_PATH}) - set(ROCM_PATH "/opt/rocm/" CACHE PATH "Path to which ROCm has been installed") + set(ROCM_PATH + "/opt/rocm/" + CACHE PATH "Path to which ROCm has been installed") else() - set(ROCM_PATH "$ENV{ROCM_PATH}" CACHE PATH "Path to which ROCm has been installed") + set(ROCM_PATH + "$ENV{ROCM_PATH}" + CACHE PATH "Path to which ROCm has been installed") endif() endif() if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "/opt/rocm/hip" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH + "/opt/rocm/hip" + CACHE PATH "Path to which HIP has been installed") else() - set(HIP_PATH "$ENV{HIP_PATH}" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH + "$ENV{HIP_PATH}" + CACHE PATH "Path to which HIP has been installed") endif() endif() if(NOT DEFINED HIP_PLATFORM) if(NOT DEFINED ENV{HIP_PLATFORM}) - set(HIP_PLATFORM "amd" CACHE STRING "HIP platform (amd, nvidia)") + set(HIP_PLATFORM + "amd" + CACHE STRING "HIP platform (amd, nvidia)") else() - set(HIP_PLATFORM "$ENV{HIP_PLATFORM}" CACHE STRING "HIP platform (amd, nvidia)") + set(HIP_PLATFORM + "$ENV{HIP_PLATFORM}" + CACHE STRING "HIP platform (amd, nvidia)") endif() endif() @@ -46,7 +58,8 @@ set(CMAKE_PREFIX_PATH "${ROCM_PATH};${HIP_PATH}") find_package(HIP REQUIRED) if("${HIP_COMPILER}" STREQUAL "hcc") - message(FATAL_ERROR "Deprecated HCC compiler is not supported" "Please update ROCm") + message(FATAL_ERROR "Deprecated HCC compiler is not supported" + "Please update ROCm") endif() message(STATUS "HIP version: ${HIP_VERSION}") diff --git a/cmake/SundialsSetupTPLs.cmake b/cmake/SundialsSetupTPLs.cmake index fe57c20a7c..d23bb95503 100644 --- a/cmake/SundialsSetupTPLs.cmake +++ b/cmake/SundialsSetupTPLs.cmake @@ -15,8 +15,8 @@ # --------------------------------------------------------------- # --------------------------------------------------------------- -# Setup MPI, OpenMP, and OpenMP offload first as other TPLs may -# need targets or variables corresponding to these TPLs. +# Setup MPI, OpenMP, and OpenMP offload first as other TPLs may need targets or +# variables corresponding to these TPLs. # --------------------------------------------------------------- # --------------------------------------------------------------- @@ -77,7 +77,6 @@ if(ENABLE_GINKGO) list(APPEND SUNDIALS_TPL_LIST "GINKGO") endif() - # --------------------------------------------------------------- # Find (and test) the hypre libraries # --------------------------------------------------------------- diff --git a/cmake/SundialsSetupTesting.cmake b/cmake/SundialsSetupTesting.cmake index 11a445900d..b261ffe385 100644 --- a/cmake/SundialsSetupTesting.cmake +++ b/cmake/SundialsSetupTesting.cmake @@ -18,17 +18,25 @@ include(CTest) # Check if development tests are enabled -if (SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS) +if(SUNDIALS_TEST_DEVTESTS OR BUILD_BENCHMARKS) # Python is needed to use the test runner find_package(Python3 REQUIRED) # look for the testRunner script in the test directory - find_program(TESTRUNNER testRunner PATHS test NO_DEFAULT_PATH) + find_program( + TESTRUNNER testRunner + PATHS test + NO_DEFAULT_PATH) if(NOT TESTRUNNER) - message(FATAL_ERROR "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue.") + message( + FATAL_ERROR + "Could not locate testRunner. Set SUNDIALS_TEST_DEVTESTS=OFF or BUILD_BENCHMARKS=OFF to continue." + ) endif() message(STATUS "Found testRunner: ${TESTRUNNER}") - set(TESTRUNNER ${TESTRUNNER} CACHE INTERNAL "") + set(TESTRUNNER + ${TESTRUNNER} + CACHE INTERNAL "") endif() @@ -46,7 +54,9 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default output directory was provided make sure it exists if(SUNDIALS_TEST_OUTPUT_DIR) - message(STATUS "Using non-default test output directory: ${SUNDIALS_TEST_OUTPUT_DIR}") + message( + STATUS + "Using non-default test output directory: ${SUNDIALS_TEST_OUTPUT_DIR}") if(NOT EXISTS ${SUNDIALS_TEST_OUTPUT_DIR}) file(MAKE_DIRECTORY ${SUNDIALS_TEST_OUTPUT_DIR}) endif() @@ -54,7 +64,9 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default answer directory was provided make sure it exists if(SUNDIALS_TEST_ANSWER_DIR) - message(STATUS "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}") + message( + STATUS + "Using non-default test answer directory: ${SUNDIALS_TEST_ANSWER_DIR}") if(NOT EXISTS ${SUNDIALS_TEST_ANSWER_DIR}) message(FATAL_ERROR "SUNDIALS_TEST_ANSWER_DIR does not exist!") endif() @@ -62,7 +74,10 @@ if(SUNDIALS_TEST_DEVTESTS) # If a non-default caliper output directory was provided make sure it exists if(SUNDIALS_CALIPER_OUTPUT_DIR) - message(STATUS "Using non-default caliper output directory: ${SUNDIALS_CALIPER_OUTPUT_DIR}") + message( + STATUS + "Using non-default caliper output directory: ${SUNDIALS_CALIPER_OUTPUT_DIR}" + ) if(NOT EXISTS ${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}) file(MAKE_DIRECTORY ${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}) endif() @@ -70,11 +85,16 @@ if(SUNDIALS_TEST_DEVTESTS) # Check if using non-default comparison precisions when testing if(SUNDIALS_TEST_FLOAT_PRECISION GREATER_EQUAL "0") - message(STATUS "Using non-default float precision: ${SUNDIALS_TEST_FLOAT_PRECISION}") + message( + STATUS + "Using non-default float precision: ${SUNDIALS_TEST_FLOAT_PRECISION}") endif() if(SUNDIALS_TEST_INTEGER_PRECISION GREATER_EQUAL "0") - message(STATUS "Using non-default integer precision: ${SUNDIALS_TEST_INTEGER_PRECISION}") + message( + STATUS + "Using non-default integer precision: ${SUNDIALS_TEST_INTEGER_PRECISION}" + ) endif() # @@ -85,32 +105,57 @@ if(SUNDIALS_TEST_DEVTESTS) if(NOT container_exe) find_program(container_exe podman) endif() - set(SUNDIALS_TEST_CONTAINER_EXE ${container_exe} CACHE PATH "Path to docker or podman" FORCE) + set(SUNDIALS_TEST_CONTAINER_EXE + ${container_exe} + CACHE PATH "Path to docker or podman" FORCE) endif() if(SUNDIALS_TEST_CONTAINER_EXE) - add_custom_target(setup_local_ci - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "Pulled SUNDIALS CI containers.") + add_custom_target(setup_local_ci ${CMAKE_COMMAND} -E cmake_echo_color + --cyan "Pulled SUNDIALS CI containers.") - add_custom_target(test_local_ci - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All testing with SUNDIALS CI containers complete.") + add_custom_target( + test_local_ci ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All testing with SUNDIALS CI containers complete.") macro(add_local_ci_target index_size precision tag) string(TOLOWER "${precision}" precision_) set(container sundials-ci-int${index_size}-${precision_}) - set(container_exe_args run ${SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS} -t -d --name ${container} --cap-add SYS_PTRACE - -v ${CMAKE_SOURCE_DIR}:${SUNDIALS_TEST_CONTAINER_MNT} ghcr.io/llnl/${container}:${tag}) - add_custom_target(setup_local_ci_${index_size}_${precision_} + set(container_exe_args + run + ${SUNDIALS_TEST_CONTAINER_RUN_EXTRA_ARGS} + -t + -d + --name + ${container} + --cap-add + SYS_PTRACE + -v + ${CMAKE_SOURCE_DIR}:${SUNDIALS_TEST_CONTAINER_MNT} + ghcr.io/llnl/${container}:${tag}) + add_custom_target( + setup_local_ci_${index_size}_${precision_} COMMENT "Pulling SUNDIALS CI container ghcr.io/llnl/${container}:${tag}" COMMAND ${SUNDIALS_TEST_CONTAINER_EXE} ${container_exe_args}) - add_dependencies(setup_local_ci setup_local_ci_${index_size}_${precision_}) + add_dependencies(setup_local_ci + setup_local_ci_${index_size}_${precision_}) set(container_test_exe ./test_driver.sh) - set(container_test_exe_args --testtype CUSTOM --env env/docker.sh --tpls --sunrealtype ${precision_} --indexsize ${index_size}) - set(container_exe_args exec -w ${SUNDIALS_TEST_CONTAINER_MNT}/test ${container} ${container_test_exe} ${container_test_exe_args}) - add_custom_target(test_local_ci_${index_size}_${precision_} + set(container_test_exe_args + --testtype + CUSTOM + --env + env/docker.sh + --tpls + --sunrealtype + ${precision_} + --indexsize + ${index_size}) + set(container_exe_args + exec -w ${SUNDIALS_TEST_CONTAINER_MNT}/test ${container} + ${container_test_exe} ${container_test_exe_args}) + add_custom_target( + test_local_ci_${index_size}_${precision_} COMMENT "Running tests in CI container ${container}:${tag}" WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${SUNDIALS_TEST_CONTAINER_EXE} ${container_exe_args} @@ -136,11 +181,13 @@ if(SUNDIALS_TEST_UNITTESTS AND SUNDIALS_TEST_ENABLE_GTEST) FetchContent_Declare( googletest URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip - GIT_TAG v1.14.0 - ) + GIT_TAG v1.14.0) if(WIN32) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + # For Windows: Prevent overriding the parent project's compiler/linker + # settings + set(gtest_force_shared_crt + ON + CACHE BOOL "" FORCE) endif() FetchContent_MakeAvailable(googletest) include(GoogleTest) @@ -164,13 +211,11 @@ if(EXAMPLES_INSTALL) endif() # Create test_install and test_install_all targets - add_custom_target(test_install - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All installation tests complete.") + add_custom_target(test_install ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All installation tests complete.") - add_custom_target(test_install_all - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All installation tests complete.") + add_custom_target(test_install_all ${CMAKE_COMMAND} -E cmake_echo_color + --cyan "All installation tests complete.") endif() @@ -180,8 +225,6 @@ if(BUILD_BENCHMARKS) message("SUNDIALS Benchmarking") # Create benchmark targets - add_custom_target(benchmark - ${CMAKE_COMMAND} -E cmake_echo_color --cyan - "All benchmarks complete." - ) + add_custom_target(benchmark ${CMAKE_COMMAND} -E cmake_echo_color --cyan + "All benchmarks complete.") endif() diff --git a/cmake/SundialsTPLOptions.cmake b/cmake/SundialsTPLOptions.cmake index 36e0dc5a1b..40110eed74 100644 --- a/cmake/SundialsTPLOptions.cmake +++ b/cmake/SundialsTPLOptions.cmake @@ -30,12 +30,11 @@ sundials_option(ENABLE_OPENMP BOOL "Enable OpenMP support" OFF) sundials_option(ENABLE_OPENMP_DEVICE BOOL "Enable OpenMP device offloading support" OFF) -# Advanced option to skip OpenMP device offloading support check. -# This is needed for a specific compiler that doesn't correctly -# report its OpenMP spec date (with CMake >= 3.9). +# Advanced option to skip OpenMP device offloading support check. This is needed +# for a specific compiler that doesn't correctly report its OpenMP spec date +# (with CMake >= 3.9). sundials_option(OPENMP_DEVICE_WORKS BOOL - "Skip the OpenMP device offloading support check" OFF - ADVANCED) + "Skip the OpenMP device offloading support check" OFF ADVANCED) # --------------------------------------------------------------- # Enable Pthread support? @@ -61,112 +60,145 @@ sundials_option(ENABLE_HIP BOOL "Enable HIP support" OFF) # ------------------------------------------------------------- sundials_option(ENABLE_SYCL BOOL "Enable SYCL support" OFF) -sundials_option(SUNDIALS_SYCL_2020_UNSUPPORTED BOOL - "Disable the use of some SYCL 2020 features in SUNDIALS libraries and examples" OFF - DEPENDS_ON ENABLE_SYCL - ADVANCED) +sundials_option( + SUNDIALS_SYCL_2020_UNSUPPORTED + BOOL + "Disable the use of some SYCL 2020 features in SUNDIALS libraries and examples" + OFF + DEPENDS_ON ENABLE_SYCL + ADVANCED) # --------------------------------------------------------------- # Enable LAPACK support? # --------------------------------------------------------------- sundials_option(ENABLE_LAPACK BOOL "Enable Lapack support" OFF) -sundials_option(LAPACK_LIBRARIES STRING "Lapack and Blas libraries" "${LAPACK_LIBRARIES}" - DEPENDS_ON ENABLE_LAPACK) +sundials_option(LAPACK_LIBRARIES STRING "Lapack and Blas libraries" + "${LAPACK_LIBRARIES}" DEPENDS_ON ENABLE_LAPACK) -sundials_option(LAPACK_WORKS BOOL "Set to ON to force CMake to accept a given LAPACK configuration" OFF - DEPENDS_ON ENABLE_LAPACK - ADVANCED) +sundials_option( + LAPACK_WORKS BOOL + "Set to ON to force CMake to accept a given LAPACK configuration" OFF + DEPENDS_ON ENABLE_LAPACK + ADVANCED) # --------------------------------------------------------------- # Enable Ginkgo support? # --------------------------------------------------------------- sundials_option(ENABLE_GINKGO BOOL "Enable Ginkgo support" OFF) -sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" "${Ginkgo_DIR}" - DEPENDS_ON ENABLE_GINKGO) +sundials_option(Ginkgo_DIR PATH "Path to the root of a Ginkgo installation" + "${Ginkgo_DIR}" DEPENDS_ON ENABLE_GINKGO) -sundials_option(SUNDIALS_GINKGO_BACKENDS STRING "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, SYCL)" "REF;OMP" - DEPENDS_ON ENABLE_GINKGO) +sundials_option( + SUNDIALS_GINKGO_BACKENDS + STRING + "Which Ginkgo backend(s) to build the SUNDIALS Ginkgo interfaces for (REF, OMP, CUDA, HIP, SYCL)" + "REF;OMP" + DEPENDS_ON ENABLE_GINKGO) -sundials_option(GINKGO_WORKS BOOL "Set to ON to force CMake to accept a given Ginkgo configuration" OFF - DEPENDS_ON ENABLE_GINKGO - ADVANCED) +sundials_option( + GINKGO_WORKS BOOL + "Set to ON to force CMake to accept a given Ginkgo configuration" OFF + DEPENDS_ON ENABLE_GINKGO + ADVANCED) # --------------------------------------------------------------- # Enable MAGMA support? # --------------------------------------------------------------- sundials_option(ENABLE_MAGMA BOOL "Enable MAGMA support" OFF) -sundials_option(MAGMA_DIR PATH "Path to the root of a MAGMA installation" "${MAGMA_DIR}" - DEPENDS_ON ENABLE_MAGMA) +sundials_option(MAGMA_DIR PATH "Path to the root of a MAGMA installation" + "${MAGMA_DIR}" DEPENDS_ON ENABLE_MAGMA) -sundials_option(SUNDIALS_MAGMA_BACKENDS STRING "Which MAGMA backend to use under the SUNDIALS MAGMA interfaces (CUDA, HIP)" "CUDA" - OPTIONS "CUDA;HIP" - DEPENDS_ON ENABLE_MAGMA) +sundials_option( + SUNDIALS_MAGMA_BACKENDS STRING + "Which MAGMA backend to use under the SUNDIALS MAGMA interfaces (CUDA, HIP)" + "CUDA" + OPTIONS "CUDA;HIP" + DEPENDS_ON ENABLE_MAGMA) -sundials_option(MAGMA_WORKS BOOL "Set to ON to force CMake to accept a given MAGMA configuration" OFF - DEPENDS_ON ENABLE_MAGMA - ADVANCED) +sundials_option( + MAGMA_WORKS BOOL + "Set to ON to force CMake to accept a given MAGMA configuration" OFF + DEPENDS_ON ENABLE_MAGMA + ADVANCED) # --------------------------------------------------------------- # Enable SuperLU_DIST support? # --------------------------------------------------------------- sundials_option(ENABLE_SUPERLUDIST BOOL "Enable SuperLU_DIST support" OFF) -sundials_option(SUPERLUDIST_DIR PATH "Path to the root of the SuperLU_DIST installation" "${SUPERLUDIST_DIR}" - DEPENDS_ON ENABLE_SUPERLUDIST) +sundials_option( + SUPERLUDIST_DIR PATH "Path to the root of the SuperLU_DIST installation" + "${SUPERLUDIST_DIR}" DEPENDS_ON ENABLE_SUPERLUDIST) -sundials_option(SUPERLUDIST_INCLUDE_DIRS PATH "SuperLU_DIST include directories" "${SUPERLUDIST_INCLUDE_DIRS}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_INCLUDE_DIRS PATH "SuperLU_DIST include directories" + "${SUPERLUDIST_INCLUDE_DIRS}" + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) -sundials_option(SUPERLUDIST_LIBRARIES STRING "Semi-colon separated list of libraries needed for SuperLU_DIST." "${SUPERLUDIST_LIBRARIES}" - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_LIBRARIES STRING + "Semi-colon separated list of libraries needed for SuperLU_DIST." + "${SUPERLUDIST_LIBRARIES}" + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) -sundials_option(SUPERLUDIST_OpenMP BOOL "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF - DEPENDS_ON ENABLE_SUPERLUDIST) +sundials_option( + SUPERLUDIST_OpenMP BOOL + "Enable SUNDIALS support for SuperLU_DIST OpenMP on-node parallelism" OFF + DEPENDS_ON ENABLE_SUPERLUDIST) -sundials_option(SUPERLUDIST_WORKS BOOL "Set to ON to force CMake to accept a given SuperLU_DIST configuration" OFF - DEPENDS_ON ENABLE_SUPERLUDIST - ADVANCED) +sundials_option( + SUPERLUDIST_WORKS BOOL + "Set to ON to force CMake to accept a given SuperLU_DIST configuration" OFF + DEPENDS_ON ENABLE_SUPERLUDIST + ADVANCED) # --------------------------------------------------------------- # Enable SuperLU_MT support? # --------------------------------------------------------------- sundials_option(ENABLE_SUPERLUMT BOOL "Enable SuperLU_MT support" OFF) -sundials_option(SUPERLUMT_INCLUDE_DIR PATH "SuperLU_MT include directory" "${SUPERLUMT_INCLUDE_DIR}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option(SUPERLUMT_INCLUDE_DIR PATH "SuperLU_MT include directory" + "${SUPERLUMT_INCLUDE_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_LIBRARY_DIR PATH "SuperLU_MT library directory" "${SUPERLUMT_LIBRARY_DIR}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option(SUPERLUMT_LIBRARY_DIR PATH "SuperLU_MT library directory" + "${SUPERLUMT_LIBRARY_DIR}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_LIBRARIES STRING "Semi-colon separated list of additional libraries needed for SuperLU_MT." "${SUPERLUMT_LIBRARIES}" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option( + SUPERLUMT_LIBRARIES STRING + "Semi-colon separated list of additional libraries needed for SuperLU_MT." + "${SUPERLUMT_LIBRARIES}" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" "PTHREAD" - DEPENDS_ON ENABLE_SUPERLUMT) +sundials_option( + SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" + "PTHREAD" DEPENDS_ON ENABLE_SUPERLUMT) -sundials_option(SUPERLUMT_WORKS BOOL "Set to ON to force CMake to accept a given SUPERLUMT configuration" OFF - DEPENDS_ON ENABLE_SUPERLUMT - ADVANCED) +sundials_option( + SUPERLUMT_WORKS BOOL + "Set to ON to force CMake to accept a given SUPERLUMT configuration" OFF + DEPENDS_ON ENABLE_SUPERLUMT + ADVANCED) # --------------------------------------------------------------- # Enable KLU support? # --------------------------------------------------------------- sundials_option(ENABLE_KLU BOOL "Enable KLU support" OFF) -sundials_option(KLU_INCLUDE_DIR PATH "KLU include directory" "${KLU_INCLUDE_DIR}" - DEPENDS_ON ENABLE_KLU) +sundials_option(KLU_INCLUDE_DIR PATH "KLU include directory" + "${KLU_INCLUDE_DIR}" DEPENDS_ON ENABLE_KLU) -sundials_option(KLU_LIBRARY_DIR PATH "KLU library directory" "${KLU_LIBRARY_DIR}" - DEPENDS_ON ENABLE_KLU) +sundials_option(KLU_LIBRARY_DIR PATH "KLU library directory" + "${KLU_LIBRARY_DIR}" DEPENDS_ON ENABLE_KLU) -sundials_option(KLU_WORKS BOOL "Set to ON to force CMake to accept a given KLU configuration" OFF - DEPENDS_ON ENABLE_KLU - ADVANCED) +sundials_option( + KLU_WORKS BOOL "Set to ON to force CMake to accept a given KLU configuration" + OFF + DEPENDS_ON ENABLE_KLU + ADVANCED) # --------------------------------------------------------------- # Enable hypre support? @@ -176,15 +208,17 @@ sundials_option(ENABLE_HYPRE BOOL "Enable hypre support" OFF) sundials_option(HYPRE_DIR PATH "Path to hypre installation" "${HYPRE_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_INCLUDE_DIR PATH "HYPRE include directory" "${HYPRE_INCLUDE_DIR}" - DEPENDS_ON ENABLE_HYPRE) +sundials_option(HYPRE_INCLUDE_DIR PATH "HYPRE include directory" + "${HYPRE_INCLUDE_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_LIBRARY_DIR PATH "HYPRE library directory" "${HYPRE_LIBRARY_DIR}" - DEPENDS_ON ENABLE_HYPRE) +sundials_option(HYPRE_LIBRARY_DIR PATH "HYPRE library directory" + "${HYPRE_LIBRARY_DIR}" DEPENDS_ON ENABLE_HYPRE) -sundials_option(HYPRE_WORKS BOOL "Set to ON to force CMake to accept a given hypre configuration" OFF - DEPENDS_ON ENABLE_HYPRE - ADVANCED) +sundials_option( + HYPRE_WORKS BOOL + "Set to ON to force CMake to accept a given hypre configuration" OFF + DEPENDS_ON ENABLE_HYPRE + ADVANCED) # --------------------------------------------------------------- # Enable PETSc support? @@ -192,23 +226,29 @@ sundials_option(HYPRE_WORKS BOOL "Set to ON to force CMake to accept a given hyp sundials_option(ENABLE_PETSC BOOL "Enable PETSc support" OFF) -sundials_option(PETSC_DIR PATH "Path to the root of a PETSc installation" "${PETSC_DIR}" - DEPENDS_ON ENABLE_PETSC) +sundials_option(PETSC_DIR PATH "Path to the root of a PETSc installation" + "${PETSC_DIR}" DEPENDS_ON ENABLE_PETSC) -sundials_option(PETSC_ARCH STRING "PETSc architecture (optional)" "${PETSC_ARCH}" - DEPENDS_ON ENABLE_PETSC) +sundials_option(PETSC_ARCH STRING "PETSc architecture (optional)" + "${PETSC_ARCH}" DEPENDS_ON ENABLE_PETSC) -sundials_option(PETSC_LIBRARIES STRING "Semi-colon separated list of PETSc link libraries" "${PETSC_LIBRARIES}" - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_LIBRARIES STRING "Semi-colon separated list of PETSc link libraries" + "${PETSC_LIBRARIES}" + DEPENDS_ON ENABLE_PETSC + ADVANCED) -sundials_option(PETSC_INCLUDES STRING "Semi-colon separated list of PETSc include directories" "${PETSC_INCLUDES}" - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_INCLUDES STRING "Semi-colon separated list of PETSc include directories" + "${PETSC_INCLUDES}" + DEPENDS_ON ENABLE_PETSC + ADVANCED) -sundials_option(PETSC_WORKS BOOL "Set to ON to force CMake to accept a given PETSc configuration" OFF - DEPENDS_ON ENABLE_PETSC - ADVANCED) +sundials_option( + PETSC_WORKS BOOL + "Set to ON to force CMake to accept a given PETSc configuration" OFF + DEPENDS_ON ENABLE_PETSC + ADVANCED) # ------------------------------------------------------------- # Enable RAJA support? @@ -218,46 +258,56 @@ sundials_option(ENABLE_RAJA BOOL "Enable RAJA support" OFF) sundials_option(RAJA_DIR PATH "Path to root of RAJA installation" "${RAJA_DIR}" DEPENDS_ON ENABLE_RAJA) -sundials_option(SUNDIALS_RAJA_BACKENDS STRING "Which RAJA backend under the SUNDIALS RAJA interfaces (CUDA, HIP, SYCL)" "CUDA" - OPTIONS "CUDA;HIP;SYCL" - DEPENDS_ON ENABLE_RAJA) +sundials_option( + SUNDIALS_RAJA_BACKENDS STRING + "Which RAJA backend under the SUNDIALS RAJA interfaces (CUDA, HIP, SYCL)" + "CUDA" + OPTIONS "CUDA;HIP;SYCL" + DEPENDS_ON ENABLE_RAJA) # --------------------------------------------------------------- # Enable Trilinos support? # --------------------------------------------------------------- sundials_option(ENABLE_TRILINOS BOOL "Enable Trilinos support" OFF) -sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" "${Trilinos_DIR}" - DEPENDS_ON ENABLE_TRILINOS) - -sundials_option(Trilinos_INTERFACE_CXX_COMPILER STRING - "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_C_COMPILER STRING - "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING - "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING - "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_INTERFACE_MPIEXEC STRING - "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}" - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) - -sundials_option(Trilinos_WORKS BOOL "Set to ON to force CMake to accept a given Trilinos configuration" OFF - DEPENDS_ON ENABLE_TRILINOS - ADVANCED) +sundials_option(Trilinos_DIR PATH "Path to root of Trilinos installation" + "${Trilinos_DIR}" DEPENDS_ON ENABLE_TRILINOS) + +sundials_option( + Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" + "${Trilinos_CXX_COMPILER}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" + "${Trilinos_C_COMPILER}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" + "${Trilinos_MPI_EXEC}" + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) + +sundials_option( + Trilinos_WORKS BOOL + "Set to ON to force CMake to accept a given Trilinos configuration" OFF + DEPENDS_ON ENABLE_TRILINOS + ADVANCED) # --------------------------------------------------------------- # Enable XBraid support? @@ -265,20 +315,26 @@ sundials_option(Trilinos_WORKS BOOL "Set to ON to force CMake to accept a given sundials_option(ENABLE_XBRAID BOOL "Enable XBraid support" OFF) -sundials_option(XBRAID_DIR PATH "Path to the root of an XBraid installation" "${XBRAID_DIR}" - DEPENDS_ON ENABLE_XBRAID) +sundials_option(XBRAID_DIR PATH "Path to the root of an XBraid installation" + "${XBRAID_DIR}" DEPENDS_ON ENABLE_XBRAID) -sundials_option(XBRAID_LIBRARIES STRING "Semi-colon separated list of XBraid link libraries" "${XBRAID_LIBRARIES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_LIBRARIES STRING "Semi-colon separated list of XBraid link libraries" + "${XBRAID_LIBRARIES}" + DEPENDS_ON ENABLE_XBRAID + ADVANCED) -sundials_option(XBRAID_INCLUDES STRING "Semi-colon separated list of XBraid include directories" "${XBRAID_INCLUDES}" - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_INCLUDES STRING + "Semi-colon separated list of XBraid include directories" "${XBRAID_INCLUDES}" + DEPENDS_ON ENABLE_XBRAID + ADVANCED) -sundials_option(XBRAID_WORKS BOOL "Set to ON to force CMake to accept a given XBraid configuration" OFF - DEPENDS_ON ENABLE_XBRAID - ADVANCED) +sundials_option( + XBRAID_WORKS BOOL + "Set to ON to force CMake to accept a given XBraid configuration" OFF + DEPENDS_ON ENABLE_XBRAID + ADVANCED) # ------------------------------------------------------------- # Enable oneMKL support? @@ -286,22 +342,26 @@ sundials_option(XBRAID_WORKS BOOL "Set to ON to force CMake to accept a given XB sundials_option(ENABLE_ONEMKL BOOL "Enable oneMKL support" OFF) -sundials_option(ONEMKL_DIR PATH "Path to root of oneMKL installation" "${ONEMKL_DIR}" - DEPENDS_ON ENABLE_ONEMKL) +sundials_option(ONEMKL_DIR PATH "Path to root of oneMKL installation" + "${ONEMKL_DIR}" DEPENDS_ON ENABLE_ONEMKL) -sundials_option(ONEMKL_WORKS BOOL "Set to ON to force CMake to accept a given oneMKL configuration" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + ONEMKL_WORKS BOOL + "Set to ON to force CMake to accept a given oneMKL configuration" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) -sundials_option(SUNDIALS_ONEMKL_USE_GETRF_LOOP BOOL - "Replace batched getrf call with loop over getrf" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + SUNDIALS_ONEMKL_USE_GETRF_LOOP BOOL + "Replace batched getrf call with loop over getrf" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) -sundials_option(SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL - "Replace batched getrs call with loop over getrs" OFF - DEPENDS_ON ENABLE_ONEMKL - ADVANCED) +sundials_option( + SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL + "Replace batched getrs call with loop over getrs" OFF + DEPENDS_ON ENABLE_ONEMKL + ADVANCED) # --------------------------------------------------------------- # Enable Caliper support? @@ -310,20 +370,24 @@ sundials_option(SUNDIALS_ONEMKL_USE_GETRS_LOOP BOOL sundials_option(ENABLE_CALIPER BOOL "Enable CALIPER support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) -sundials_option(CALIPER_DIR PATH "Path to the root of an CALIPER installation" "${CALIPER_DIR}" - DEPENDS_ON ENABLE_CALIPER) +sundials_option(CALIPER_DIR PATH "Path to the root of an CALIPER installation" + "${CALIPER_DIR}" DEPENDS_ON ENABLE_CALIPER) -sundials_option(CALIPER_WORKS BOOL "Set to ON to force CMake to accept a given CALIPER configuration" OFF - DEPENDS_ON ENABLE_CALIPER - ADVANCED) +sundials_option( + CALIPER_WORKS BOOL + "Set to ON to force CMake to accept a given CALIPER configuration" OFF + DEPENDS_ON ENABLE_CALIPER + ADVANCED) # --------------------------------------------------------------- # Enable Adiak support? # --------------------------------------------------------------- -sundials_option(ENABLE_ADIAK BOOL "Enable Adiak support" OFF DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) +sundials_option(ENABLE_ADIAK BOOL "Enable Adiak support" OFF + DEPENDS_ON SUNDIALS_BUILD_WITH_PROFILING) -sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" "${ADIAK_DIR}" DEPENDS_ON ENABLE_ADIAK) +sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" + "${ADIAK_DIR}" DEPENDS_ON ENABLE_ADIAK) # --------------------------------------------------------------- # Enable Kokkos support? @@ -331,11 +395,14 @@ sundials_option(adiak_DIR PATH "Path to the root of an Adiak installation" "${AD sundials_option(ENABLE_KOKKOS BOOL "Enable Kokkos support" OFF) -sundials_option(Kokkos_DIR PATH "Path to the root of a Kokkos installation" "${Kokkos_DIR}") +sundials_option(Kokkos_DIR PATH "Path to the root of a Kokkos installation" + "${Kokkos_DIR}") -sundials_option(KOKKOS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS - ADVANCED) +sundials_option( + KOKKOS_WORKS BOOL + "Set to ON to force CMake to accept a given Kokkos configuration" OFF + DEPENDS_ON ENABLE_KOKKOS + ADVANCED) # --------------------------------------------------------------- # Enable Kokkos Kernels support? @@ -343,8 +410,12 @@ sundials_option(KOKKOS_WORKS BOOL "Set to ON to force CMake to accept a given Ko sundials_option(ENABLE_KOKKOS_KERNELS BOOL "Enable Kokkos Kernels support" OFF) -sundials_option(KokkosKernels_DIR PATH "Path to the root of a Kokkos Kernels installation" "${KokkosKernels_DIR}") +sundials_option( + KokkosKernels_DIR PATH "Path to the root of a Kokkos Kernels installation" + "${KokkosKernels_DIR}") -sundials_option(KOKKOS_KERNELS_WORKS BOOL "Set to ON to force CMake to accept a given Kokkos configuration" OFF - DEPENDS_ON ENABLE_KOKKOS ENABLE_KOKKOS_KERNELS - ADVANCED) +sundials_option( + KOKKOS_KERNELS_WORKS BOOL + "Set to ON to force CMake to accept a given Kokkos configuration" OFF + DEPENDS_ON ENABLE_KOKKOS ENABLE_KOKKOS_KERNELS + ADVANCED) diff --git a/cmake/macros/SundialsAddBenchmark.cmake b/cmake/macros/SundialsAddBenchmark.cmake index f3b3aec4e6..f5352f2d29 100644 --- a/cmake/macros/SundialsAddBenchmark.cmake +++ b/cmake/macros/SundialsAddBenchmark.cmake @@ -18,37 +18,41 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) # Define single value parameters the macro takes in to set up the test runner # - # NUM_CORES = number of cores (GPU count or CPU count) to run on/number of resource sets - # BENCHMARK_ARGS = arguments to pass to the executable - # IDENTIFIER = suffix to append to end of benchmark name + # NUM_CORES = number of cores (GPU count or CPU count) to run + # on/number of resource sets BENCHMARK_ARGS = arguments to pass to the + # executable IDENTIFIER = suffix to append to end of benchmark name set(oneValueArgs NUM_CORES BENCHMARK_ARGS IDENTIFIER) # TEST_RUNNER_ARGS = command line arguments to pass to the test executable - set(multiValueArgs TEST_RUNNER_ARGS ) + set(multiValueArgs TEST_RUNNER_ARGS) # ENABLE_GPU = indicate this benchmark should be run with GPUs set(options ENABLE_GPU) - cmake_parse_arguments(sundials_add_benchmark - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_benchmark "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # set the target name if(sundials_add_benchmark_IDENTIFIER) set(TARGET_NAME ${NAME}_${sundials_add_benchmark_IDENTIFIER}) else() if(sundials_add_benchmark_BENCHMARK_ARGS) - string(REPLACE " " "_" TEST_SUFFIX "${sundials_add_benchmark_BENCHMARK_ARGS}") + string(REPLACE " " "_" TEST_SUFFIX + "${sundials_add_benchmark_BENCHMARK_ARGS}") set(TARGET_NAME ${NAME}_${TEST_SUFFIX}) else() set(TARGET_NAME ${NAME}_run) endif() endif() - # Create default benchmark caliper output directory if custom directory is not defined + # Create default benchmark caliper output directory if custom directory is not + # defined if(SUNDIALS_CALIPER_OUTPUT_DIR) - set(SUNDIALS_BENCHMARK_OUTPUT_DIR ${SUNDIALS_CALIPER_OUTPUT_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) + set(SUNDIALS_BENCHMARK_OUTPUT_DIR + ${SUNDIALS_CALIPER_OUTPUT_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) else() - set(SUNDIALS_BENCHMARK_OUTPUT_DIR ${PROJECT_BINARY_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) + set(SUNDIALS_BENCHMARK_OUTPUT_DIR + ${PROJECT_BINARY_DIR}/Benchmarking/${BASE_BENCHMARK_NAME}) endif() # make the caliper output directory if it doesn't exist @@ -63,22 +67,24 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) # command line arguments for the test runner script set(TEST_RUNNER_ARGS - "--profile" - "--verbose" - "--executablename=$" - "--outputdir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/output" - "--calidir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/${TARGET_NAME}" - "--nodiff") + "--profile" "--verbose" "--executablename=$" + "--outputdir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/output" + "--calidir=${SUNDIALS_BENCHMARK_OUTPUT_DIR}/${TARGET_NAME}" "--nodiff") # incorporate scheduler arguments into test_runner if(SUNDIALS_SCHEDULER_COMMAND STREQUAL "flux run") set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES}") - elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun" AND ${sundials_add_benchmark_ENABLE_GPU}) - set(SCHEDULER_STRING " --smpiargs=\\\"-gpu\\\" -n${sundials_add_benchmark_NUM_CORES} -a1 -c1 -g1") + elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun" + AND ${sundials_add_benchmark_ENABLE_GPU}) + set(SCHEDULER_STRING + " --smpiargs=\\\"-gpu\\\" -n${sundials_add_benchmark_NUM_CORES} -a1 -c1 -g1" + ) elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "jsrun") set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES} -a1 -c1") elseif(SUNDIALS_SCHEDULER_COMMAND STREQUAL "srun") - set(SCHEDULER_STRING " -n${sundials_add_benchmark_NUM_CORES} --cpus-per-task=1 --ntasks-per-node=1") + set(SCHEDULER_STRING + " -n${sundials_add_benchmark_NUM_CORES} --cpus-per-task=1 --ntasks-per-node=1" + ) endif() string(REPLACE " " ";" SCHEDULER_ARGS "${SCHEDULER_STRING}") string(REPLACE " " ";" SCHEDULER_COMMAND_ARGS "${SUNDIALS_SCHEDULER_COMMAND}") @@ -87,8 +93,11 @@ macro(sundials_add_benchmark NAME EXECUTABLE BASE_BENCHMARK_NAME) set(RUN_COMMAND ${SCHEDULER_COMMAND_ARGS} ${SCHEDULER_ARGS}) list(APPEND TEST_RUNNER_ARGS "--runcommand=\"${RUN_COMMAND}\"") - list(APPEND TEST_RUNNER_ARGS "--runargs=${sundials_add_benchmark_BENCHMARK_ARGS}" "--testname=${TARGET_NAME}") - add_custom_target(${TARGET_NAME} + list(APPEND TEST_RUNNER_ARGS + "--runargs=${sundials_add_benchmark_BENCHMARK_ARGS}" + "--testname=${TARGET_NAME}") + add_custom_target( + ${TARGET_NAME} COMMENT "Running ${TARGET_NAME}" COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} ${TEST_RUNNER_ARGS}) add_dependencies(benchmark ${TARGET_NAME}) diff --git a/cmake/macros/SundialsAddExamplesGinkgo.cmake b/cmake/macros/SundialsAddExamplesGinkgo.cmake index 1e23dfdb58..c723f68f29 100644 --- a/cmake/macros/SundialsAddExamplesGinkgo.cmake +++ b/cmake/macros/SundialsAddExamplesGinkgo.cmake @@ -40,8 +40,8 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) set(multiValueArgs TARGETS BACKENDS) # Parse keyword arguments and options - cmake_parse_arguments(arg - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN}) foreach(example_tuple ${${EXAMPLES_VAR}}) foreach(backend ${arg_BACKENDS}) @@ -87,17 +87,13 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # directories to include - target_include_directories(${example_target} - PRIVATE - "${PROJECT_SOURCE_DIR}/examples/utilities") + target_include_directories( + ${example_target} PRIVATE "${PROJECT_SOURCE_DIR}/examples/utilities") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - ${arg_TARGETS} - sundials_${vector} - Ginkgo::ginkgo - ${EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE ${arg_TARGETS} sundials_${vector} + Ginkgo::ginkgo ${EXTRA_LINK_LIBS}) endif() @@ -105,17 +101,20 @@ macro(sundials_add_examples_ginkgo EXAMPLES_VAR) if("${example_args}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${example_args}) endif() # add example to regression tests if(${arg_UNIT_TEST}) - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} EXAMPLE_TYPE ${example_type} TEST_ARGS ${example_args} NODIFF) else() - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} EXAMPLE_TYPE ${example_type} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/cmake/macros/SundialsAddExecutable.cmake b/cmake/macros/SundialsAddExecutable.cmake index a2582a3485..00508c76b2 100644 --- a/cmake/macros/SundialsAddExecutable.cmake +++ b/cmake/macros/SundialsAddExecutable.cmake @@ -16,30 +16,26 @@ macro(sundials_add_nvector_benchmark NAME) - set(options ) - set(singleValueArgs ) - set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES - INSTALL_SUBDIR) + set(options) + set(singleValueArgs) + set(multiValueArgs SOURCES SUNDIALS_TARGETS LINK_LIBRARIES INSTALL_SUBDIR) - cmake_parse_arguments(arg - "${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${singleValueArgs}" + "${multiValueArgs}" ${ARGN}) set(BENCHMARKS_DIR ${PROJECT_SOURCE_DIR}/benchmarks) - add_executable(${NAME} - ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c - ${arg_SOURCES}) + add_executable(${NAME} ${BENCHMARKS_DIR}/nvector/test_nvector_performance.c + ${arg_SOURCES}) set_target_properties(${NAME} PROPERTIES FOLDER "Benchmarks") - target_include_directories(${NAME} PRIVATE - ${BENCHMARKS_DIR}/nvector) + target_include_directories(${NAME} PRIVATE ${BENCHMARKS_DIR}/nvector) - target_link_libraries(${NAME} PRIVATE - ${arg_SUNDIALS_TARGETS} ${arg_LINK_LIBRARIES} -lm) + target_link_libraries(${NAME} PRIVATE ${arg_SUNDIALS_TARGETS} + ${arg_LINK_LIBRARIES} -lm) install(TARGETS ${NAME} - DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}") + DESTINATION "${BENCHMARKS_INSTALL_PATH}/${arg_INSTALL_SUBDIR}") endmacro(sundials_add_nvector_benchmark) - diff --git a/cmake/macros/SundialsAddLibrary.cmake b/cmake/macros/SundialsAddLibrary.cmake index 199f790e66..e3d0bb893d 100644 --- a/cmake/macros/SundialsAddLibrary.cmake +++ b/cmake/macros/SundialsAddLibrary.cmake @@ -15,45 +15,49 @@ # Wraps the add_library command for sundials specific needs. # --------------------------------------------------------------- - -# The macro: -# -# SUNDIALS_ADD_LIBRARY( -# SOURCES source1 source2 ... -# [HEADERS header1 header2 ...] -# [OBJECT_LIBRARIES objlib1 objlib2 ...] -# [LINK_LIBRARIES ... +# ~~~ +# sundials_add_library( +# SOURCES source1 source2 ... +# [HEADERS header1 header2 ...] +# [OBJECT_LIBRARIES objlib1 objlib2 ...] +# [LINK_LIBRARIES ... +# [ ...] ] +# [INCLUDE_DIRECTORIES ... +# [ ...] ] +# [COMPILE_DEFINITIONS ... +# [ ...] ] +# [COMPILE_OPTIONS ... +# [ ...] ] +# [COMPILE_FEATURES ... # [ ...] ] -# [INCLUDE_DIRECTORIES ... -# [ ...] ] -# [COMPILE_DEFINITIONS ... -# [ ...] ] -# [COMPILE_OPTIONS ... -# [ ...] ] -# [COMPILE_FEATURES ... -# [ ...] ] -# [PROPERTIES ... [ ...] ] -# [INCLUDE_SUBDIR] -# [OUTPUT_NAME name] -# [VERSION version] -# [SOVERSION version] -# [STATIC_ONLY | SHARED_ONLY] -# [OBJECT_LIB_ONLY]) +# [PROPERTIES ... [ ...] ] +# [INCLUDE_SUBDIR] +# [OUTPUT_NAME name] +# [VERSION version] +# [SOVERSION version] +# [STATIC_ONLY | SHARED_ONLY] +# [OBJECT_LIB_ONLY]) +# ~~~ # -# adds libraries to be built from the source files listed in the command +# Adds libraries to be built from the source files listed in the command # invocation. It is a convenient wrapper of the CMake add_library command that # is specific to our usage of add_library in SUNDIALS. # # By default, the macro uses the CMake add_library command to create the # targets: -# - ${_SHARED_LIB_SUFFIX} (will be a shared library) -# - ${_STATIC_LIB_SUFFIX} (will be a static library) -# - _obj${_SHARED_LIB_SUFFIX} (an object library that is used to -# create ${_SHARED_LIB_SUFFIX}) -# - _obj${_STATIC_LIB_SUFFIX} (an object library that is used to -# create ${_STATIC_LIB_SUFFIX}) -# - (an alias to the shared library, if enabled, otherwise an -# alias to the static library) +# +# * ${_SHARED_LIB_SUFFIX} (will be a shared library) +# +# * ${_STATIC_LIB_SUFFIX} (will be a static library) +# +# * _obj${_SHARED_LIB_SUFFIX} (an object library that is used to create +# ${_SHARED_LIB_SUFFIX}) +# +# * _obj${_STATIC_LIB_SUFFIX} (an object library that is used to create +# ${_STATIC_LIB_SUFFIX}) +# +# * (an alias to the shared library, if enabled, otherwise an alias to +# the static library) # # The SOURCES input is a list of source files used to create the library. # @@ -108,17 +112,25 @@ # # The option OBJECT_LIB_ONLY will cause the macro to only create the object # library targets. + macro(sundials_add_library target) set(options STATIC_ONLY SHARED_ONLY OBJECT_LIB_ONLY) set(oneValueArgs INCLUDE_SUBDIR OUTPUT_NAME VERSION SOVERSION) - set(multiValueArgs SOURCES HEADERS OBJECT_LIBRARIES LINK_LIBRARIES - INCLUDE_DIRECTORIES COMPILE_DEFINITIONS COMPILE_OPTIONS - COMPILE_FEATURES PROPERTIES) + set(multiValueArgs + SOURCES + HEADERS + OBJECT_LIBRARIES + LINK_LIBRARIES + INCLUDE_DIRECTORIES + COMPILE_DEFINITIONS + COMPILE_OPTIONS + COMPILE_FEATURES + PROPERTIES) # parse keyword arguments/options - cmake_parse_arguments(sundials_add_library - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_library "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # library types to create set(_libtypes "") @@ -150,14 +162,15 @@ macro(sundials_add_library target) # -------------------------------------------------------------------------- # create the target for the object library - add_library(${obj_target} OBJECT ${sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) + add_library(${obj_target} OBJECT ${sources} + ${sundials_add_library_UNPARSED_ARGUMENTS}) set_target_properties(${obj_target} PROPERTIES FOLDER "obj") # add all object libraries to object library if(sundials_add_library_OBJECT_LIBRARIES) target_link_libraries(${obj_target} - PRIVATE ${sundials_add_library_OBJECT_LIBRARIES}) + PRIVATE ${sundials_add_library_OBJECT_LIBRARIES}) endif() # add all link libraries to object library @@ -173,9 +186,11 @@ macro(sundials_add_library target) else() set(_all_libs ${sundials_add_library_LINK_LIBRARIES}) endif() - # Due to various issues in CMake, particularly https://gitlab.kitware.com/cmake/cmake/-/issues/25365, - # we create a fake custom target to enforce a build order. Without this, parallel builds - # might fail with an error about a missing '.mod' file when Fortran is enabled (see GitHub #410). + # Due to various issues in CMake, particularly + # https://gitlab.kitware.com/cmake/cmake/-/issues/25365, we create a fake + # custom target to enforce a build order. Without this, parallel builds + # might fail with an error about a missing '.mod' file when Fortran is + # enabled (see GitHub #410). set(_stripped_all_libs ${_all_libs}) list(FILTER _stripped_all_libs EXCLUDE REGEX "PUBLIC|INTERFACE|PRIVATE") foreach(_item ${_stripped_all_libs}) @@ -184,7 +199,8 @@ macro(sundials_add_library target) endif() endforeach() add_custom_target(fake_to_force_build_order_${obj_target}) - add_dependencies(fake_to_force_build_order_${obj_target} ${_stripped_all_libs}) + add_dependencies(fake_to_force_build_order_${obj_target} + ${_stripped_all_libs}) add_dependencies(${obj_target} fake_to_force_build_order_${obj_target}) target_link_libraries(${obj_target} ${_all_libs}) endif() @@ -194,20 +210,21 @@ macro(sundials_add_library target) target_link_libraries(${obj_target} PUBLIC caliper) endif() if(ENABLE_ADIAK) - target_link_libraries(${obj_target} PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) + target_link_libraries(${obj_target} PUBLIC adiak::adiak + ${CMAKE_DL_LIBS}) endif() endif() # add includes to object library - target_include_directories(${obj_target} - PUBLIC - $ - $ - $ - $ - ) + target_include_directories( + ${obj_target} + PUBLIC $ + $ + $ + $) if(sundials_add_library_INCLUDE_DIRECTORIES) - string(REPLACE "{{libtype}}" "${_libtype}" _includes "${sundials_add_library_INCLUDE_DIRECTORIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _includes + "${sundials_add_library_INCLUDE_DIRECTORIES}") target_include_directories(${obj_target} ${_includes}) endif() @@ -220,25 +237,30 @@ macro(sundials_add_library target) # add all other compile definitions to object library if(sundials_add_library_COMPILE_DEFINITIONS) - target_compile_definitions(${obj_target} ${sundials_add_library_COMPILE_DEFINITIONS}) + target_compile_definitions(${obj_target} + ${sundials_add_library_COMPILE_DEFINITIONS}) endif() # add compile options to object library if(sundials_add_library_COMPILE_OPTIONS) - target_compile_options(${obj_target} ${sundials_add_library_COMPILE_OPTIONS}) + target_compile_options(${obj_target} + ${sundials_add_library_COMPILE_OPTIONS}) endif() # add compile features if(sundials_add_library_COMPILE_FEATURES) - target_compile_features(${obj_target} ${sundials_add_library_COMPILE_FEATURES}) + target_compile_features(${obj_target} + ${sundials_add_library_COMPILE_FEATURES}) endif() # object files going into shared libs need PIC code - set_target_properties(${obj_target} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) + set_target_properties(${obj_target} PROPERTIES POSITION_INDEPENDENT_CODE + TRUE) # set any other properties if(sundials_add_library_PROPERTIES) - string(REPLACE "{{libtype}}" "${_libtype}" _properties "${sundials_add_library_PROPERTIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _properties + "${sundials_add_library_PROPERTIES}") set_target_properties(${obj_target} PROPERTIES ${_properties}) endif() @@ -264,19 +286,24 @@ macro(sundials_add_library target) endforeach() endif() - add_library(${_actual_target_name} ${_libtype} ${_object_sources} ${sundials_add_library_UNPARSED_ARGUMENTS}) + add_library( + ${_actual_target_name} ${_libtype} ${_object_sources} + ${sundials_add_library_UNPARSED_ARGUMENTS}) set_target_properties(${_actual_target_name} PROPERTIES FOLDER "src") # add all link libraries if(SUNDIALS_MATH_LIBRARY) - target_link_libraries(${_actual_target_name} PRIVATE "${SUNDIALS_MATH_LIBRARY}") + target_link_libraries(${_actual_target_name} + PRIVATE "${SUNDIALS_MATH_LIBRARY}") endif() if(SUNDIALS_RT_LIBRARY) - target_link_libraries(${_actual_target_name} PRIVATE "${SUNDIALS_RT_LIBRARY}") + target_link_libraries(${_actual_target_name} + PRIVATE "${SUNDIALS_RT_LIBRARY}") endif() if(sundials_add_library_LINK_LIBRARIES) - target_link_libraries(${_actual_target_name} ${sundials_add_library_LINK_LIBRARIES}) + target_link_libraries(${_actual_target_name} + ${sundials_add_library_LINK_LIBRARIES}) endif() if(SUNDIALS_BUILD_WITH_PROFILING) @@ -284,90 +311,103 @@ macro(sundials_add_library target) target_link_libraries(${_actual_target_name} PUBLIC caliper) endif() if(ENABLE_ADIAK) - target_link_libraries(${_actual_target_name} PUBLIC adiak::adiak ${CMAKE_DL_LIBS}) + target_link_libraries(${_actual_target_name} PUBLIC adiak::adiak + ${CMAKE_DL_LIBS}) endif() endif() # add common includes + # # Building: public, config/export generated, and shared private headers + # # Installing: installed include directory - target_include_directories(${_actual_target_name} PUBLIC - $ - $ - $ - $ - $) + target_include_directories( + ${_actual_target_name} + PUBLIC $ + $ + $ + $ + $) # add all other includes if(sundials_add_library_INCLUDE_DIRECTORIES) - string(REPLACE "{{libtype}}" "${_libtype}" _includes "${sundials_add_library_INCLUDE_DIRECTORIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _includes + "${sundials_add_library_INCLUDE_DIRECTORIES}") target_include_directories(${_actual_target_name} ${_includes}) endif() # add compile definitions for SUNDIALS_EXPORT if(${_libtype} MATCHES "STATIC") - target_compile_definitions(${_actual_target_name} PUBLIC SUNDIALS_STATIC_DEFINE) + target_compile_definitions(${_actual_target_name} + PUBLIC SUNDIALS_STATIC_DEFINE) else() target_compile_definitions(${obj_target} PRIVATE sundials_core_EXPORTS) endif() # add all other compile definitions if(sundials_add_library_COMPILE_DEFINITIONS) - target_compile_definitions(${_actual_target_name} ${sundials_add_library_COMPILE_DEFINITIONS}) + target_compile_definitions(${_actual_target_name} + ${sundials_add_library_COMPILE_DEFINITIONS}) endif() # add all compile options if(sundials_add_library_COMPILE_OPTIONS) - target_compile_options(${_actual_target_name} ${sundials_add_library_COMPILE_OPTIONS}) + target_compile_options(${_actual_target_name} + ${sundials_add_library_COMPILE_OPTIONS}) endif() # add compile features if(sundials_add_library_COMPILE_FEATURES) - target_compile_features(${_actual_target_name} ${sundials_add_library_COMPILE_FEATURES}) + target_compile_features(${_actual_target_name} + ${sundials_add_library_COMPILE_FEATURES}) endif() - # exported targets are in the SUNDIALS:: namespace, so we remove the sundials_ prefix from the exported name + # exported targets are in the SUNDIALS:: namespace, so we remove the + # sundials_ prefix from the exported name string(REPLACE "sundials_" "" _export_name "${_actual_target_name}") - set_target_properties(${_actual_target_name} PROPERTIES EXPORT_NAME ${_export_name}) + set_target_properties(${_actual_target_name} PROPERTIES EXPORT_NAME + ${_export_name}) - # create an alias to match the exported target name, this way another projects can use it with either find_package() or add_subdirectory() + # create an alias to match the exported target name, this way another + # projects can use it with either find_package() or add_subdirectory() add_library(SUNDIALS::${_export_name} ALIAS ${_actual_target_name}) # set the correct output name if(sundials_add_library_OUTPUT_NAME) - if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) AND ${_libtype} MATCHES "STATIC") - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static" - CLEAN_DIRECT_OUTPUT 1 - ) + if((MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + AND ${_libtype} MATCHES "STATIC") + set_target_properties( + ${_actual_target_name} + PROPERTIES OUTPUT_NAME "${sundials_add_library_OUTPUT_NAME}_static" + CLEAN_DIRECT_OUTPUT 1) else() - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} - CLEAN_DIRECT_OUTPUT 1 - ) + set_target_properties( + ${_actual_target_name} + PROPERTIES OUTPUT_NAME ${sundials_add_library_OUTPUT_NAME} + CLEAN_DIRECT_OUTPUT 1) endif() else() - set_target_properties(${_actual_target_name} PROPERTIES - OUTPUT_NAME ${target} - CLEAN_DIRECT_OUTPUT 1 - ) + set_target_properties( + ${_actual_target_name} PROPERTIES OUTPUT_NAME ${target} + CLEAN_DIRECT_OUTPUT 1) endif() # set the library versions if(sundials_add_library_VERSION) - set_target_properties(${_actual_target_name} PROPERTIES - VERSION ${sundials_add_library_VERSION} - ) + set_target_properties( + ${_actual_target_name} PROPERTIES VERSION + ${sundials_add_library_VERSION}) endif() if(sundials_add_library_SOVERSION) - set_target_properties(${_actual_target_name} PROPERTIES - SOVERSION ${sundials_add_library_SOVERSION} - ) + set_target_properties( + ${_actual_target_name} PROPERTIES SOVERSION + ${sundials_add_library_SOVERSION}) endif() # set any other properties if(sundials_add_library_PROPERTIES) - string(REPLACE "{{libtype}}" "${_libtype}" _properties "${sundials_add_library_PROPERTIES}") + string(REPLACE "{{libtype}}" "${_libtype}" _properties + "${sundials_add_library_PROPERTIES}") set_target_properties(${_actual_target_name} PROPERTIES ${_properties}) endif() @@ -383,8 +423,10 @@ macro(sundials_add_library target) # -------------------------------------------------------------------------- if(sundials_add_library_HEADERS) - install(FILES ${sundials_add_library_HEADERS} - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${sundials_add_library_INCLUDE_SUBDIR}") + install( + FILES ${sundials_add_library_HEADERS} + DESTINATION + "${CMAKE_INSTALL_INCLUDEDIR}/${sundials_add_library_INCLUDE_SUBDIR}") endif() # -------------------------------------------------------------------------- @@ -395,21 +437,27 @@ macro(sundials_add_library target) add_library(${target}_obj ALIAS ${target}_obj${_SHARED_LIB_SUFFIX}) if(NOT sundials_add_library_OBJECT_LIB_ONLY) add_library(${target} ALIAS ${target}${_SHARED_LIB_SUFFIX}) - set(_SUNDIALS_ALIAS_TARGETS "${target}->${target}${_SHARED_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_ALIAS_TARGETS + "${target}->${target}${_SHARED_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" + CACHE INTERNAL "" FORCE) # Namespaced alias for using build directory directly string(REPLACE "sundials_" "" _export_name "${target}") - add_library(SUNDIALS::${_export_name} ALIAS ${target}${_SHARED_LIB_SUFFIX}) + add_library(SUNDIALS::${_export_name} ALIAS + ${target}${_SHARED_LIB_SUFFIX}) endif() else() add_library(${target}_obj ALIAS ${target}_obj${_STATIC_LIB_SUFFIX}) if(NOT sundials_add_library_OBJECT_LIB_ONLY) add_library(${target} ALIAS ${target}${_STATIC_LIB_SUFFIX}) - set(_SUNDIALS_ALIAS_TARGETS "${target}->${target}${_STATIC_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_ALIAS_TARGETS + "${target}->${target}${_STATIC_LIB_SUFFIX};${_SUNDIALS_ALIAS_TARGETS}" + CACHE INTERNAL "" FORCE) # Namespaced alias for using build directory directly string(REPLACE "sundials_" "" _export_name "${target}") - add_library(SUNDIALS::${_export_name} ALIAS ${target}${_STATIC_LIB_SUFFIX}) + add_library(SUNDIALS::${_export_name} ALIAS + ${target}${_STATIC_LIB_SUFFIX}) endif() endif() @@ -419,40 +467,45 @@ macro(sundials_add_library target) if(NOT sundials_add_library_OBJECT_LIB_ONLY) string(REPLACE "sundials_" "" _comp_name "${target}") - set(_SUNDIALS_INSTALLED_COMPONENTS "${_comp_name};${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "${_comp_name};${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() endmacro(sundials_add_library) - macro(sundials_add_f2003_library target) - set(options ) + set(options) set(oneValueArgs OUTPUT_NAME VERSION SOVERSION) - set(multiValueArgs SOURCES OBJECT_LIBRARIES LINK_LIBRARIES INCLUDE_DIRECTORIES - COMPILE_DEFINITIONS COMPILE_OPTIONS PROPERTIES) + set(multiValueArgs + SOURCES + OBJECT_LIBRARIES + LINK_LIBRARIES + INCLUDE_DIRECTORIES + COMPILE_DEFINITIONS + COMPILE_OPTIONS + PROPERTIES) # parse keyword arguments/options - cmake_parse_arguments(sundials_add_f2003_library - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_add_f2003_library "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(CMAKE_Fortran_MODULE_DIRECTORY) set(_includes - PUBLIC - $ - $ - ) - set(_properties PROPERTIES - Fortran_MODULE_DIRECTORY "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}" + PUBLIC $ + $) + set(_properties + PROPERTIES Fortran_MODULE_DIRECTORY + "${CMAKE_Fortran_MODULE_DIRECTORY}_{{libtype}}" WINDOWS_EXPORT_ALL_SYMBOLS ON) else() set(_includes - PUBLIC - $ - $ - ) - set(_properties PROPERTIES - Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir" + PUBLIC $ + $) + set(_properties + PROPERTIES Fortran_MODULE_DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${target}.dir" WINDOWS_EXPORT_ALL_SYMBOLS ON) endif() @@ -462,30 +515,27 @@ macro(sundials_add_f2003_library target) if(TARGET ${_clib_name}) set(_clib_target ${_clib_name}) else() - set(_clib_target ) + set(_clib_target) endif() - sundials_add_library(${target} + sundials_add_library( + ${target} SOURCES ${sundials_add_f2003_library_SOURCES} OBJECT_LIBRARIES ${sundials_add_f2003_library_OBJECT_LIBRARIES} - LINK_LIBRARIES - PUBLIC ${_clib_target} # depend on the c library - ${sundials_add_f2003_library_LINK_LIBRARIES} - INCLUDE_DIRECTORIES - ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} - ${_includes} - COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} - PUBLIC "SUNDIALS_INT${SUNDIALS_INDEX_SIZE}_T" + LINK_LIBRARIES PUBLIC ${_clib_target} # depend on the c library + ${sundials_add_f2003_library_LINK_LIBRARIES} + INCLUDE_DIRECTORIES ${sundials_add_f2003_library_INCLUDE_DIRECTORIES} + ${_includes} + COMPILE_DEFINITIONS ${sundials_add_f2003_library_COMPILE_DEFINITIONS} PUBLIC + "SUNDIALS_INT${SUNDIALS_INDEX_SIZE}_T" COMPILE_OPTIONS ${sundials_add_f2003_library_COMPILE_OPTIONS} PROPERTIES ${sundials_add_f2003_library_PROPERTIES} ${_properties} OUTPUT_NAME ${sundials_add_f2003_library_OUTPUT_NAME} VERSION ${sundials_add_f2003_library_VERSION} SOVERSION ${sundials_add_f2003_library_SOVERSION} - ${sundials_add_f2003_library_UNPARSED_ARGUMENTS} - ) + ${sundials_add_f2003_library_UNPARSED_ARGUMENTS}) endmacro() - macro(append_static_suffix libs_in libs_out) set(${libs_out} "") foreach(_lib ${${libs_in}}) diff --git a/cmake/macros/SundialsAddTest.cmake b/cmake/macros/SundialsAddTest.cmake index 33eb8d7fa1..a1eb373b67 100644 --- a/cmake/macros/SundialsAddTest.cmake +++ b/cmake/macros/SundialsAddTest.cmake @@ -11,12 +11,40 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# -# SUNDIALS_ADD_TEST( ) + +# ~~~ +# sundials_add_test( +# [NODIFF] +# [MPI_NPROCS num_processes] +# [FLOAT_PRECISION num_digits] +# [INTEGER_PRECISION percent_difference] +# [ANSWER_DIR path] +# [ANSWER_FIEL file] +# [EXAMPLE_TYPE type] +# [TEST_ARGS arg1 arg2 ...]) +# ~~~ # # CMake macro to add a SUNDIALS regression test. Keyword input arguments can be -# added after to set regression test options (see oneValueArgs and -# multiValueArgs below). +# added after to set regression test options. +# +# The option NODIFF disables comparison of the test output against the answer +# file +# +# The option MPI_NPROCS sets the number of mpi tasks to use in parallel tests +# +# The option FLOAT_PRECISION set the precision (number of digits) for floating +# point failure comparisons. To use the default value, either don't provide the +# keyword, or provide the value "default". +# +# The option INTEGER_PRECISION sets the integer percentage difference for +# failure comparison. +# +# The option ANSWER_DIR sets the path to the directory containing the test +# answer file +# +# The option ANSWER_FILE set the name of test answer file +# +# The option EXAMPLE_TYPE set the example type i.e., release or develop examples # # When SUNDIALS_TEST_DEVTESTS is OFF (default) the executable is run and success # or failure is determined by the executable return value (zero or non-zero @@ -32,56 +60,44 @@ # for all tests with the cache variables SUNDIALS_TEST_FLOAT_PRECISION and # SUNDIALS_TEST_INTEGER_PRECISION. # -# -D SUNDIALS_TEST_FLOAT_PRECISION= -# -D SUNDIALS_TEST_INTEGER_PRECISION=<% difference> +# -D SUNDIALS_TEST_FLOAT_PRECISION= +# +# -D SUNDIALS_TEST_INTEGER_PRECISION=<% difference> # # By default testing output is written to builddir/Testing/output and the .out # answer file directory is set using the ANSWER_DIR keyword input to # sourcedir/examples/package/testdir. These can be changed by setting the cache # variables SUNDIALS_TEST_OUTPUT_DIR and SUNDIALS_TEST_ANSWER_DIR. # -# -D SUNDIALS_TEST_OUTPUT_DIR= -# -D SUNDIALS_TEST_ANSWER_DIR= +# -D SUNDIALS_TEST_OUTPUT_DIR= +# +# -D SUNDIALS_TEST_ANSWER_DIR= # # By default the caliper output is written to builddir/Caliper. This can be # changed by setting the cache variable SUNDIALS_CALIPER_OUTPUT_DIR. # # -D SUNDIALS_CALIPER_OUTPUT_DIR= -# -# ------------------------------------------------------------------------------ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) - # macro options - # NODIFF = do not diff the test output against an answer file set(options "NODIFF") - - # macro keyword inputs followed by a single value - # MPI_NPROCS = number of mpi tasks to use in parallel tests - # FLOAT_PRECISION = precision for floating point failure comparision (num digits), - # to use the default, either don't provide the keyword, or - # provide the value "default" - # INTEGER_PRECISION = integer percentage difference for failure comparison - # ANSWER_DIR = path to the directory containing the test answer file - # ANSWER_FILE = name of test answer file - # EXAMPLE_TYPE = release or develop examples set(oneValueArgs "MPI_NPROCS" "FLOAT_PRECISION" "INTEGER_PRECISION" - "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE") - - # macro keyword inputs followed by multiple values - # TEST_ARGS = command line arguments to pass to the test executable + "ANSWER_DIR" "ANSWER_FILE" "EXAMPLE_TYPE") set(multiValueArgs "TEST_ARGS" "EXTRA_ARGS") # parse inputs and create variables SUNDIALS_ADD_TEST_ - cmake_parse_arguments(SUNDIALS_ADD_TEST - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(SUNDIALS_ADD_TEST "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # check that the test is not excluded string(TOLOWER "exclude-${SUNDIALS_PRECISION}" _exclude_precision) - if( ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL "exclude") OR - ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL _exclude_precision) ) + if(("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL "exclude") + OR ("${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" STREQUAL _exclude_precision)) - message(STATUS "Skipped test ${NAME} because it had type ${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}") + message( + STATUS + "Skipped test ${NAME} because it had type ${SUNDIALS_ADD_TEST_EXAMPLE_TYPE}" + ) else() @@ -90,16 +106,14 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) # run all tests (standard and develop) with the test runner # command line arguments for the test runner script - set(TEST_ARGS - "--verbose" - "--testname=${NAME}" - "--executablename=$" - ) + set(TEST_ARGS "--verbose" "--testname=${NAME}" + "--executablename=$") if(SUNDIALS_TEST_PROFILE) list(APPEND TEST_ARGS "--profile") - if (SUNDIALS_CALIPER_OUTPUT_DIR) - list(APPEND TEST_ARGS "--calidir=${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}") + if(SUNDIALS_CALIPER_OUTPUT_DIR) + list(APPEND TEST_ARGS + "--calidir=${SUNDIALS_CALIPER_OUTPUT_DIR}/Example/${JOB_ID}") else() list(APPEND TEST_ARGS "--calidir=${TEST_OUTPUT_DIR}/Caliper/Example") endif() @@ -129,28 +143,40 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) # do not diff the output and answer files list(APPEND TEST_ARGS "--nodiff") else() - # set a non-default floating point precision (number of digits, default 4) - if(SUNDIALS_ADD_TEST_FLOAT_PRECISION AND - (NOT SUNDIALS_ADD_TEST_FLOAT_PRECISION MATCHES "DEFAULT|default")) - list(APPEND TEST_ARGS "--floatprecision=${SUNDIALS_ADD_TEST_FLOAT_PRECISION}") + # set a non-default floating point precision (number of digits, default + # 4) + if(SUNDIALS_ADD_TEST_FLOAT_PRECISION + AND (NOT SUNDIALS_ADD_TEST_FLOAT_PRECISION MATCHES "DEFAULT|default" + )) + list(APPEND TEST_ARGS + "--floatprecision=${SUNDIALS_ADD_TEST_FLOAT_PRECISION}") elseif(SUNDIALS_TEST_FLOAT_PRECISION GREATER_EQUAL "0") - list(APPEND TEST_ARGS "--floatprecision=${SUNDIALS_TEST_FLOAT_PRECISION}") + list(APPEND TEST_ARGS + "--floatprecision=${SUNDIALS_TEST_FLOAT_PRECISION}") endif() # set a non-default integer precision (percent difference, default 10%) - if(SUNDIALS_ADD_TEST_INTEGER_PRECISION AND - (NOT SUNDIALS_ADD_TEST_INTEGER_PRECISION MATCHES "DEFAULT|default")) - list(APPEND TEST_ARGS "--integerpercentage=${SUNDIALS_ADD_TEST_INTEGER_PRECISION}") + if(SUNDIALS_ADD_TEST_INTEGER_PRECISION + AND (NOT SUNDIALS_ADD_TEST_INTEGER_PRECISION MATCHES + "DEFAULT|default")) + list(APPEND TEST_ARGS + "--integerpercentage=${SUNDIALS_ADD_TEST_INTEGER_PRECISION}") elseif(SUNDIALS_TEST_INTEGER_PRECISION GREATER_EQUAL "0") - list(APPEND TEST_ARGS "--integerpercentage=${SUNDIALS_TEST_INTEGER_PRECISION}") + list(APPEND TEST_ARGS + "--integerpercentage=${SUNDIALS_TEST_INTEGER_PRECISION}") endif() endif() # check if this test is run with MPI and set the MPI run command - if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) OR (SUNDIALS_TEST_MPIRUN_COMMAND))) - if (SUNDIALS_TEST_MPIRUN_COMMAND) - set(RUN_COMMAND "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}") + if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) + OR (SUNDIALS_TEST_MPIRUN_COMMAND))) + if(SUNDIALS_TEST_MPIRUN_COMMAND) + set(RUN_COMMAND + "${SUNDIALS_TEST_MPIRUN_COMMAND} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" + ) elseif(MPIEXEC_EXECUTABLE) - set(RUN_COMMAND "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}") + set(RUN_COMMAND + "${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${MPIEXEC_PREFLAGS}" + ) endif() # remove trailing white space (empty MPIEXEC_PREFLAGS) as it can cause @@ -170,19 +196,22 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) set(_run_args "${_run_args} ${_extra_args}") unset(_extra_args) endif() - if (_run_args) + if(_run_args) string(STRIP "${_run_args}" _run_args) list(APPEND TEST_ARGS "--runargs=\"${_run_args}\"") unset(_run_args) endif() - # create test case with the corresponding test runner command and arguments - # all tests are added during development and only unlabeled tests when released - add_test(NAME ${NAME} COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} ${TEST_ARGS}) + # create test case with the corresponding test runner command and + # arguments all tests are added during development and only unlabeled + # tests when released + add_test(NAME ${NAME} COMMAND ${PYTHON_EXECUTABLE} ${TESTRUNNER} + ${TEST_ARGS}) elseif(NOT SUNDIALS_ADD_TEST_EXAMPLE_TYPE) - # if a test type was not set then it is a standard test that returns pass/fail + # if a test type was not set then it is a standard test that returns + # pass/fail # convert string to list if(SUNDIALS_ADD_TEST_TEST_ARGS) @@ -190,15 +219,27 @@ macro(SUNDIALS_ADD_TEST NAME EXECUTABLE) endif() # check if this test is run with MPI and add the test run command - if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) OR (SUNDIALS_TEST_MPIRUN_COMMAND))) + if((SUNDIALS_ADD_TEST_MPI_NPROCS) AND ((MPIEXEC_EXECUTABLE) + OR (SUNDIALS_TEST_MPIRUN_COMMAND))) if(MPIEXEC_PREFLAGS) string(REPLACE " " ";" PREFLAGS "${MPIEXEC_PREFLAGS}") endif() - if (SUNDIALS_TEST_MPIRUN_COMMAND) - string(REPLACE " " ";" MPI_EXEC_ARGS "${SUNDIALS_TEST_MPIRUN_COMMAND}") - add_test(NAME ${NAME} COMMAND ${MPI_EXEC_ARGS} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} $ ${TEST_ARGS}) + if(SUNDIALS_TEST_MPIRUN_COMMAND) + string(REPLACE " " ";" MPI_EXEC_ARGS + "${SUNDIALS_TEST_MPIRUN_COMMAND}") + add_test( + NAME ${NAME} + COMMAND + ${MPI_EXEC_ARGS} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} + $ ${TEST_ARGS}) else() - add_test(NAME ${NAME} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} $ ${TEST_ARGS}) + add_test( + NAME ${NAME} + COMMAND + ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} + ${SUNDIALS_ADD_TEST_MPI_NPROCS} ${PREFLAGS} + $ ${TEST_ARGS}) endif() else() add_test(NAME ${NAME} COMMAND $ ${TEST_ARGS}) diff --git a/cmake/macros/SundialsAddTestInstall.cmake b/cmake/macros/SundialsAddTestInstall.cmake index cf2a6fb76b..159fc54cd6 100644 --- a/cmake/macros/SundialsAddTestInstall.cmake +++ b/cmake/macros/SundialsAddTestInstall.cmake @@ -11,31 +11,30 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# -# SUNDIALS_ADD_TEST_INSTALL( ) + +# ~~~ +# sundials_add_test_install( +# EXECUTABLE exec) +# ~~~ # # CMake macro to add a Sundials installation smoke tests. -# --------------------------------------------------------------- +# +# The input is the SUNDIALS package name e.g., cvode, arkode, +# etc. +# +# The input is the test directory name e.g., serial, C_parallel, etc. +# +# The input EXECUTABLE is the executable to add to make test_install target macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) - # required macro args - # PACKAGE = Sundials package name (e.g., cvode, arkode, etc.) - # TESTDIR = Test directory name (e.g., serial, C_parallel, etc.) - - # macro options - set(options ) - - # macro keyword inputs followed by a single value - # EXECUTABLE = executable to add to make test_install target + set(options) set(oneValueArgs EXECUTABLE) - - # macro keyword inputs followed by multiple values - set(multiValueArgs ) + set(multiValueArgs) # parse inputs and create variables SUNDIALS_ADD_TEST_ - cmake_parse_arguments(SUNDIALS_ADD_TEST_INSTALL - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(SUNDIALS_ADD_TEST_INSTALL "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) if(SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE) @@ -45,22 +44,26 @@ macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) endif() # build and run only the desired install test - add_custom_target(test_install_${PACKAGE}_${TESTDIR} + add_custom_target( + test_install_${PACKAGE}_${TESTDIR} COMMENT "Running ${PACKAGE} installation tests" WORKING_DIRECTORY ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} VERBATIM - COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > cmake.out - COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} --target ${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE} > make.out - COMMAND ${CMAKE_CTEST_COMMAND} -R ^${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE}$) + COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > + cmake.out + COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_DIR}/${PACKAGE}/${TESTDIR} + --target ${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE} > make.out + COMMAND ${CMAKE_CTEST_COMMAND} -R + ^${SUNDIALS_ADD_TEST_INSTALL_EXECUTABLE}$) # make test_install depend on test_install_package add_dependencies(test_install test_install_${PACKAGE}_${TESTDIR}) endif() - # Possible extensions: - # * Make EXECUTABLE a multiple value option to add several tests to test_install - # * Make test_install_all only available when development tests are turned on + # Possible extensions: * Make EXECUTABLE a multiple value option to add + # several tests to test_install * Make test_install_all only available when + # development tests are turned on # create testing directory if necessary if(NOT EXISTS ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR}) @@ -68,12 +71,15 @@ macro(SUNDIALS_ADD_TEST_INSTALL PACKAGE TESTDIR) endif() # build and run all install tests - add_custom_target(test_install_all_${PACKAGE}_${TESTDIR} + add_custom_target( + test_install_all_${PACKAGE}_${TESTDIR} COMMENT "Running ${PACKAGE} installation tests" WORKING_DIRECTORY ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} VERBATIM - COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > cmake.out - COMMAND ${CMAKE_COMMAND} --build ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} > make.out) + COMMAND ${CMAKE_COMMAND} ${EXAMPLES_INSTALL_PATH}/${PACKAGE}/${TESTDIR} > + cmake.out + COMMAND ${CMAKE_COMMAND} --build + ${TEST_INSTALL_ALL_DIR}/${PACKAGE}/${TESTDIR} > make.out) # In the future add "COMMAND ${CMAKE_CTEST_COMMAND}" here to run ctest with # the installed examples. Left out for now as some MPI tests require running # with a specific number of MPI tasks. diff --git a/cmake/macros/SundialsCMakeMacros.cmake b/cmake/macros/SundialsCMakeMacros.cmake index 20d101c834..513ada4288 100644 --- a/cmake/macros/SundialsCMakeMacros.cmake +++ b/cmake/macros/SundialsCMakeMacros.cmake @@ -19,13 +19,15 @@ # show variable (set as cache) and overwrite (force) its value macro(FORCE_VARIABLE var type doc val) - set(${var} "${val}" CACHE "${type}" "${doc}" FORCE) + set(${var} + "${val}" + CACHE "${type}" "${doc}" FORCE) endmacro(FORCE_VARIABLE) # Macros to append a common suffix or prefix to the elements of a list macro(ADD_SUFFIX rootlist suffix) - set(outlist ) + set(outlist) foreach(root ${${rootlist}}) list(APPEND outlist ${root}${suffix}) endforeach(root) @@ -33,20 +35,20 @@ macro(ADD_SUFFIX rootlist suffix) endmacro(ADD_SUFFIX) macro(ADD_PREFIX prefix rootlist) - set(outlist ) + set(outlist) foreach(root ${${rootlist}}) list(APPEND outlist ${prefix}${root}) endforeach(root) set(${rootlist} ${outlist}) endmacro(ADD_PREFIX) -# Returns an unquoted string. Note that CMake will readily turn such -# strings back into lists, due to the duality of lists and -# semicolon-separated strings. So be careful how you use it. +# Returns an unquoted string. Note that CMake will readily turn such strings +# back into lists, due to the duality of lists and semicolon-separated strings. +# So be careful how you use it. macro(LIST2STRING alist astring) foreach(elem ${${alist}}) - set(${astring} "${${astring}} ${elem}") + set(${astring} "${${astring}} ${elem}") endforeach(elem) endmacro(LIST2STRING) @@ -70,13 +72,16 @@ function(sundials_git_version) set(_tmp "") if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/.git AND ${GIT_FOUND}) - execute_process(COMMAND git describe --abbrev=12 --dirty --always --tags - WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} - OUTPUT_VARIABLE _tmp) + execute_process( + COMMAND git describe --abbrev=12 --dirty --always --tags + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + OUTPUT_VARIABLE _tmp) string(STRIP "${_tmp}" _tmp) endif() - set(SUNDIALS_GIT_VERSION "${_tmp}" CACHE INTERNAL "") + set(SUNDIALS_GIT_VERSION + "${_tmp}" + CACHE INTERNAL "") unset(_tmp) endfunction() diff --git a/cmake/macros/SundialsInstallExamples.cmake b/cmake/macros/SundialsInstallExamples.cmake index 7f40b7af6e..471c18e0a5 100644 --- a/cmake/macros/SundialsInstallExamples.cmake +++ b/cmake/macros/SundialsInstallExamples.cmake @@ -14,21 +14,20 @@ # CMake macro for installing examples. # ------------------------------------------------------------------------------ -# The macro: -# -# SUNDIALS_INSTALL_EXAMPLES( -# DESTINATION path -# CMAKE_TEMPLATE name -# [MAKE_TEMPLATE name [SOLVER_LIBRARY target]] -# [SUNDIALS_COMPONENTS components] -# [SUNDIALS_TARGETS targets] -# [DEPENDENCIES files] -# [TEST_INSTALL target] -# [EXTRA_FILES files] -# [EXTRA_INCLUDES includes] -# ) -# -# adds an install target for examples in EXAMPLES_VAR that go with MODULE (e.g. +# ~~~ +# sundials_install_examples( +# DESTINATION path +# CMAKE_TEMPLATE name +# [MAKE_TEMPLATE name [SOLVER_LIBRARY target]] +# [SUNDIALS_COMPONENTS components] +# [SUNDIALS_TARGETS targets] +# [DEPENDENCIES files] +# [TEST_INSTALL target] +# [EXTRA_FILES files] +# [EXTRA_INCLUDES includes]) +# ~~~ +# +# Adds an install target for examples in EXAMPLES_VAR that go with MODULE (e.g. # arkode, nvecserial). # # The DESTINATION option is the path *within* EXAMPLES_INSTALL_PATH that the @@ -68,39 +67,45 @@ # # The EXTRA_INCLUDES option is a list of additional includes to set with # INCLUDE_DIRECTORIES. -# ------------------------------------------------------------------------------ macro(sundials_install_examples MODULE EXAMPLES_VAR) - set(options ) + set(options) set(oneValueArgs SOLVER_LIBRARY DESTINATION CMAKE_TEMPLATE MAKE_TEMPLATE - TEST_INSTALL) + TEST_INSTALL) set(multiValueArgs SUNDIALS_TARGETS SUNDIALS_COMPONENTS OTHER_TARGETS - EXAMPLES_DEPENDENCIES EXTRA_FILES EXTRA_INCLUDES) + EXAMPLES_DEPENDENCIES EXTRA_FILES EXTRA_INCLUDES) # Parse keyword arguments/options - cmake_parse_arguments(sundials_install_examples - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(sundials_install_examples "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # Install the extra files foreach(file ${sundials_install_examples_EXTRA_FILES}) - install(FILES ${file} DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) + install( + FILES ${file} + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) endforeach() # Install the examples foreach(example_tuple ${${EXAMPLES_VAR}}) - list(GET example_tuple 0 example) # filename always has to be the first item in the example tuple + list(GET example_tuple 0 example) # filename always has to be the first item + # in the example tuple get_filename_component(example_noext ${example} NAME_WE) file(GLOB example_header ${example_noext}.h*) file(GLOB example_out ${example_noext}*.out) - install(FILES ${example} ${example_header} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) + install( + FILES ${example} ${example_header} ${example_out} + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates string(TOUPPER "${MODULE}" SOLVER) set(SOLVER_LIB "${sundials_install_examples_SOLVER_LIBRARY}") - set(EXAMPLES_DEPENDENCIES "${sundials_install_examples_EXAMPLES_DEPENDENCIES}") + set(EXAMPLES_DEPENDENCIES + "${sundials_install_examples_EXAMPLES_DEPENDENCIES}") set(EXTRA_INCLUDES "${sundials_install_examples_EXTRA_INCLUDES}") examples2string(${EXAMPLES_VAR} EXAMPLES) @@ -129,43 +134,44 @@ macro(sundials_install_examples MODULE EXAMPLES_VAR) list2string(libs_list EXAMPLES_MAKEFILE_LIBS) # 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. + # 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/${sundials_install_examples_CMAKE_TEMPLATE} ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} - ) + FILES + ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/CMakeLists.txt + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION}) # 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. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX AND (DEFINED sundials_install_examples_MAKE_TEMPLATE)) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/${sundials_install_examples_MAKE_TEMPLATE} ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( - FILES ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex - DESTINATION ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} - RENAME Makefile - ) + FILES + ${PROJECT_BINARY_DIR}/examples/${sundials_install_examples_DESTINATION}/Makefile_ex + DESTINATION + ${EXAMPLES_INSTALL_PATH}/${sundials_install_examples_DESTINATION} + RENAME Makefile) endif() # Add test_install target if(DEFINED sundials_install_examples_TEST_INSTALL) - sundials_add_test_install(${MODULE} ${sundials_install_examples_TEST_INSTALL}) + sundials_add_test_install(${MODULE} + ${sundials_install_examples_TEST_INSTALL}) endif() endmacro() diff --git a/cmake/macros/SundialsInstallExamplesGinkgo.cmake b/cmake/macros/SundialsInstallExamplesGinkgo.cmake index 05427f2051..6d89b13875 100644 --- a/cmake/macros/SundialsInstallExamplesGinkgo.cmake +++ b/cmake/macros/SundialsInstallExamplesGinkgo.cmake @@ -11,20 +11,20 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# The macro: -# -# sundials_install_examples_ginkgo( -# [CPU_EXAMPLES_VAR var] -# [GPU_EXAMPLES_VAR var] -# [CPU_GPU_EXAMPLES_VAR var] -# [DESTINATION path] -# [SUNDIALS_COMPONENTS components] -# [SUNDIALS_TARGETS targets] -# [DEPENDENCIES files] -# [EXTRA_FILES files] -# ) + +# ~~~ +# sundials_install_examples_ginkgo( +# [CPU_EXAMPLES_VAR var] +# [GPU_EXAMPLES_VAR var] +# [CPU_GPU_EXAMPLES_VAR var] +# [DESTINATION path] +# [SUNDIALS_COMPONENTS components] +# [SUNDIALS_TARGETS targets] +# [DEPENDENCIES files] +# [EXTRA_FILES files]) +# ~~~ # -# adds an install target for each example tuple in CPU_EXAMPLES_VAR, +# Adds an install target for each example tuple in CPU_EXAMPLES_VAR, # GPU_EXAMPLES_VAR, and CPU_GPU_EXAMPLES_VAR that go with MODULE (e.g. cvode, # sunlinsol). # @@ -39,23 +39,28 @@ # namespace provided to target_link_libraries. Note this may be the same as or a # subset of SUNDIALS_COMPONENTS depending on the CMakeLists.txt template. # -# The DEPENDENCIES option is a list of additional source files that the -# examples are dependent on. +# The DEPENDENCIES option is a list of additional source files that the examples +# are dependent on. # # The EXTRA_FILES option is a list of files to install that are not example # source code. -# ------------------------------------------------------------------------------ macro(sundials_install_examples_ginkgo MODULE) - set(options ) + set(options) set(oneValueArgs DESTINATION) - set(multiValueArgs CPU_EXAMPLES_VAR GPU_EXAMPLES_VAR CPU_GPU_EXAMPLES_VAR - SUNDIALS_COMPONENTS SUNDIALS_TARGETS EXTRA_FILES DEPENDENCIES) + set(multiValueArgs + CPU_EXAMPLES_VAR + GPU_EXAMPLES_VAR + CPU_GPU_EXAMPLES_VAR + SUNDIALS_COMPONENTS + SUNDIALS_TARGETS + EXTRA_FILES + DEPENDENCIES) # Parse keyword arguments/options - cmake_parse_arguments(arg - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(arg "${options}" "${oneValueArgs}" "${multiValueArgs}" + ${ARGN}) # Install the example source, header, and output file foreach(example_type CPU GPU CPU_GPU) @@ -73,7 +78,7 @@ macro(sundials_install_examples_ginkgo MODULE) # install files install(FILES ${example} ${example_header} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) endforeach() endforeach() @@ -81,7 +86,7 @@ macro(sundials_install_examples_ginkgo MODULE) # Install the extra files and dependencies if(arg_EXTRA_FILES OR arg_DEPENDENCIES) install(FILES ${arg_EXTRA_FILES} ${arg_DEPENDENCIES} - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) endif() # Prepare substitution variables for CMakeLists and/or Makefile templates @@ -115,15 +120,11 @@ macro(sundials_install_examples_ginkgo MODULE) # Generate CMakelists.txt in the binary directory configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/cmakelists_CXX_ginkgo_ex.in - ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt @ONLY) # Install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION} - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/${arg_DESTINATION}/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/${arg_DESTINATION}) # Add test_install target sundials_add_test_install(${MODULE} ginkgo) diff --git a/cmake/macros/SundialsOption.cmake b/cmake/macros/SundialsOption.cmake index e80ed5aac8..0bb5c4d359 100644 --- a/cmake/macros/SundialsOption.cmake +++ b/cmake/macros/SundialsOption.cmake @@ -11,11 +11,12 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------------------- -# Provides the macro: -# -# SUNDIALS_OPTION( -# [DEPENDS_ON dependencies] -# [DEPNDS_ON_THROW_ERROR]) + +# ~~~ +# sundials_option( +# [DEPENDS_ON dependencies] +# [DEPNDS_ON_THROW_ERROR]) +# ~~~ # # Within CMake creates a cache variable and sets it to the value # if is not yet defined and, if provided, all of its @@ -32,7 +33,6 @@ # The OPTIONS option can be used to provide a list of valid values. # # The ADVANCED option can be used to make an advanced CMake option. -# --------------------------------------------------------------------------- macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) @@ -42,7 +42,7 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) # parse inputs and create variables sundials_option_ cmake_parse_arguments(sundials_option "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) + "${multiValueArgs}" ${ARGN}) # check if dependencies for this option have been met set(all_depends_on_dependencies_met TRUE) @@ -58,9 +58,13 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) if(all_depends_on_dependencies_met) if(NOT DEFINED ${NAME}) - set(${NAME} "${DEFAULT_VALUE}" CACHE ${TYPE} ${DOCSTR}) + set(${NAME} + "${DEFAULT_VALUE}" + CACHE ${TYPE} ${DOCSTR}) else() - set(${NAME} "${${NAME}}" CACHE ${TYPE} ${DOCSTR}) + set(${NAME} + "${${NAME}}" + CACHE ${TYPE} ${DOCSTR}) endif() # make the option advanced if necessary @@ -73,10 +77,12 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) # if necessary, remove the CACHE variable i.e., all the variable # dependencies were previously met but are no longer satisfied if(DEFINED ${NAME}) - string(CONCAT _warn_msg_string - "The variable ${NAME} was set to ${${NAME}} but not all of its " - "dependencies (${depends_on_dependencies_not_met}) evaluate to TRUE. " - "Unsetting ${NAME}.") + string( + CONCAT + _warn_msg_string + "The variable ${NAME} was set to ${${NAME}} but not all of its " + "dependencies (${depends_on_dependencies_not_met}) evaluate to TRUE. " + "Unsetting ${NAME}.") unset(${NAME} CACHE) if(sundials_option_DEPENDS_ON_THROW_ERROR) message(FATAL_ERROR "${_warn_msg_string}") @@ -95,7 +101,10 @@ macro(sundials_option NAME TYPE DOCSTR DEFAULT_VALUE) message(FATAL_ERROR "Value of ${NAME} must be one of ${_options_msg}") endif() endforeach() - get_property(is_in_cache CACHE ${NAME} PROPERTY TYPE) + get_property( + is_in_cache + CACHE ${NAME} + PROPERTY TYPE) if(is_in_cache) set_property(CACHE ${NAME} PROPERTY STRINGS ${sundials_option_OPTIONS}) endif() diff --git a/cmake/macros/SundialsTryCompileExecute.cmake b/cmake/macros/SundialsTryCompileExecute.cmake index 81e972b92d..da4f88b535 100644 --- a/cmake/macros/SundialsTryCompileExecute.cmake +++ b/cmake/macros/SundialsTryCompileExecute.cmake @@ -11,44 +11,53 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ----------------------------------------------------------------------------- -# Defines the macro: -# -# sundials_trycompile_execute( -# [COMPILE_OUTPUT variable] -# [RUN_OUTPUT variable]) + +# ~~~ +# sundials_trycompile_execute( +# [COMPILE_OUTPUT variable] +# [RUN_OUTPUT variable]) +# ~~~ # -# This macro attempts to compile and then execute /. -# The variable COMPILE_OK is TRUE if the source code compiles successfully. +# This macro attempts to compile and then execute /. The +# variable COMPILE_OK is TRUE if the source code compiles successfully. # Otherwise COMPILE_OK is FALSE. The variable RUN_OK is TRUE if -# / runs and returns zero. Otherwise it is FALSE. -# The optional COMPILE_OUTPUT variable is set to the generated output during -# compilation. It is useful for debugging compile failures. The option -# RUN_OUTPUT is set to the generated output during runtime. +# / runs and returns zero. Otherwise it is FALSE. The optional +# COMPILE_OUTPUT variable is set to the generated output during compilation. It +# is useful for debugging compile failures. The option RUN_OUTPUT is set to the +# generated output during runtime. # ----------------------------------------------------------------------------- macro(sundials_trycompile_execute EXECUTABLE CWD COMPILE_OK RUN_OK) - set(options ) + set(options) set(oneValueArgs COMPILE_OUTPUT RUN_OUTPUT) - set(multiValueArgs ) + set(multiValueArgs) set(COMPILE_OK FALSE) set(RUN_OK FALSE) - set(COMPILE_OUTPUT ) - set(RUN_OUTPUT ) + set(COMPILE_OUTPUT) + set(RUN_OUTPUT) - cmake_parse_arguments(sundials_trycompile_execute "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) + cmake_parse_arguments(sundials_trycompile_execute "${options}" + "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) # compile the code and then try to run it - try_compile(COMPILE_OK ${CWD} ${CWD} ${EXECUTABLE} OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + COMPILE_OK ${CWD} + ${CWD} ${EXECUTABLE} + OUTPUT_VARIABLE COMPILE_OUTPUT) if(COMPILE_OK) - execute_process(COMMAND "./${EXECUTABLE}" WORKING_DIRECTORY ${CWD} RESULT_VARIABLE RUN_OK OUTPUT_VARIABLE RUN_OUTPUT) + execute_process( + COMMAND "./${EXECUTABLE}" + WORKING_DIRECTORY ${CWD} + RESULT_VARIABLE RUN_OK + OUTPUT_VARIABLE RUN_OUTPUT) if(RUN_OK MATCHES "0") set(RUN_OK TRUE) endif() endif() - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${CWD}/CMakeFiles) # set the optional outputs if used diff --git a/cmake/tpl/FindHYPRE.cmake b/cmake/tpl/FindHYPRE.cmake index 691647544a..156356b24e 100644 --- a/cmake/tpl/FindHYPRE.cmake +++ b/cmake/tpl/FindHYPRE.cmake @@ -32,53 +32,58 @@ # HYPRE_LIBRARIES - all of the libraries needed for HYPRE # --------------------------------------------------------------- -### Find include dir -find_path(temp_HYPRE_INCLUDE_DIR - NAMES HYPRE.h hypre.h - HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/include" "${HYPRE_INCLUDE_DIR}") -if (temp_HYPRE_INCLUDE_DIR) - set(HYPRE_INCLUDE_DIR "${temp_HYPRE_INCLUDE_DIR}" CACHE PATH "" FORCE) +# Find include dir +find_path( + temp_HYPRE_INCLUDE_DIR + NAMES HYPRE.h hypre.h + HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/include" "${HYPRE_INCLUDE_DIR}") +if(temp_HYPRE_INCLUDE_DIR) + set(HYPRE_INCLUDE_DIR + "${temp_HYPRE_INCLUDE_DIR}" + CACHE PATH "" FORCE) endif() unset(temp_HYPRE_INCLUDE_DIR CACHE) -if (HYPRE_LIBRARY) - # We have (or were given) HYPRE_LIBRARY - get path to use for any related libs - get_filename_component(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY} PATH) +if(HYPRE_LIBRARY) + # We have (or were given) HYPRE_LIBRARY - get path to use for any related libs + get_filename_component(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY} PATH) - # force CACHE update to show user DIR that will be used - set(HYPRE_LIBRARY_DIR ${HYPRE_LIBRARY_DIR} CACHE PATH "" FORCE) -else () - # find library with user provided directory path - set(HYPRE_LIBRARY_NAMES hypre HYPRE) - find_library(HYPRE_LIBRARY - NAMES ${HYPRE_LIBRARY_NAMES} - HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/lib" "${HYPRE_DIR}/lib64" "${HYPRE_LIBRARY_DIR}" - NO_DEFAULT_PATH - ) -endif () + # force CACHE update to show user DIR that will be used + set(HYPRE_LIBRARY_DIR + ${HYPRE_LIBRARY_DIR} + CACHE PATH "" FORCE) +else() + # find library with user provided directory path + set(HYPRE_LIBRARY_NAMES hypre HYPRE) + find_library( + HYPRE_LIBRARY + NAMES ${HYPRE_LIBRARY_NAMES} + HINTS "${HYPRE_DIR}" "${HYPRE_DIR}/lib" "${HYPRE_DIR}/lib64" + "${HYPRE_LIBRARY_DIR}" + NO_DEFAULT_PATH) +endif() mark_as_advanced(HYPRE_LIBRARY) list(FIND HYPRE_LIBRARIES ${HYPRE_LIBRARY} _idx) -if (_idx EQUAL -1) - set(HYPRE_LIBRARIES "${HYPRE_LIBRARY};${HYPRE_LIBRARIES}" CACHE STRING "" FORCE) -endif () +if(_idx EQUAL -1) + set(HYPRE_LIBRARIES + "${HYPRE_LIBRARY};${HYPRE_LIBRARIES}" + CACHE STRING "" FORCE) +endif() # set a more informative error message in case the library was not found -set(HYPRE_NOT_FOUND_MESSAGE "\ +set(HYPRE_NOT_FOUND_MESSAGE + "\ ************************************************************************\n\ ERROR: Could not find HYPRE. Please check the variables:\n\ HYPRE_INCLUDE_DIR and HYPRE_LIBRARY_DIR\n\ ************************************************************************") # set package variables including HYPRE_FOUND -find_package_handle_standard_args(HYPRE - REQUIRED_VARS - HYPRE_LIBRARY - HYPRE_LIBRARIES - HYPRE_INCLUDE_DIR - FAIL_MESSAGE - "${HYPRE_NOT_FOUND_MESSAGE}" - ) +find_package_handle_standard_args( + HYPRE + REQUIRED_VARS HYPRE_LIBRARY HYPRE_LIBRARIES HYPRE_INCLUDE_DIR + FAIL_MESSAGE "${HYPRE_NOT_FOUND_MESSAGE}") # Create target for HYPRE if(HYPRE_FOUND) @@ -87,9 +92,10 @@ if(HYPRE_FOUND) add_library(SUNDIALS::HYPRE UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::HYPRE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${HYPRE_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${HYPRE_LIBRARIES}" - IMPORTED_LOCATION "${HYPRE_LIBRARY}") + set_target_properties( + SUNDIALS::HYPRE + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HYPRE_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${HYPRE_LIBRARIES}" + IMPORTED_LOCATION "${HYPRE_LIBRARY}") endif() diff --git a/cmake/tpl/FindKLU.cmake b/cmake/tpl/FindKLU.cmake index a3d817d037..08b77d3773 100644 --- a/cmake/tpl/FindKLU.cmake +++ b/cmake/tpl/FindKLU.cmake @@ -30,9 +30,12 @@ # KLU_LIBRARIES - all of the libraries needed for KLU # --------------------------------------------------------------- -if (NOT (KLU_INCLUDE_DIR OR KLU_LIBRARY_DIR OR KLU_LIBRARY)) - # Prefer the import target from upstream SuiteSparse if it is available - # and the user didn't point to a specific (different) version. +if(NOT + (KLU_INCLUDE_DIR + OR KLU_LIBRARY_DIR + OR KLU_LIBRARY)) + # Prefer the import target from upstream SuiteSparse if it is available and + # the user didn't point to a specific (different) version. find_package(KLU CONFIG) if(TARGET SuiteSparse::KLU) @@ -53,63 +56,69 @@ elseif(APPLE) set(CMAKE_FIND_LIBRARY_SUFFIXES d.a ${CMAKE_FIND_LIBRARY_SUFFIXES}) endif() -### Find include dir +# Find include dir find_path(temp_KLU_INCLUDE_DIR klu.h ${KLU_INCLUDE_DIR}) -if (temp_KLU_INCLUDE_DIR) - set(KLU_INCLUDE_DIR ${temp_KLU_INCLUDE_DIR}) +if(temp_KLU_INCLUDE_DIR) + set(KLU_INCLUDE_DIR ${temp_KLU_INCLUDE_DIR}) endif() unset(temp_KLU_INCLUDE_DIR CACHE) -if (KLU_LIBRARY) - # We have (or were given) KLU_LIBRARY - get path to use for other Suitesparse libs - get_filename_component(KLU_LIBRARY_DIR ${KLU_LIBRARY} PATH) +if(KLU_LIBRARY) + # We have (or were given) KLU_LIBRARY - get path to use for other Suitesparse + # libs + get_filename_component(KLU_LIBRARY_DIR ${KLU_LIBRARY} PATH) + + # force CACHE update to show user DIR that will be used + set(KLU_LIBRARY_DIR + ${KLU_LIBRARY_DIR} + CACHE PATH "" FORCE) + +else() + # find library with user provided directory path + set(KLU_LIBRARY_NAME klu) + find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) +endif() +mark_as_advanced(KLU_LIBRARY) - # force CACHE update to show user DIR that will be used - set(KLU_LIBRARY_DIR ${KLU_LIBRARY_DIR} CACHE PATH "" FORCE) +if(NOT AMD_LIBRARY) + set(AMD_LIBRARY_NAME amd) + find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(AMD_LIBRARY) +endif() -else () - # find library with user provided directory path - set(KLU_LIBRARY_NAME klu) - find_library(KLU_LIBRARY ${KLU_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) -endif () -mark_as_advanced(KLU_LIBRARY) +if(NOT COLAMD_LIBRARY) + set(COLAMD_LIBRARY_NAME colamd) + find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(COLAMD_LIBRARY) +endif() -if (NOT AMD_LIBRARY) - set(AMD_LIBRARY_NAME amd) - find_library(AMD_LIBRARY ${AMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(AMD_LIBRARY) -endif () - -if (NOT COLAMD_LIBRARY) - set(COLAMD_LIBRARY_NAME colamd) - find_library(COLAMD_LIBRARY ${COLAMD_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(COLAMD_LIBRARY) -endif () - -if (NOT BTF_LIBRARY) - set(BTF_LIBRARY_NAME btf) - find_library( BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(BTF_LIBRARY) -endif () - -if (NOT SUITESPARSECONFIG_LIBRARY) - set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) - # NOTE: no prefix for this library on windows - if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) - set(CMAKE_FIND_LIBRARY_PREFIXES "") - endif() - find_library( SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) - mark_as_advanced(SUITESPARSECONFIG_LIBRARY) -endif () +if(NOT BTF_LIBRARY) + set(BTF_LIBRARY_NAME btf) + find_library(BTF_LIBRARY ${BTF_LIBRARY_NAME} ${KLU_LIBRARY_DIR} + NO_DEFAULT_PATH) + mark_as_advanced(BTF_LIBRARY) +endif() + +if(NOT SUITESPARSECONFIG_LIBRARY) + set(SUITESPARSECONFIG_LIBRARY_NAME suitesparseconfig) + # NOTE: no prefix for this library on windows + if(MSVC OR ("${CMAKE_C_SIMULATE_ID}" STREQUAL "MSVC")) + set(CMAKE_FIND_LIBRARY_PREFIXES "") + endif() + find_library(SUITESPARSECONFIG_LIBRARY ${SUITESPARSECONFIG_LIBRARY_NAME} + ${KLU_LIBRARY_DIR} NO_DEFAULT_PATH) + mark_as_advanced(SUITESPARSECONFIG_LIBRARY) +endif() -set(KLU_LIBRARIES ${KLU_LIBRARY} ${AMD_LIBRARY} ${COLAMD_LIBRARY} ${BTF_LIBRARY} ${SUITESPARSECONFIG_LIBRARY}) +set(KLU_LIBRARIES ${KLU_LIBRARY} ${AMD_LIBRARY} ${COLAMD_LIBRARY} + ${BTF_LIBRARY} ${SUITESPARSECONFIG_LIBRARY}) # set package variables including KLU_FOUND -find_package_handle_standard_args(KLU - REQUIRED_VARS - KLU_LIBRARY - KLU_LIBRARIES - KLU_INCLUDE_DIR) +find_package_handle_standard_args(KLU REQUIRED_VARS KLU_LIBRARY KLU_LIBRARIES + KLU_INCLUDE_DIR) # Create target for KLU if(KLU_FOUND) @@ -118,9 +127,10 @@ if(KLU_FOUND) add_library(SUNDIALS::KLU UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::KLU PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${KLU_LIBRARIES}" - IMPORTED_LOCATION "${KLU_LIBRARY}") + set_target_properties( + SUNDIALS::KLU + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${KLU_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${KLU_LIBRARIES}" + IMPORTED_LOCATION "${KLU_LIBRARY}") endif() diff --git a/cmake/tpl/FindMAGMA.cmake b/cmake/tpl/FindMAGMA.cmake index 28b8fa8c7d..0d71560b72 100644 --- a/cmake/tpl/FindMAGMA.cmake +++ b/cmake/tpl/FindMAGMA.cmake @@ -15,16 +15,17 @@ # ----------------------------------------------------------------------------- # find the MAGMA include path -find_path(MAGMA_INCLUDE_DIR magma_v2.h +find_path( + MAGMA_INCLUDE_DIR magma_v2.h NAMES magma_v2.h HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES include NO_DEFAULT_PATH - DOC "Directory with MAGMA header" -) + DOC "Directory with MAGMA header") # find the main MAGMA library -find_library(MAGMA_LIBRARY +find_library( + MAGMA_LIBRARY NAMES magma HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES lib lib64 @@ -34,14 +35,15 @@ find_library(MAGMA_LIBRARY # Find the optional sparse component if("SPARSE" IN_LIST MAGMA_FIND_COMPONENTS) set(_sparse_required MAGMA_SPARSE_LIBRARY) - find_library(MAGMA_SPARSE_LIBRARY + find_library( + MAGMA_SPARSE_LIBRARY NAMES magma_sparse HINTS ${MAGMA_DIR} $ENV{MAGMA_DIR} PATH_SUFFIXES lib lib64 NO_DEFAULT_PATH DOC "The MAGMA sparse library.") else() - set(_sparse_required ) + set(_sparse_required) endif() # Determine MAGMA version and libraries it depends on @@ -52,7 +54,8 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) if(MAGMA_PKG_CONFIG_PATH) - file(STRINGS ${MAGMA_PKG_CONFIG_PATH} _version_string REGEX "Version: [0-9].[0-9].[0-9]") + file(STRINGS ${MAGMA_PKG_CONFIG_PATH} _version_string + REGEX "Version: [0-9].[0-9].[0-9]") string(REGEX MATCHALL "[0-9]" _version_full "${_version_string}") list(GET _version_full 0 _version_major) @@ -65,7 +68,7 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) string(REPLACE " " ";" _libraries_list ${_libraries_string}) list(SUBLIST _libraries_list 1 -1 _libraries_list) # remove 'Libs:' part - set(_interface_libraires ) + set(_interface_libraires) if(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") if(NOT TARGET roc::hipblas) @@ -79,20 +82,24 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) endif() if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - if (NOT TARGET CUDA::cudart) + if(NOT TARGET CUDA::cudart) find_package(CUDAToolkit REQUIRED) endif() endif() foreach(lib ${_libraries_list}) - if(NOT (lib STREQUAL "-lmagma" OR lib STREQUAL "-lmagma_sparse" - OR lib STREQUAL "-L\${libdir}" OR lib STREQUAL "") ) + if(NOT + (lib STREQUAL "-lmagma" + OR lib STREQUAL "-lmagma_sparse" + OR lib STREQUAL "-L\${libdir}" + OR lib STREQUAL "")) # Check if we need to find cusparse or cublas if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - # Replace cublas, cusparse with the CMake targets because the library path in - # the magma pkgconfig is not reliable. Sepcifically, the path is wrong on systems - # like Perlmutter where the NVIDIA HPC SDK is used. + # Replace cublas, cusparse with the CMake targets because the library + # path in the magma pkgconfig is not reliable. Sepcifically, the path + # is wrong on systems like Perlmutter where the NVIDIA HPC SDK is + # used. if(lib STREQUAL "-lcublas") set(lib CUDA::cublas) endif() @@ -110,15 +117,11 @@ endif() set(MAGMA_LIBRARIES "${MAGMA_LIBRARY};${_interface_libraires}") -find_package_handle_standard_args(MAGMA - REQUIRED_VARS - MAGMA_LIBRARY - MAGMA_LIBRARIES - MAGMA_INCLUDE_DIR - ${_sparse_required} - VERSION_VAR - MAGMA_VERSION - ) +find_package_handle_standard_args( + MAGMA + REQUIRED_VARS MAGMA_LIBRARY MAGMA_LIBRARIES MAGMA_INCLUDE_DIR + ${_sparse_required} + VERSION_VAR MAGMA_VERSION) # Create target for MAGMA if(MAGMA_FOUND) @@ -127,20 +130,23 @@ if(MAGMA_FOUND) add_library(SUNDIALS::MAGMA UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::MAGMA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${_interface_libraires}" - IMPORTED_LOCATION "${MAGMA_LIBRARY}") + set_target_properties( + SUNDIALS::MAGMA + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${_interface_libraires}" + IMPORTED_LOCATION "${MAGMA_LIBRARY}") if(MAGMA_SPARSE_LIBRARY) if(NOT TARGET SUNDIALS::MAGMA_SPARSE) add_library(SUNDIALS::MAGMA_SPARSE UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::MAGMA_SPARSE PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${MAGMA_LIBRARY};${_interface_libraires}" - IMPORTED_LOCATION "${MAGMA_SPARSE_LIBRARY}") + set_target_properties( + SUNDIALS::MAGMA_SPARSE + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${MAGMA_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES + "${MAGMA_LIBRARY};${_interface_libraires}" + IMPORTED_LOCATION "${MAGMA_SPARSE_LIBRARY}") endif() endif() diff --git a/cmake/tpl/FindPETSC.cmake b/cmake/tpl/FindPETSC.cmake index 80a01f69ad..d85e199f9b 100644 --- a/cmake/tpl/FindPETSC.cmake +++ b/cmake/tpl/FindPETSC.cmake @@ -38,9 +38,12 @@ pkg_check_modules(PKG_PETSC "PETSc${_pkg_version_spec}") unset(_pkg_version_spec) # Find the PETSC libraries -set(_petsc_libs ) +set(_petsc_libs) foreach(_next_lib IN LISTS PKG_PETSC_LIBRARIES) - find_library(_petsc_lib_${_next_lib} NAMES ${_next_lib} HINTS ${PKG_PETSC_LIBRARY_DIRS}) + find_library( + _petsc_lib_${_next_lib} + NAMES ${_next_lib} + HINTS ${PKG_PETSC_LIBRARY_DIRS}) if(_petsc_lib_${_next_lib}) list(APPEND _petsc_libs "${_petsc_lib_${_next_lib}}") endif() @@ -56,17 +59,15 @@ foreach(_next_lib IN LISTS PKG_PETSC_STATIC_LIBRARIES) endif() if(_next_lib MATCHES "kokkoskernels") if(NOT TARGET Kokkos::kokkoskernels) - find_package(KokkosKernels REQUIRED - HINTS "${KokkosKernels_DIR}" "${PKG_PETSC_LIBRARY_DIRS}" - NO_DEFAULT_PATH) + find_package(KokkosKernels REQUIRED HINTS "${KokkosKernels_DIR}" + "${PKG_PETSC_LIBRARY_DIRS}" NO_DEFAULT_PATH) endif() list(APPEND _petsc_libs "Kokkos::kokkoskernels") endif() if(_next_lib MATCHES "kokkos") if(NOT TARGET Kokkos::kokkos) - find_package(Kokkos REQUIRED - HINTS "${Kokkos_DIR}" "${PKG_PETSC_LIBRARY_DIRS}" - NO_DEFAULT_PATH) + find_package(Kokkos REQUIRED HINTS "${Kokkos_DIR}" + "${PKG_PETSC_LIBRARY_DIRS}" NO_DEFAULT_PATH) endif() list(APPEND _petsc_libs "Kokkos::kokkos") endif() @@ -87,10 +88,18 @@ if(PKG_PETSC_VERSION) list(GET _petsc_versions 1 _petsc_version_minor) list(GET _petsc_versions 2 _petsc_version_patch) - set(PETSC_VERSION ${PKG_PETSC_VERSION} CACHE STRING "Full version of PETSC") - set(PETSC_VERSION_MAJOR ${_petsc_version_major} CACHE INTERNAL "Major version of PETSC") - set(PETSC_VERSION_MINOR ${_petsc_version_minor} CACHE INTERNAL "Minor version of PETSC") - set(PETSC_VERSION_PATCH ${_petsc_version_patch} CACHE INTERNAL "Patch version of PETSC") + set(PETSC_VERSION + ${PKG_PETSC_VERSION} + CACHE STRING "Full version of PETSC") + set(PETSC_VERSION_MAJOR + ${_petsc_version_major} + CACHE INTERNAL "Major version of PETSC") + set(PETSC_VERSION_MINOR + ${_petsc_version_minor} + CACHE INTERNAL "Minor version of PETSC") + set(PETSC_VERSION_PATCH + ${_petsc_version_patch} + CACHE INTERNAL "Patch version of PETSC") unset(_petsc_versions) unset(_petsc_version_major) @@ -98,18 +107,19 @@ if(PKG_PETSC_VERSION) unset(_petsc_version_patch) endif() -include (FindPackageHandleStandardArgs) -find_package_handle_standard_args (PETSC +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args( + PETSC REQUIRED_VARS PETSC_FOUND PETSC_INCLUDE_DIRS PETSC_LIBRARIES - VERSION_VAR PETSC_VERSION - ) + VERSION_VAR PETSC_VERSION) if(NOT TARGET SUNDIALS::PETSC) add_library(SUNDIALS::PETSC INTERFACE IMPORTED) - set_target_properties(SUNDIALS::PETSC PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${PETSC_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${PETSC_LIBRARIES}" - ) + set_target_properties( + SUNDIALS::PETSC + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${PETSC_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${PETSC_LIBRARIES}") endif() -mark_as_advanced(PETSC_INCLUDE_DIRS PETSC_LIBRARIES PETSC_VERSION_MAJOR PETSC_VERSION_MINOR PETSC_VERSION_PATCH PETSC_VERSION) +mark_as_advanced(PETSC_INCLUDE_DIRS PETSC_LIBRARIES PETSC_VERSION_MAJOR + PETSC_VERSION_MINOR PETSC_VERSION_PATCH PETSC_VERSION) diff --git a/cmake/tpl/FindSUPERLUDIST.cmake b/cmake/tpl/FindSUPERLUDIST.cmake index 016f1c8ecf..1dcaf00c20 100644 --- a/cmake/tpl/FindSUPERLUDIST.cmake +++ b/cmake/tpl/FindSUPERLUDIST.cmake @@ -35,7 +35,9 @@ # --------------------------------------------------------------- if(NOT SUPERLUDIST_LINK_LIBRARIES AND SUPERLUDIST_LIBRARIES) - set(SUPERLUDIST_LINK_LIBRARIES "${SUPERLUDIST_LIBRARIES}" CACHE INTERNAL "") + set(SUPERLUDIST_LINK_LIBRARIES + "${SUPERLUDIST_LIBRARIES}" + CACHE INTERNAL "") elseif(NOT SUPERLUDIST_LINK_LIBRARIES) find_package(PkgConfig REQUIRED) list(APPEND CMAKE_PREFIX_PATH "${SUPERLUDIST_DIR}") @@ -47,39 +49,61 @@ elseif(NOT SUPERLUDIST_LINK_LIBRARIES) endif() endif() pkg_search_module(SUPERLUDIST REQUIRED "superlu_dist${_pkg_version_spec}") - set(SUPERLUDIST_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}" CACHE INTERNAL "") - set(SUPERLUDIST_INCLUDE_DIRS "${SUPERLUDIST_INCLUDE_DIRS}" CACHE INTERNAL "") + set(SUPERLUDIST_LINK_LIBRARIES + "${SUPERLUDIST_LINK_LIBRARIES}" + CACHE INTERNAL "") + set(SUPERLUDIST_INCLUDE_DIRS + "${SUPERLUDIST_INCLUDE_DIRS}" + CACHE INTERNAL "") endif() # find the library configuration file -set(SUPERLUDIST_CUDA FALSE CACHE BOOL "SuperLU DIST was built with CUDA support") -set(SUPERLUDIST_ROCM FALSE CACHE BOOL "SuperLU DIST was built with ROCm support") +set(SUPERLUDIST_CUDA + FALSE + CACHE BOOL "SuperLU DIST was built with CUDA support") +set(SUPERLUDIST_ROCM + FALSE + CACHE BOOL "SuperLU DIST was built with ROCm support") if(SUPERLUDIST_INCLUDE_DIRS) - find_file(SUPERLUDIST_CONFIG_PATH superlu_dist_config.h PATHS "${SUPERLUDIST_INCLUDE_DIRS}") + find_file(SUPERLUDIST_CONFIG_PATH superlu_dist_config.h + PATHS "${SUPERLUDIST_INCLUDE_DIRS}") mark_as_advanced(FORCE SUPERLUDIST_CONFIG_PATH) if(SUPERLUDIST_VERSION VERSION_GREATER_EQUAL "8.0.0") - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_64 REGEX "#define XSDK_INDEX_SIZE 64") - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_32 REGEX "#undef XSDK_INDEX_SIZE") - if(_index_size_64) - set(SUPERLUDIST_INDEX_SIZE 64 CACHE STRING "SuperLU DIST index size (bit width)" FORCE) - else() - set(SUPERLUDIST_INDEX_SIZE 32 CACHE STRING "SuperLU DIST index size (bit width)" FORCE) - endif() - mark_as_advanced(FORCE SUPERLUDIST_INDEX_SIZE) + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_64 + REGEX "#define XSDK_INDEX_SIZE 64") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _index_size_32 + REGEX "#undef XSDK_INDEX_SIZE") + if(_index_size_64) + set(SUPERLUDIST_INDEX_SIZE + 64 + CACHE STRING "SuperLU DIST index size (bit width)" FORCE) + else() + set(SUPERLUDIST_INDEX_SIZE + 32 + CACHE STRING "SuperLU DIST index size (bit width)" FORCE) + endif() + mark_as_advanced(FORCE SUPERLUDIST_INDEX_SIZE) else() - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_with_index_size REGEX "XSDK_INDEX_SIZE") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_with_index_size + REGEX "XSDK_INDEX_SIZE") list(GET _strings_with_index_size 0 _index_size_string) - string(REGEX MATCHALL "[0-9][0-9]" SUPERLUDIST_INDEX_SIZE "${_index_size_string}") + string(REGEX MATCHALL "[0-9][0-9]" SUPERLUDIST_INDEX_SIZE + "${_index_size_string}") endif() - file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_cuda REGEX "HAVE_CUDA") + file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_cuda + REGEX "HAVE_CUDA") string(REGEX MATCH "TRUE|FALSE" _has_cuda "${_strings_have_cuda}") file(STRINGS "${SUPERLUDIST_CONFIG_PATH}" _strings_have_rocm REGEX "HAVE_HIP") string(REGEX MATCH "TRUE|FALSE" _has_rocm "${_strings_have_rocm}") if(_has_cuda) - set(SUPERLUDIST_CUDA TRUE CACHE BOOL "SuperLU DIST was built with CUDA support" FORCE) + set(SUPERLUDIST_CUDA + TRUE + CACHE BOOL "SuperLU DIST was built with CUDA support" FORCE) endif() if(_has_rocm) - set(SUPERLUDIST_ROCM TRUE CACHE BOOL "SuperLU DIST was built with ROCm support" FORCE) + set(SUPERLUDIST_ROCM + TRUE + CACHE BOOL "SuperLU DIST was built with ROCm support" FORCE) endif() unset(_has_cuda) unset(_has_rocm) @@ -87,21 +111,26 @@ endif() # find the library version file if(NOT SUPERLUDIST_VERSION AND SUPERLUDIST_INCLUDE_DIRS) - find_file(SUPERLUDIST_VERSION_PATH superlu_defs.h PATHS "${SUPERLUDIST_INCLUDE_DIRS}") + find_file(SUPERLUDIST_VERSION_PATH superlu_defs.h + PATHS "${SUPERLUDIST_INCLUDE_DIRS}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_major REGEX "SUPERLU_DIST_MAJOR_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_major + REGEX "SUPERLU_DIST_MAJOR_VERSION") list(GET _version_major 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_major "${_version_string}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_minor REGEX "SUPERLU_DIST_MINOR_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_minor + REGEX "SUPERLU_DIST_MINOR_VERSION") list(GET _version_minor 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_minor "${_version_string}") - file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_patch REGEX "SUPERLU_DIST_PATCH_VERSION") + file(STRINGS "${SUPERLUDIST_VERSION_PATH}" _version_patch + REGEX "SUPERLU_DIST_PATCH_VERSION") list(GET _version_patch 0 _version_string) string(REGEX MATCHALL "[0-9]" _version_patch "${_version_string}") - set(SUPERLUDIST_VERSION "${_version_major}.${_version_minor}.${_version_patch}") + set(SUPERLUDIST_VERSION + "${_version_major}.${_version_minor}.${_version_patch}") mark_as_advanced(FORCE SUPERLUDIST_VERSION_PATH) endif() @@ -117,18 +146,16 @@ if(SUPERLUDIST_ROCM) find_package(hipblas REQUIRED) find_package(rocsolver REQUIRED) find_package(rocblas REQUIRED) - list(APPEND SUPERLUDIST_LINK_LIBRARIES hip::device roc::hipblas roc::rocblas roc::rocsolver) + list(APPEND SUPERLUDIST_LINK_LIBRARIES hip::device roc::hipblas roc::rocblas + roc::rocsolver) endif() # set package variables including SUPERLUDIST_FOUND -find_package_handle_standard_args(SUPERLUDIST - REQUIRED_VARS - SUPERLUDIST_LINK_LIBRARIES - SUPERLUDIST_INCLUDE_DIRS - SUPERLUDIST_INDEX_SIZE - VERSION_VAR - SUPERLUDIST_VERSION - ) +find_package_handle_standard_args( + SUPERLUDIST + REQUIRED_VARS SUPERLUDIST_LINK_LIBRARIES SUPERLUDIST_INCLUDE_DIRS + SUPERLUDIST_INDEX_SIZE + VERSION_VAR SUPERLUDIST_VERSION) # Create target for SuperLU_DIST if(SUPERLUDIST_FOUND) @@ -137,8 +164,9 @@ if(SUPERLUDIST_FOUND) add_library(SUNDIALS::SUPERLUDIST INTERFACE IMPORTED) endif() - set_target_properties(SUNDIALS::SUPERLUDIST PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUDIST_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}") + set_target_properties( + SUNDIALS::SUPERLUDIST + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUDIST_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${SUPERLUDIST_LINK_LIBRARIES}") endif() diff --git a/cmake/tpl/FindSUPERLUMT.cmake b/cmake/tpl/FindSUPERLUMT.cmake index 4e1acb30b0..b9fb949549 100644 --- a/cmake/tpl/FindSUPERLUMT.cmake +++ b/cmake/tpl/FindSUPERLUMT.cmake @@ -33,13 +33,15 @@ # check for valid thread type string(TOUPPER ${SUPERLUMT_THREAD_TYPE} _upper_SUPERLUMT_THREAD_TYPE) -force_variable(SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" ${_upper_SUPERLUMT_THREAD_TYPE}) +force_variable( + SUPERLUMT_THREAD_TYPE STRING "SuperLU_MT threading type: OPENMP or PTHREAD" + ${_upper_SUPERLUMT_THREAD_TYPE}) -if(SUPERLUMT_THREAD_TYPE AND - NOT SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP" AND - NOT SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") +if(SUPERLUMT_THREAD_TYPE + AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP" + AND NOT SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") message(FATAL_ERROR "Unknown thread type: ${SUPERLUMT_THREAD_TYPE} " - "Please enter PTHREAD or OPENMP") + "Please enter PTHREAD or OPENMP") endif() # check if the threading library has been found @@ -69,9 +71,8 @@ if(MSVC) set(CMAKE_FIND_LIBRARY_PREFIXES lib ${CMAKE_FIND_LIBRARY_PREFIXES}) endif() -# Check if SUPERLUMT_LIBRARIES contains the superlu_mt -# library as well as TPLs. If so, extract it into the -# SUPERLUMT_LIBRARY variable. +# Check if SUPERLUMT_LIBRARIES contains the superlu_mt library as well as TPLs. +# If so, extract it into the SUPERLUMT_LIBRARY variable. if(SUPERLUMT_LIBRARIES MATCHES "${SUPERLUMT_LIBRARY_NAME}") foreach(lib ${SUPERLUMT_LIBRARIES}) if(lib MATCHES "${SUPERLUMT_LIBRARY_NAME}") @@ -83,8 +84,10 @@ endif() # find library if(NOT SUPERLUMT_LIBRARY) # search user provided directory path - find_library(SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME} - PATHS ${SUPERLUMT_LIBRARY_DIR} NO_DEFAULT_PATH) + find_library( + SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME} + PATHS ${SUPERLUMT_LIBRARY_DIR} + NO_DEFAULT_PATH) # if user didn't provide a path, search anywhere if(NOT (SUPERLUMT_LIBRARY_DIR OR SUPERLUMT_LIBRARY)) find_library(SUPERLUMT_LIBRARY ${SUPERLUMT_LIBRARY_NAME}) @@ -94,38 +97,42 @@ endif() # set the libraries, stripping out 'NOTFOUND' from previous attempts if(NOT (SUPERLUMT_LIBRARIES MATCHES "${SUPERLUMT_LIBRARY_NAME}")) - set(SUPERLUMT_LIBRARIES "${SUPERLUMT_LIBRARY};${SUPERLUMT_LIBRARIES}" CACHE STRING "" FORCE) + set(SUPERLUMT_LIBRARIES + "${SUPERLUMT_LIBRARY};${SUPERLUMT_LIBRARIES}" + CACHE STRING "" FORCE) endif() # set the library dir option if it wasn't preset if(SUPERLUMT_LIBRARY AND (NOT SUPERLUMT_LIBRARY_DIR)) get_filename_component(SUPERLUMT_LIBRARY_DIR ${SUPERLUMT_LIBRARY} DIRECTORY) - set(SUPERLUMT_LIBRARY_DIR ${SUPERLUMT_LIBRARY_DIR} CACHE PATH "" FORCE) + set(SUPERLUMT_LIBRARY_DIR + ${SUPERLUMT_LIBRARY_DIR} + CACHE PATH "" FORCE) endif() # set the include dir option if it wasn't preset if(SUPERLUMT_LIBRARY AND (NOT SUPERLUMT_INCLUDE_DIR)) - get_filename_component(SUPERLUMT_INCLUDE_DIR ${SUPERLUMT_LIBRARY_DIR} DIRECTORY) - set(SUPERLUMT_INCLUDE_DIR "${SUPERLUMT_INCLUDE_DIR}/include" CACHE PATH "" FORCE) + get_filename_component(SUPERLUMT_INCLUDE_DIR ${SUPERLUMT_LIBRARY_DIR} + DIRECTORY) + set(SUPERLUMT_INCLUDE_DIR + "${SUPERLUMT_INCLUDE_DIR}/include" + CACHE PATH "" FORCE) endif() # set a more informative error message in case the library was not found -set(SUPERLUMT_NOT_FOUND_MESSAGE "\ +set(SUPERLUMT_NOT_FOUND_MESSAGE + "\ ************************************************************************\n\ ERROR: Could not find SuperLU_MT. Please check the variables:\n\ SUPERLUMT_INCLUDE_DIR and SUPERLUMT_LIBRARY_DIR\n\ ************************************************************************") # set package variables including SUPERLUMT_FOUND -find_package_handle_standard_args(SUPERLUMT - REQUIRED_VARS - SUPERLUMT_LIBRARY - SUPERLUMT_LIBRARIES - SUPERLUMT_INCLUDE_DIR - SUPERLUMT_THREAD_TYPE - FAIL_MESSAGE - "${SUPERLUMT_NOT_FOUND_MESSAGE}" - ) +find_package_handle_standard_args( + SUPERLUMT + REQUIRED_VARS SUPERLUMT_LIBRARY SUPERLUMT_LIBRARIES SUPERLUMT_INCLUDE_DIR + SUPERLUMT_THREAD_TYPE + FAIL_MESSAGE "${SUPERLUMT_NOT_FOUND_MESSAGE}") # Create target for SuperLU_MT if(SUPERLUMT_FOUND) @@ -134,10 +141,11 @@ if(SUPERLUMT_FOUND) add_library(SUNDIALS::SUPERLUMT UNKNOWN IMPORTED) endif() - set_target_properties(SUNDIALS::SUPERLUMT PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUMT_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${SUPERLUMT_LIBRARIES}" - IMPORTED_LOCATION "${SUPERLUMT_LIBRARY}") + set_target_properties( + SUNDIALS::SUPERLUMT + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${SUPERLUMT_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${SUPERLUMT_LIBRARIES}" + IMPORTED_LOCATION "${SUPERLUMT_LIBRARY}") list2string(SUPERLUMT_LIBRARIES EXAMPLES_SUPERLUMT_LIBRARIES) diff --git a/cmake/tpl/FindTrilinos.cmake b/cmake/tpl/FindTrilinos.cmake index af4dff69b3..42be691041 100644 --- a/cmake/tpl/FindTrilinos.cmake +++ b/cmake/tpl/FindTrilinos.cmake @@ -16,20 +16,23 @@ # ----------------------------------------------------------------------------- # First try and find Trilinos using Trilinos_DIR only. -find_package(Trilinos - NAMES Trilinos TRILINOS +find_package( + Trilinos + NAMES + Trilinos + TRILINOS PATHS - ${Trilinos_DIR}/lib/cmake/Trilinos - ${Trilinos_DIR} + ${Trilinos_DIR}/lib/cmake/Trilinos + ${Trilinos_DIR} NO_DEFAULT_PATH QUIET) # set package variables including Trilinos_FOUND -find_package_handle_standard_args(Trilinos - REQUIRED_VARS - Trilinos_LIBRARIES # defined in TrilinosConfig.cmake - Trilinos_INCLUDE_DIRS # defined in TrilinosConfig.cmake - ) +find_package_handle_standard_args( + Trilinos + REQUIRED_VARS Trilinos_LIBRARIES # defined in TrilinosConfig.cmake + Trilinos_INCLUDE_DIRS # defined in TrilinosConfig.cmake +) # Create Trilinos target if(Trilinos_FOUND) @@ -38,8 +41,9 @@ if(Trilinos_FOUND) add_library(SUNDIALS::TRILINOS IMPORTED INTERFACE) endif() - set_target_properties(SUNDIALS::TRILINOS PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${Trilinos_INCLUDE_DIRS}" - INTERFACE_LINK_LIBRARIES "${Trilinos_LIBRARIES}") + set_target_properties( + SUNDIALS::TRILINOS + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${Trilinos_INCLUDE_DIRS}" + INTERFACE_LINK_LIBRARIES "${Trilinos_LIBRARIES}") endif() diff --git a/cmake/tpl/FindXBRAID.cmake b/cmake/tpl/FindXBRAID.cmake index 8b60d4eec6..d46299a337 100644 --- a/cmake/tpl/FindXBRAID.cmake +++ b/cmake/tpl/FindXBRAID.cmake @@ -29,28 +29,36 @@ # Check if we are locating XBraid using the root install directory or a list of # include directories and link libraries -if (XBRAID_INCLUDES OR XBRAID_LIBRARIES) +if(XBRAID_INCLUDES OR XBRAID_LIBRARIES) - if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) + if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) - set(XBRAID_DIR "" CACHE PATH "Path to the root of XBraid installation" FORCE) + set(XBRAID_DIR + "" + CACHE PATH "Path to the root of XBraid installation" FORCE) - else () + else() - string(CONCAT msg - "Both XBRAID_INCLUDES and XBRAID_LIBRARIES must be provided:\n" - " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n" - " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") + string( + CONCAT msg + "Both XBRAID_INCLUDES and XBRAID_LIBRARIES must be provided:\n" + " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n" + " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") message(FATAL_ERROR ${msg}) - endif () + endif() -else () +else() - set(XBRAID_INCLUDES "" CACHE STRING "Semi-colon separated list of XBraid include directories" FORCE) - set(XBRAID_LIBRARIES "" CACHE STRING "Semi-colon separated list of XBraid link libraries" FORCE) + set(XBRAID_INCLUDES + "" + CACHE STRING "Semi-colon separated list of XBraid include directories" + FORCE) + set(XBRAID_LIBRARIES + "" + CACHE STRING "Semi-colon separated list of XBraid link libraries" FORCE) -endif () +endif() # unset cache values for multiple passes unset(XBRAID_INCLUDE_DIR CACHE) @@ -59,138 +67,140 @@ unset(XBRAID_LIBRARY CACHE) unset(XBRAID_INCS CACHE) unset(XBRAID_LIBS CACHE) -if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) +if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) message(STATUS "Finding XBraid using XBRAID_INCLUDES and XBRAID_LIBRARIES") # extract path from XBRAID_INCLUDES - foreach (include_dir ${XBRAID_INCLUDES}) - if (EXISTS "${include_dir}/braid.h") - set(XBRAID_INCLUDE_DIR "${include_dir}" CACHE "XBraid include directory") + foreach(include_dir ${XBRAID_INCLUDES}) + if(EXISTS "${include_dir}/braid.h") + set(XBRAID_INCLUDE_DIR + "${include_dir}" + CACHE "XBraid include directory") break() - endif () - endforeach () + endif() + endforeach() # check if the include directory was found - if (NOT XBRAID_INCLUDE_DIR) - string(CONCAT msg - "Could not determine XBraid include directory from XBRAID_INCLUDES:\n" - " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n") + if(NOT XBRAID_INCLUDE_DIR) + string( + CONCAT + msg + "Could not determine XBraid include directory from XBRAID_INCLUDES:\n" + " XBRAID_INCLUDES=${XBRAID_INCLUDES}\n") message(FATAL_ERROR ${msg}) - endif () + endif() # extract library from XBRAID_LIBRARIES - foreach (library_path ${XBRAID_LIBRARIES}) + foreach(library_path ${XBRAID_LIBRARIES}) get_filename_component(library_name "${library_path}" NAME) - if (library_name MATCHES "braid") - set(XBRAID_LIBRARY "${library_path}" CACHE "XBraid library") + if(library_name MATCHES "braid") + set(XBRAID_LIBRARY + "${library_path}" + CACHE "XBraid library") break() - endif () - endforeach () + endif() + endforeach() # check if the library directory was found - if (NOT XBRAID_LIBRARY) + if(NOT XBRAID_LIBRARY) string(CONCAT msg - "Could not determine XBraid library from XBRAID_LIBRARIES:\n" - " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") + "Could not determine XBraid library from XBRAID_LIBRARIES:\n" + " XBRAID_LIBRARIES=${XBRAID_LIBRARIES}") message(FATAL_ERROR ${msg}) - endif () + endif() -else () +else() message(STATUS "Finding XBraid using XBRAID_DIR") # find XBRAID_DIR - if (NOT XBRAID_DIR) + if(NOT XBRAID_DIR) message(STATUS "Looking for XBraid in common install locations") find_path(XBRAID_DIR include/braid.h braid/braid.h) - endif () + endif() # check if XBRAID_DIR was set/found - if (NOT XBRAID_DIR) + if(NOT XBRAID_DIR) - string(CONCAT msg - "Could not locate XBraid install directory please set:\n" - " - XBRAID_DIR\n" - "or used the advanced options\n" - " - XBRAID_INCLUDES and XBRAID_LIBRARIES.") + string(CONCAT msg "Could not locate XBraid install directory please set:\n" + " - XBRAID_DIR\n" "or used the advanced options\n" + " - XBRAID_INCLUDES and XBRAID_LIBRARIES.") message(FATAL_ERROR ${msg}) - endif () + endif() # Find the include dir - find_path(XBRAID_INCLUDE_DIR braid.h - PATHS - ${XBRAID_DIR} - PATH_SUFFIXES - include braid - DOC - "XBraid include directory" + find_path( + XBRAID_INCLUDE_DIR braid.h + PATHS ${XBRAID_DIR} + PATH_SUFFIXES include braid + DOC "XBraid include directory" NO_DEFAULT_PATH) # check if the include directory was found - if (NOT XBRAID_INCLUDE_DIR) - string(CONCAT msg - "Could not determine XBraid include directory from XBRAID_DIR:\n" - " XBRAID_DIR=${XBRAID_DIR}\n") + if(NOT XBRAID_INCLUDE_DIR) + string( + CONCAT msg + "Could not determine XBraid include directory from XBRAID_DIR:\n" + " XBRAID_DIR=${XBRAID_DIR}\n") message(FATAL_ERROR ${msg}) - endif () + endif() # Find the library - find_library(XBRAID_LIBRARY braid - PATHS - ${XBRAID_DIR} - PATH_SUFFIXES - lib braid - DOC - "XBraid library" + find_library( + XBRAID_LIBRARY braid + PATHS ${XBRAID_DIR} + PATH_SUFFIXES lib braid + DOC "XBraid library" NO_DEFAULT_PATH) # check if the library was found - if (NOT XBRAID_LIBRARY) - string(CONCAT msg - "Could not determine XBraid library from XBRAID_DIR:\n" - " XBRAID_DIR=${XBRAID_DIR}\n") + if(NOT XBRAID_LIBRARY) + string(CONCAT msg "Could not determine XBraid library from XBRAID_DIR:\n" + " XBRAID_DIR=${XBRAID_DIR}\n") message(FATAL_ERROR ${msg}) - endif () + endif() -endif () +endif() # set package variables including XBRAID_FOUND -find_package_handle_standard_args(XBRAID - REQUIRED_VARS - XBRAID_INCLUDE_DIR - XBRAID_LIBRARY - ) +find_package_handle_standard_args(XBRAID REQUIRED_VARS XBRAID_INCLUDE_DIR + XBRAID_LIBRARY) # XBraid target -if (XBRAID_FOUND) +if(XBRAID_FOUND) # create target if necessary - if (NOT TARGET SUNDIALS::XBRAID) + if(NOT TARGET SUNDIALS::XBRAID) add_library(SUNDIALS::XBRAID UNKNOWN IMPORTED) - endif () + endif() # update target properties (for multiple passes) - set_target_properties(SUNDIALS::XBRAID PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${XBRAID_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${XBRAID_LIBRARIES}" - IMPORTED_LOCATION "${XBRAID_LIBRARY}") - - # set variables for output message, compile tests, and - # CMake/Makefile templates - if (XBRAID_INCLUDES AND XBRAID_LIBRARIES) - set(XBRAID_INCS "${XBRAID_INCLUDES}" CACHE INTERNAL - "Internal XBraid includes") - set(XBRAID_LIBS "${XBRAID_LIBRARIES}" CACHE INTERNAL - "Internal XBraid libraries") - else () - set(XBRAID_INCS "${XBRAID_INCLUDE_DIR}" CACHE INTERNAL - "Internal XBraid includes") - set(XBRAID_LIBS "${XBRAID_LIBRARY}" CACHE INTERNAL - "Internal XBraid libraries") - endif () - -endif () + set_target_properties( + SUNDIALS::XBRAID + PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${XBRAID_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${XBRAID_LIBRARIES}" + IMPORTED_LOCATION "${XBRAID_LIBRARY}") + + # set variables for output message, compile tests, and CMake/Makefile + # templates + if(XBRAID_INCLUDES AND XBRAID_LIBRARIES) + set(XBRAID_INCS + "${XBRAID_INCLUDES}" + CACHE INTERNAL "Internal XBraid includes") + set(XBRAID_LIBS + "${XBRAID_LIBRARIES}" + CACHE INTERNAL "Internal XBraid libraries") + else() + set(XBRAID_INCS + "${XBRAID_INCLUDE_DIR}" + CACHE INTERNAL "Internal XBraid includes") + set(XBRAID_LIBS + "${XBRAID_LIBRARY}" + CACHE INTERNAL "Internal XBraid libraries") + endif() + +endif() diff --git a/cmake/tpl/SundialsAdiak.cmake b/cmake/tpl/SundialsAdiak.cmake index b5342a7216..8a6483e308 100644 --- a/cmake/tpl/SundialsAdiak.cmake +++ b/cmake/tpl/SundialsAdiak.cmake @@ -44,7 +44,6 @@ find_package(adiak REQUIRED) message(STATUS "ADIAK_LIBRARIES: ${adiak_LIBRARIES}") message(STATUS "ADIAK_INCLUDE_DIR: ${adiak_INCLUDE_DIR}") - # ----------------------------------------------------------------------------- # Section 4: Test the TPL # ----------------------------------------------------------------------------- @@ -57,28 +56,33 @@ if(adiak_FOUND AND (NOT adiak_WORKS)) file(MAKE_DIRECTORY ${adiak_TEST_DIR}) # Create a C source file - file(WRITE ${adiak_TEST_DIR}/ltest.c - "\#include \n" - "int main(void)\n" - "{\n" - " adiak_init(NULL);\n" - " adiak_fini();\n" - " return 0;\n" - "}\n") + file( + WRITE ${adiak_TEST_DIR}/ltest.c + "\#include \n" + "int main(void)\n" + "{\n" + " adiak_init(NULL);\n" + " adiak_fini();\n" + " return 0;\n" + "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${adiak_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${adiak_TEST_DIR} ${adiak_TEST_DIR}/ltest.c + try_compile( + COMPILE_OK ${adiak_TEST_DIR} + ${adiak_TEST_DIR}/ltest.c OUTPUT_VARIABLE COMPILE_OUTPUT LINK_LIBRARIES adiak::adiak ${CMAKE_DL_LIBS}) # Process test result if(COMPILE_OK) message(STATUS "Checking if adiak works with SUNDIALS... OK") - set(adiak_WORKS TRUE CACHE BOOL "adiak works with SUNDIALS as configured" FORCE) + set(adiak_WORKS + TRUE + CACHE BOOL "adiak works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if adiak works with SUNDIALS... FAILED") message(STATUS "Check output: ") diff --git a/cmake/tpl/SundialsCaliper.cmake b/cmake/tpl/SundialsCaliper.cmake index 998376266d..a07ad39556 100644 --- a/cmake/tpl/SundialsCaliper.cmake +++ b/cmake/tpl/SundialsCaliper.cmake @@ -40,9 +40,7 @@ endif() # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(CALIPER - PATHS "${CALIPER_DIR}" - REQUIRED) +find_package(CALIPER PATHS "${CALIPER_DIR}" REQUIRED) message(STATUS "CALIPER_LIB_DIR: ${caliper_LIB_DIR}") message(STATUS "CALIPER_INCLUDE_DIR: ${caliper_INCLUDE_DIR}") @@ -59,7 +57,8 @@ if(CALIPER_FOUND AND (NOT CALIPER_WORKS)) file(MAKE_DIRECTORY ${CALIPER_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${CALIPER_TEST_DIR}/CMakeLists.txt + file( + WRITE ${CALIPER_TEST_DIR}/CMakeLists.txt "cmake_minimum_required(VERSION ${CMAKE_VERSION})\n" "project(ltest C)\n" "set(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -77,27 +76,32 @@ if(CALIPER_FOUND AND (NOT CALIPER_WORKS)) "target_link_libraries(ltest caliper)\n") # Create a C source file - file(WRITE ${CALIPER_TEST_DIR}/ltest.c - "\#include \n" - "int main(void)\n" - "{\n" - " CALI_MARK_FUNCTION_BEGIN;\n" - " CALI_MARK_FUNCTION_END;\n" - " return 0;\n" - "}\n") + file( + WRITE ${CALIPER_TEST_DIR}/ltest.c + "\#include \n" + "int main(void)\n" + "{\n" + " CALI_MARK_FUNCTION_BEGIN;\n" + " CALI_MARK_FUNCTION_END;\n" + " return 0;\n" + "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${CALIPER_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${CALIPER_TEST_DIR} ${CALIPER_TEST_DIR} ltest + try_compile( + COMPILE_OK ${CALIPER_TEST_DIR} + ${CALIPER_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if CALIPER works with SUNDIALS... OK") - set(CALIPER_WORKS TRUE CACHE BOOL "CALIPER works with SUNDIALS as configured" FORCE) + set(CALIPER_WORKS + TRUE + CACHE BOOL "CALIPER works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if CALIPER works with SUNDIALS... FAILED") message(STATUS "Check output: ") diff --git a/cmake/tpl/SundialsGinkgo.cmake b/cmake/tpl/SundialsGinkgo.cmake index 37dd821a2b..715f30e6bd 100644 --- a/cmake/tpl/SundialsGinkgo.cmake +++ b/cmake/tpl/SundialsGinkgo.cmake @@ -36,13 +36,10 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(Ginkgo REQUIRED - HINTS "${Ginkgo_DIR}" - NO_DEFAULT_PATH) +find_package(Ginkgo REQUIRED HINTS "${Ginkgo_DIR}" NO_DEFAULT_PATH) message(STATUS "GINKGO VERSION: ${GINKGO_PROJECT_VERSION}") message(STATUS "GINKGO BUILD TYPE: ${GINKGO_BUILD_TYPE}") @@ -55,27 +52,43 @@ message(STATUS "GINKGO CXX FLAGS: ${GINKGO_INTERFACE_CXX_FLAGS}") # ----------------------------------------------------------------------------- if(Ginkgo_FOUND AND (NOT GINKGO_WORKS)) if(SUNDIALS_PRECISION MATCHES "extended|EXTENDED") - message(FATAL_ERROR "SUNDIALS GINKGO interface is not compatible with extended precision") + message( + FATAL_ERROR + "SUNDIALS GINKGO interface is not compatible with extended precision") endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend." + ) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend." + ) endif() - if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend.") + if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL" AND NOT ENABLE_SYCL) + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes SYCL but SYCL is not enabled. Set ENABLE_SYCL=ON or change the backend." + ) endif() if(SUNDIALS_GINKGO_BACKENDS MATCHES "OMP" AND NOT ENABLE_OPENMP) - message(FATAL_ERROR "SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_GINKGO_BACKENDS includes OMP but OpenMP is not enabled. Set ENABLE_OPENMP=ON or change the backend." + ) endif() message(STATUS "Checking if GINKGO works... OK") - set(GINKGO_WORKS TRUE CACHE BOOL "GINKGO works with SUNDIALS as configured" FORCE) + set(GINKGO_WORKS + TRUE + CACHE BOOL "GINKGO works with SUNDIALS as configured" FORCE) elseif(Ginkgo_FOUND AND GINKGO_WORKS) message(STATUS "Skipped GINKGO tests, assuming GINKGO works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake index ea27e32973..9d880d2562 100644 --- a/cmake/tpl/SundialsHypre.cmake +++ b/cmake/tpl/SundialsHypre.cmake @@ -39,7 +39,8 @@ endif() if(ENABLE_HYPRE) # Using hypre requres building with MPI enabled if(NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") endif() # Using hypre requres C99 or newer if(CMAKE_C_STANDARD STREQUAL "90") @@ -68,46 +69,52 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS)) file(MAKE_DIRECTORY ${HYPRE_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${HYPRE_TEST_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})\n" - "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "SET(CMAKE_EXE_LINKER_FLAGS \"${LINK_MATH_LIB}\")\n" - "INCLUDE_DIRECTORIES(${HYPRE_INCLUDE_DIR})\n" - "ADD_EXECUTABLE(ltest ltest.c)\n" - "TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n") - - file(WRITE ${HYPRE_TEST_DIR}/ltest.c - "\#include \"HYPRE_parcsr_ls.h\"\n" - "int main(void) {\n" - "HYPRE_ParVector par_b;\n" - "HYPRE_IJVector b;\n" - "par_b = 0;\n" - "b = 0;\n" - "if (par_b != 0 || b != 0) return(1);\n" - "else return(0);\n" - "}\n") - - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + file( + WRITE ${HYPRE_TEST_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ltest C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER ${MPI_C_COMPILER})\n" + "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "SET(CMAKE_EXE_LINKER_FLAGS \"${LINK_MATH_LIB}\")\n" + "INCLUDE_DIRECTORIES(${HYPRE_INCLUDE_DIR})\n" + "ADD_EXECUTABLE(ltest ltest.c)\n" + "TARGET_LINK_LIBRARIES(ltest ${HYPRE_LIBRARIES})\n") + + file( + WRITE ${HYPRE_TEST_DIR}/ltest.c + "\#include \"HYPRE_parcsr_ls.h\"\n" + "int main(void) {\n" + "HYPRE_ParVector par_b;\n" + "HYPRE_IJVector b;\n" + "par_b = 0;\n" + "b = 0;\n" + "if (par_b != 0 || b != 0) return(1);\n" + "else return(0);\n" + "}\n") + + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${HYPRE_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${HYPRE_TEST_DIR} ${HYPRE_TEST_DIR} ltest + try_compile( + COMPILE_OK ${HYPRE_TEST_DIR} + ${HYPRE_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if HYPRE works... OK") - set(HYPRE_WORKS TRUE CACHE BOOL "HYPRE works with SUNDIALS as configured" FORCE) + set(HYPRE_WORKS + TRUE + CACHE BOOL "HYPRE works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if HYPRE works... FAILED") message(STATUS "Check output: ") @@ -116,5 +123,8 @@ if(HYPRE_FOUND AND (NOT HYPRE_WORKS)) endif() elseif(HYPRE_FOUND AND HYPRE_WORKS) - message(STATUS "Skipped HYPRE tests, assuming HYPRE works with SUNDIALS. Set HYPRE_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped HYPRE tests, assuming HYPRE works with SUNDIALS. Set HYPRE_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsKLU.cmake b/cmake/tpl/SundialsKLU.cmake index f3c006608c..3f56e809a8 100644 --- a/cmake/tpl/SundialsKLU.cmake +++ b/cmake/tpl/SundialsKLU.cmake @@ -38,7 +38,8 @@ endif() # KLU does not support single or extended precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "KLU is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "KLU is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -69,7 +70,10 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) set(CMAKE_REQUIRED_INCLUDES ${save_CMAKE_REQUIRED_INCLUDES}) message(STATUS "Size of SuiteSparse_long is ${SIZEOF_SUITESPARSE_LONG}") if(NOT SIZEOF_SUITESPARSE_LONG EQUAL "8") - message(FATAL_ERROR "Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used.") + message( + FATAL_ERROR + "Size of 'sunindextype' is 8 but size of 'SuiteSparse_long' is ${SIZEOF_SUITESPARSE_LONG}. KLU cannot be used." + ) endif() endif() @@ -78,43 +82,44 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) file(MAKE_DIRECTORY ${KLU_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${KLU_TEST_DIR}/CMakeLists.txt - "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" - "PROJECT(ltest C)\n" - "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" - "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" - "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" - "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" - "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" - "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" - "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" - "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" - "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" - "INCLUDE_DIRECTORIES(${KLU_INCLUDE_DIR})\n" - "ADD_EXECUTABLE(ltest ltest.c)\n" - "TARGET_LINK_LIBRARIES(ltest ${KLU_LIBRARIES})\n") + file( + WRITE ${KLU_TEST_DIR}/CMakeLists.txt + "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" + "PROJECT(ltest C)\n" + "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" + "SET(CMAKE_BUILD_TYPE \"${CMAKE_BUILD_TYPE}\")\n" + "SET(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")\n" + "SET(CMAKE_C_STANDARD \"${CMAKE_C_STANDARD}\")\n" + "SET(CMAKE_C_FLAGS \"${CMAKE_C_FLAGS}\")\n" + "SET(CMAKE_C_FLAGS_RELEASE \"${CMAKE_C_FLAGS_RELEASE}\")\n" + "SET(CMAKE_C_FLAGS_DEBUG \"${CMAKE_C_FLAGS_DEBUG}\")\n" + "SET(CMAKE_C_FLAGS_RELWITHDEBUGINFO \"${CMAKE_C_FLAGS_RELWITHDEBUGINFO}\")\n" + "SET(CMAKE_C_FLAGS_MINSIZE \"${CMAKE_C_FLAGS_MINSIZE}\")\n" + "INCLUDE_DIRECTORIES(${KLU_INCLUDE_DIR})\n" + "ADD_EXECUTABLE(ltest ltest.c)\n" + "TARGET_LINK_LIBRARIES(ltest ${KLU_LIBRARIES})\n") # Create a C source file which calls a KLU function file(WRITE ${KLU_TEST_DIR}/ltest.c - "\#include \"klu.h\"\n" - "int main(void) {\n" - "klu_common Common;\n" - "klu_defaults (&Common);\n" - "return(0);\n" - "}\n") - - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + "\#include \"klu.h\"\n" "int main(void) {\n" "klu_common Common;\n" + "klu_defaults (&Common);\n" "return(0);\n" "}\n") + + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${KLU_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${KLU_TEST_DIR} ${KLU_TEST_DIR} ltest + try_compile( + COMPILE_OK ${KLU_TEST_DIR} + ${KLU_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if KLU works... OK") - set(KLU_WORKS TRUE CACHE BOOL "KLU works with SUNDIALS as configured" FORCE) + set(KLU_WORKS + TRUE + CACHE BOOL "KLU works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if KLU works... FAILED") message(STATUS "Check output: ") @@ -123,5 +128,8 @@ if(KLU_FOUND AND (NOT KLU_WORKS)) endif() elseif(KLU_FOUND AND KLU_WORKS) - message(STATUS "Skipped KLU tests, assuming KLU works with SUNDIALS. Set KLU_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped KLU tests, assuming KLU works with SUNDIALS. Set KLU_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsKokkos.cmake b/cmake/tpl/SundialsKokkos.cmake index c082a14e87..ad13181b30 100644 --- a/cmake/tpl/SundialsKokkos.cmake +++ b/cmake/tpl/SundialsKokkos.cmake @@ -36,18 +36,16 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(Kokkos REQUIRED - HINTS "${Kokkos_DIR}" - NO_DEFAULT_PATH) +find_package(Kokkos REQUIRED HINTS "${Kokkos_DIR}" NO_DEFAULT_PATH) -# We should be able to use Kokkos_DEVICES directly but it seems to get -# removed or unset in some CMake versions -set(KOKKOS_EXAMPLES_BACKENDS "${Kokkos_DEVICES}" CACHE STRING - "Kokkos backends to build examples with") +# We should be able to use Kokkos_DEVICES directly but it seems to get removed +# or unset in some CMake versions +set(KOKKOS_EXAMPLES_BACKENDS + "${Kokkos_DEVICES}" + CACHE STRING "Kokkos backends to build examples with") mark_as_advanced(FORCE KOKKOS_EXAMPLES_BACKENDS) message(STATUS "Kokkos VERSION: ${Kokkos_VERSION}") @@ -57,8 +55,9 @@ message(STATUS "Kokkos VERSION: ${Kokkos_VERSION}") if(Kokkos_FOUND AND (NOT KOKKOS_WORKS)) message(STATUS "Checking if Kokkos works... OK") - set(KOKKOS_WORKS TRUE CACHE BOOL "Kokkos works with SUNDIALS as configured" - FORCE) + set(KOKKOS_WORKS + TRUE + CACHE BOOL "Kokkos works with SUNDIALS as configured" FORCE) elseif(Kokkos_FOUND AND KOKKOS_WORKS) message(STATUS "Skipped Kokkos tests, assuming Kokkos works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsKokkosKernels.cmake b/cmake/tpl/SundialsKokkosKernels.cmake index 93d68152bf..4f495725ee 100644 --- a/cmake/tpl/SundialsKokkosKernels.cmake +++ b/cmake/tpl/SundialsKokkosKernels.cmake @@ -36,13 +36,11 @@ endif() # Section 2: Check to make sure options are compatible # ----------------------------------------------------------------------------- - # ----------------------------------------------------------------------------- # Section 3: Find the TPL # ----------------------------------------------------------------------------- -find_package(KokkosKernels REQUIRED - HINTS "${KokkosKernels_DIR}" - NO_DEFAULT_PATH) +find_package(KokkosKernels REQUIRED HINTS "${KokkosKernels_DIR}" + NO_DEFAULT_PATH) message(STATUS "Kokkos Kernels VERSION: ${KokkosKernels_VERSION}") @@ -52,8 +50,12 @@ message(STATUS "Kokkos Kernels VERSION: ${KokkosKernels_VERSION}") if(KokkosKernels_FOUND AND (NOT KOKKOS_KERNELS_WORKS)) message(STATUS "Checking if Kokkos Kernels works... OK") - set(KOKKOS_KERNELS_WORKS TRUE CACHE BOOL - "Kokkos Kernels works with SUNDIALS as configured" FORCE) + set(KOKKOS_KERNELS_WORKS + TRUE + CACHE BOOL "Kokkos Kernels works with SUNDIALS as configured" FORCE) elseif(KokkosKernels_FOUND AND KOKKOS_WORKS) - message(STATUS "Skipped Kokkos Kernels tests, assuming Kokkos Kernels works with SUNDIALS.") + message( + STATUS + "Skipped Kokkos Kernels tests, assuming Kokkos Kernels works with SUNDIALS." + ) endif() diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index 0047d6afd5..74261bb469 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -69,15 +69,16 @@ message(STATUS "LAPACK_LIBRARIES: ${LAPACK_LIBRARIES}") # Determining the name-mangling scheme if needed # --------------------------------------------------------------- # In general, names of symbols with and without underscore may be mangled -# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), -# we have to consider both cases. +# differently (e.g. g77 mangles mysub to mysub_ and my_sub to my_sub__), we have +# to consider both cases. # # Method: -# 1) create a library from a Fortran source file which defines a function "mysub" -# 2) attempt to link with this library a C source file which calls the "mysub" -# function using various possible schemes (6 different schemes, corresponding -# to all combinations lower/upper case and none/one/two underscores). -# 3) define the name-mangling scheme based on the test that was successful. +# +# 1. create a library from a Fortran source file which defines a function "mysub" +# 2. attempt to link with this library a C source file which calls the "mysub" +# function using various possible schemes (6 different schemes, corresponding +# to all combinations lower/upper case and none/one/two underscores). +# 3. define the name-mangling scheme based on the test that was successful. # # On exit, if we were able to infer the scheme, the variables # CMAKE_Fortran_SCHEME_NO_UNDERSCORES and CMAKE_Fortran_SCHEME_WITH_UNDERSCORES @@ -92,9 +93,10 @@ if(NEED_FORTRAN_NAME_MANGLING) set(FortranTest_DIR ${PROJECT_BINARY_DIR}/FortranTest) file(MAKE_DIRECTORY ${FortranTest_DIR}) - # Create a CMakeLists.txt file which will generate the "flib" library - # and an executable "ftest" - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + # Create a CMakeLists.txt file which will generate the "flib" library and an + # executable "ftest" + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ftest Fortran)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -109,36 +111,35 @@ if(NEED_FORTRAN_NAME_MANGLING) "ADD_EXECUTABLE(ftest ftest.f)\n" "TARGET_LINK_LIBRARIES(ftest flib)\n") - # Create the Fortran source flib.f which defines two subroutines, "mysub" and "my_sub" + # Create the Fortran source flib.f which defines two subroutines, "mysub" and + # "my_sub" file(WRITE ${FortranTest_DIR}/flib.f - " SUBROUTINE mysub\n" - " RETURN\n" - " END\n" - " SUBROUTINE my_sub\n" - " RETURN\n" - " END\n") + " SUBROUTINE mysub\n" " RETURN\n" " END\n" + " SUBROUTINE my_sub\n" " RETURN\n" " END\n") # Create the Fortran source ftest.f which calls "mysub" and "my_sub" file(WRITE ${FortranTest_DIR}/ftest.f - " PROGRAM ftest\n" - " CALL mysub()\n" - " CALL my_sub()\n" - " END\n") + " PROGRAM ftest\n" " CALL mysub()\n" + " CALL my_sub()\n" " END\n") # Use TRY_COMPILE to make the targets "flib" and "ftest" - try_compile(FTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ftest OUTPUT_VARIABLE MY_OUTPUT) + try_compile( + FTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ftest + OUTPUT_VARIABLE MY_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) # Proceed based on test results if(FTEST_OK) # Infer Fortran name-mangling scheme for symbols WITHOUT underscores. - # Overwrite CMakeLists.txt with one which will generate the "ctest1" executable - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + # Overwrite CMakeLists.txt with one which will generate the "ctest1" + # executable + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ctest1 C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -164,23 +165,25 @@ if(NEED_FORTRAN_NAME_MANGLING) while(${iopt} LESS ${imax}) # Get the current list entry (current scheme) list(GET options ${iopt} opt) - # Generate C source which calls the "mysub" function using the current scheme + # Generate C source which calls the "mysub" function using the current + # scheme file(WRITE ${FortranTest_DIR}/ctest1.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - # Use TRY_COMPILE to make the "ctest1" executable from the current C source - # and linking to the previously created "flib" library. - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest1 OUTPUT_VARIABLE MY_OUTPUT) + "extern void ${opt}();\n" "int main(void){${opt}();return(0);}\n") + # Use TRY_COMPILE to make the "ctest1" executable from the current C + # source and linking to the previously created "flib" library. + try_compile( + CTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ctest1 + OUTPUT_VARIABLE MY_OUTPUT) # Write output compiling the test code file(WRITE ${FortranTest_DIR}/ctest1_${opt}.out "${MY_OUTPUT}") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove + # the CMakeFiles directory. file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) - # Test if we successfully created the "ctest" executable. - # If yes, save the current scheme, and set the counter "iopt" to "imax" - # so that we exit the while loop. - # Otherwise, increment the counter "iopt" and go back in the while loop. + # Test if we successfully created the "ctest" executable. If yes, save the + # current scheme, and set the counter "iopt" to "imax" so that we exit the + # while loop. Otherwise, increment the counter "iopt" and go back in the + # while loop. if(CTEST_OK) set(CMAKE_Fortran_SCHEME_NO_UNDERSCORES ${opt}) set(iopt ${imax}) @@ -191,7 +194,8 @@ if(NEED_FORTRAN_NAME_MANGLING) # Infer Fortran name-mangling scheme for symbols WITH underscores. # Practically a duplicate of the previous steps. - file(WRITE ${FortranTest_DIR}/CMakeLists.txt + file( + WRITE ${FortranTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ctest2 C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -212,10 +216,11 @@ if(NEED_FORTRAN_NAME_MANGLING) while(${iopt} LESS ${imax}) list(GET options ${iopt} opt) file(WRITE ${FortranTest_DIR}/ctest2.c - "extern void ${opt}();\n" - "int main(void){${opt}();return(0);}\n") - try_compile(CTEST_OK ${FortranTest_DIR} ${FortranTest_DIR} - ctest2 OUTPUT_VARIABLE MY_OUTPUT) + "extern void ${opt}();\n" "int main(void){${opt}();return(0);}\n") + try_compile( + CTEST_OK ${FortranTest_DIR} + ${FortranTest_DIR} ctest2 + OUTPUT_VARIABLE MY_OUTPUT) file(WRITE ${FortranTest_DIR}/ctest2_${opt}.out "${MY_OUTPUT}") file(REMOVE_RECURSE ${FortranTest_DIR}/CMakeFiles) if(CTEST_OK) @@ -228,7 +233,8 @@ if(NEED_FORTRAN_NAME_MANGLING) # If a name-mangling scheme was found set the C preprocessor macros to use # that scheme. Otherwise default to lower case with one underscore. - if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) + if(CMAKE_Fortran_SCHEME_NO_UNDERSCORES + AND CMAKE_Fortran_SCHEME_WITH_UNDERSCORES) message(STATUS "Determining Fortran name-mangling scheme... OK") else() message(STATUS "Determining Fortran name-mangling scheme... DEFAULT") @@ -241,19 +247,23 @@ if(NEED_FORTRAN_NAME_MANGLING) set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub_") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## _") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "mysub__") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) name ## __") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB") set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB_") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## _") endif() if(${CMAKE_Fortran_SCHEME_NO_UNDERSCORES} MATCHES "MYSUB__") - set(LAPACK_MANGLE_MACRO1 "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO1 + "#define SUNDIALS_LAPACK_FUNC(name,NAME) NAME ## __") endif() # Symbols WITH underscores @@ -261,28 +271,30 @@ if(NEED_FORTRAN_NAME_MANGLING) set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub_") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## _") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "my_sub__") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) name ## __") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB") set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB_") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## _") endif() if(${CMAKE_Fortran_SCHEME_WITH_UNDERSCORES} MATCHES "MY_SUB__") - set(LAPACK_MANGLE_MACRO2 "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") + set(LAPACK_MANGLE_MACRO2 + "#define SUNDIALS_LAPACK_FUNC_(name,NAME) NAME ## __") endif() # name-mangling scheme has been set set(NEED_FORTRAN_NAME_MANGLING FALSE) - configure_file( - ${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in - ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h - ) + configure_file(${PROJECT_SOURCE_DIR}/src/sundials/sundials_lapack_defs.h.in + ${PROJECT_BINARY_DIR}/src/sundials/sundials_lapack_defs.h) else(FTEST_OK) message(STATUS "Determining Fortran name-mangling scheme... FAILED") @@ -297,7 +309,8 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) file(MAKE_DIRECTORY ${LapackTest_DIR}) # Create a CMakeLists.txt file - file(WRITE ${LapackTest_DIR}/CMakeLists.txt + file( + WRITE ${LapackTest_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -312,8 +325,10 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) "ADD_EXECUTABLE(ltest ltest.c)\n" "TARGET_LINK_LIBRARIES(ltest ${LAPACK_LIBRARIES})\n") - # Create a C source file which calls a Blas function (dcopy) and an Lapack function (dgetrf) - file(WRITE ${LapackTest_DIR}/ltest.c + # Create a C source file which calls a Blas function (dcopy) and an Lapack + # function (dgetrf) + file( + WRITE ${LapackTest_DIR}/ltest.c "${LAPACK_MANGLE_MACRO1}\n" "#define dcopy_f77 SUNDIALS_LAPACK_FUNC(dcopy, DCOPY)\n" "#define dgetrf_f77 SUNDIALS_LAPACK_FUNC(dgetrf, DGETRF)\n" @@ -329,20 +344,25 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) "}\n") # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${LapackTest_DIR} ${LapackTest_DIR} - ltest OUTPUT_VARIABLE COMPILE_OUTPUT) + try_compile( + COMPILE_OK ${LapackTest_DIR} + ${LapackTest_DIR} ltest + OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${LapackTest_DIR}/CMakeFiles) # Process test result if(COMPILE_OK) message(STATUS "Checking if LAPACK works with SUNDIALS... OK") - set(LAPACK_WORKS TRUE CACHE BOOL "LAPACK works with SUNDIALS as configured" FORCE) + set(LAPACK_WORKS + TRUE + CACHE BOOL "LAPACK works with SUNDIALS as configured" FORCE) # get path to LAPACK library to use in generated makefiles for examples, if - # LAPACK_LIBRARIES contains multiple items only use the path of the first entry + # LAPACK_LIBRARIES contains multiple items only use the path of the first + # entry list(LENGTH LAPACK_LIBRARIES len) if(len EQUAL 1) get_filename_component(LAPACK_LIBRARY_DIR ${LAPACK_LIBRARIES} PATH) @@ -351,7 +371,9 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) get_filename_component(LAPACK_LIBRARY_DIR ${TMP_LAPACK_LIBRARIES} PATH) endif() else(COMPILE_OK) - set(LAPACK_WORKS FALSE CACHE BOOL "LAPACK does not work with SUNDIALS as configured" FORCE) + set(LAPACK_WORKS + FALSE + CACHE BOOL "LAPACK does not work with SUNDIALS as configured" FORCE) message(STATUS "Checking if LAPACK works with SUNDIALS... FAILED") message(STATUS "Check output: ") message("${COMPILE_OUTPUT}") @@ -359,5 +381,8 @@ if(LAPACK_LIBRARIES AND (NOT LAPACK_WORKS)) endif() elseif(LAPACK_LIBRARIES AND LAPACK_WORKS) - message(STATUS "Skipped LAPACK tests, assuming LAPACK works with SUNDIALS. Set LAPACK_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped LAPACK tests, assuming LAPACK works with SUNDIALS. Set LAPACK_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsMAGMA.cmake b/cmake/tpl/SundialsMAGMA.cmake index 6b11a92b8d..6fb0284713 100644 --- a/cmake/tpl/SundialsMAGMA.cmake +++ b/cmake/tpl/SundialsMAGMA.cmake @@ -37,7 +37,9 @@ endif() # ----------------------------------------------------------------------------- if(SUNDIALS_PRECISION MATCHES "extended") - message(FATAL_ERROR "SUNDIALS MAGMA interface is not compatible with extended precision") + message( + FATAL_ERROR + "SUNDIALS MAGMA interface is not compatible with extended precision") endif() # ----------------------------------------------------------------------------- @@ -57,13 +59,21 @@ message(STATUS "SUNDIALS_MAGMA_BACKENDS: ${SUNDIALS_MAGMA_BACKENDS}") if(MAGMA_FOUND AND (NOT MAGMA_WORKS)) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA" AND NOT ENABLE_CUDA) - message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_MAGMA_BACKENDS includes CUDA but CUDA is not enabled. Set ENABLE_CUDA=ON or change the backend." + ) endif() if(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP" AND NOT ENABLE_HIP) - message(FATAL_ERROR "SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend.") + message( + FATAL_ERROR + "SUNDIALS_MAGMA_BACKENDS includes HIP but HIP is not enabled. Set ENABLE_HIP=ON or change the backend." + ) endif() - set(MAGMA_WORKS TRUE CACHE BOOL "MAGMA works with SUNDIALS as configured" FORCE) + set(MAGMA_WORKS + TRUE + CACHE BOOL "MAGMA works with SUNDIALS as configured" FORCE) elseif(MAGMA_FOUND AND MAGMA_WORKS) message(STATUS "Skipped MAGMA tests, assuming MAGMA works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsMPI.cmake b/cmake/tpl/SundialsMPI.cmake index 63beb052c3..1905c66d5d 100644 --- a/cmake/tpl/SundialsMPI.cmake +++ b/cmake/tpl/SundialsMPI.cmake @@ -13,15 +13,11 @@ # --------------------------------------------------------------------------- # Setup MPI for SUNDIALS CMake-based configuration. # --------------------------------------------------------------------------- -# Prior to CMake 3.10 the CMake FindMPI module considers: -# 1. Inspect MPI wrappers (MPI__COMPILER) -# 2. Try guesses -# 3. Try the compiler (CMAKE__COMPILER) -# # Starting with CMake 3.10 the CMake FindMPI module considers: -# 1. Try the compiler (CMAKE__COMPILER) -# 2. Inspect MPI wrappers (MPI__COMPILER) -# 3. Try guesses +# +# 1. Try the compiler (CMAKE__COMPILER) +# 2. Inspect MPI wrappers (MPI__COMPILER) +# 3. Try guesses # --------------------------------------------------------------------------- # ----------------------------------------------------------------------------- @@ -35,25 +31,22 @@ else() endif() # --------------------------------------------------------------------------- -# If MPI__COMPILER is set, FindMPI will try to set the below variables -# for the given compiler wrapper. If MPI__COMPILER is unset FindMPI -# will attempt to locate an installed MPI library and set the below -# variables. -# -# MPI__FOUND TRUE if FindMPI found MPI flags for -# MPI__COMPILER MPI Compiler wrapper for -# MPI__COMPILE_FLAGS Compilation flags for MPI programs -# MPI__INCLUDE_PATH Include path(s) for MPI header -# MPI__LINK_FLAGS Linking flags for MPI programs -# MPI__LIBRARIES All libraries to link MPI programs against +# If MPI__COMPILER is set, FindMPI will try to set the below variables for +# the given compiler wrapper. If MPI__COMPILER is unset FindMPI will +# attempt to locate an installed MPI library and set the below variables. # -# MPIEXEC_EXECUTABLE Executable for running MPI programs -# MPIEXEC_NUMPROC_FLAG Flag to pass to MPIEXEC_EXECUTABLE before -# giving it the number of processors to run on -# MPIEXEC_PREFLAGS Flags to pass to MPIEXEC_EXECUTABLE directly -# before the executable to run. -# MPIEXEC_POSTFLAGS Flags to pass to MPIEXEC_EXECUTABLE after -# other flags +# * MPI__FOUND -- TRUE if FindMPI found MPI flags for +# * MPI__COMPILER -- MPI Compiler wrapper for +# * MPI__COMPILE_FLAGS -- Compilation flags for MPI programs +# * MPI__INCLUDE_PATH -- Include path(s) for MPI header +# * MPI__LINK_FLAGS -- Linking flags for MPI programs +# * MPI__LIBRARIES -- All libraries to link MPI programs against +# * MPIEXEC_EXECUTABLE -- Executable for running MPI programs +# * MPIEXEC_NUMPROC_FLAG -- Flag to pass to MPIEXEC_EXECUTABLE before giving it +# the number of processors to run on +# * MPIEXEC_PREFLAGS -- Flags to pass to MPIEXEC_EXECUTABLE directly before the +# executable to run. +# * MPIEXEC_POSTFLAGS -- Flags to pass to MPIEXEC_EXECUTABLE after other flags # --------------------------------------------------------------------------- mark_as_advanced(MPI_EXTRA_LIBRARY) diff --git a/cmake/tpl/SundialsONEMKL.cmake b/cmake/tpl/SundialsONEMKL.cmake index 693474e523..8fe11a2207 100644 --- a/cmake/tpl/SundialsONEMKL.cmake +++ b/cmake/tpl/SundialsONEMKL.cmake @@ -38,14 +38,15 @@ endif() # oneMKL does not support extended precision if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR - "oneMKL is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "oneMKL is not compatible with ${SUNDIALS_PRECISION} precision") endif() # oneMKL does not support 32-bit index sizes if(SUNDIALS_INDEX_SIZE MATCHES "32") - message(FATAL_ERROR - "oneMKL is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") + message( + FATAL_ERROR + "oneMKL is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") endif() # ----------------------------------------------------------------------------- @@ -59,10 +60,14 @@ if(ENABLE_SYCL) endif() # Look for CMake configuration file in oneMKL installation -find_package(MKL CONFIG - PATHS "${ONEMKL_DIR}" "${ONEMKL_DIR}/lib/cmake/mkl" - NO_DEFAULT_PATH - REQUIRED) +find_package( + MKL + CONFIG + PATHS + "${ONEMKL_DIR}" + "${ONEMKL_DIR}/lib/cmake/mkl" + NO_DEFAULT_PATH + REQUIRED) message(STATUS "MKL Version: ${MKL_VERSION}") message(STATUS "MKL Targets: ${MKL_IMPORTED_TARGETS}") @@ -73,7 +78,9 @@ message(STATUS "MKL Targets: ${MKL_IMPORTED_TARGETS}") if(MKL_FOUND AND (NOT ONEMKL_WORKS)) message(STATUS "Checking if oneMKL works... OK") - set(ONEMKL_WORKS TRUE CACHE BOOL "oneMKL works with SUNDIALS as configured" FORCE) + set(ONEMKL_WORKS + TRUE + CACHE BOOL "oneMKL works with SUNDIALS as configured" FORCE) else() message(STATUS "Skipped oneMKL tests, assuming oneMKL works with SUNDIALS.") endif() diff --git a/cmake/tpl/SundialsOpenMP.cmake b/cmake/tpl/SundialsOpenMP.cmake index d845a27888..e59b47b670 100644 --- a/cmake/tpl/SundialsOpenMP.cmake +++ b/cmake/tpl/SundialsOpenMP.cmake @@ -54,37 +54,52 @@ find_package(OpenMP REQUIRED) # ----------------------------------------------------------------------------- # Work around a bug in setting OpenMP version variables in CMake >= 3.9. The -# OpenMP version information is not stored in cache variables and is not set -# on repeated calls to find OpenMP (i.e., when using ccmake). To ensure these +# OpenMP version information is not stored in cache variables and is not set on +# repeated calls to find OpenMP (i.e., when using ccmake). To ensure these # variables exist store copies of the values. -set(OpenMP_C_VERSION "${OpenMP_C_VERSION}" CACHE INTERNAL "" FORCE) -set(OpenMP_CXX_VERSION "${OpenMP_CXX_VERSION}" CACHE INTERNAL "" FORCE) -set(OpenMP_Fortran_VERSION "${OpenMP_Fortran_VERSION}" CACHE INTERNAL "" FORCE) +set(OpenMP_C_VERSION + "${OpenMP_C_VERSION}" + CACHE INTERNAL "" FORCE) +set(OpenMP_CXX_VERSION + "${OpenMP_CXX_VERSION}" + CACHE INTERNAL "" FORCE) +set(OpenMP_Fortran_VERSION + "${OpenMP_Fortran_VERSION}" + CACHE INTERNAL "" FORCE) # Check for OpenMP offloading support if(OPENMP_FOUND AND (ENABLE_OPENMP_DEVICE OR SUPERLUDIST_OpenMP)) if(OPENMP_DEVICE_WORKS) - # The user has asked for checks to be skipped, assume offloading is supported + # The user has asked for checks to be skipped, assume offloading is + # supported set(OPENMP45_FOUND TRUE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING TRUE) - message(WARNING "Skipping OpenMP device/version check." "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed.") + message( + WARNING + "Skipping OpenMP device/version check." + "SUNDIALS OpenMP functionality dependent on OpenMP 4.5+ is not guaranteed." + ) else() # Check the OpenMP version message(STATUS "Checking whether OpenMP supports device offloading") - if((OpenMP_C_VERSION VERSION_EQUAL 4.5) OR (OpenMP_C_VERSION VERSION_GREATER 4.5)) - message(STATUS "Checking whether OpenMP supports device offloading -- yes") + if((OpenMP_C_VERSION VERSION_EQUAL 4.5) OR (OpenMP_C_VERSION VERSION_GREATER + 4.5)) + message( + STATUS "Checking whether OpenMP supports device offloading -- yes") set(OPENMP45_FOUND TRUE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING TRUE) else() message(STATUS "Checking whether OpenMP supports device offloading -- no") set(OPENMP45_FOUND FALSE) set(OPENMP_SUPPORTS_DEVICE_OFFLOADING FALSE) - message(FATAL_ERROR "The found OpenMP version does not support device offloading.") + message( + FATAL_ERROR + "The found OpenMP version does not support device offloading.") endif() endif() diff --git a/cmake/tpl/SundialsPETSC.cmake b/cmake/tpl/SundialsPETSC.cmake index dddcf47180..e31b46c397 100644 --- a/cmake/tpl/SundialsPETSC.cmake +++ b/cmake/tpl/SundialsPETSC.cmake @@ -38,11 +38,15 @@ endif() # Using PETSc requires building with MPI enabled if(ENABLE_PETSC AND NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for PETSc support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for PETSc support. Set ENABLE_MPI to ON.") endif() if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SUNDIALS is not compatible with PETSc when using ${SUNDIALS_PRECISION} precision" + ) endif() # ----------------------------------------------------------------------------- @@ -63,30 +67,37 @@ message(STATUS "PETSC_PRECISION: ${PETSC_PRECISION}") # ----------------------------------------------------------------------------- if(PETSC_FOUND AND (NOT PETSC_WORKS)) - # No need for any compile tests because the FindPETSC module - # does compile tests already. + # No need for any compile tests because the FindPETSC module does compile + # tests already. if(NOT ("${SUNDIALS_INDEX_SIZE}" MATCHES "${PETSC_INDEX_SIZE}")) - string(CONCAT _err_msg_string - "PETSc not functional due to index size mismatch:\n" - "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " - "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" - "PETSC_DIR: ${PETSC_DIR}\n") + string( + CONCAT _err_msg_string + "PETSc not functional due to index size mismatch:\n" + "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, " + "but PETSc was built with ${PETSC_INDEX_SIZE}-bit indices\n" + "PETSC_DIR: ${PETSC_DIR}\n") message(FATAL_ERROR "${_err_msg_string}") endif() string(TOUPPER "${PETSC_PRECISION}" _petsc_precision) string(TOUPPER "${SUNDIALS_PRECISION}" _sundials_precision) if(NOT ("${_sundials_precision}" MATCHES "${_petsc_precision}")) - string(CONCAT _err_msg_string - "PETSc not functional due to real type precision mismatch:\n" - "SUNDIALS_PRECISION=${_sundials_precision}, " - "but PETSc was built with ${_petsc_precision} precision\n" - "PETSC_DIR: ${PETSC_DIR}\n") + string( + CONCAT _err_msg_string + "PETSc not functional due to real type precision mismatch:\n" + "SUNDIALS_PRECISION=${_sundials_precision}, " + "but PETSc was built with ${_petsc_precision} precision\n" + "PETSC_DIR: ${PETSC_DIR}\n") message(FATAL_ERROR "${_err_msg_string}") endif() - set(PETSC_WORKS TRUE CACHE BOOL "PETSC works with SUNDIALS as configured" FORCE) + set(PETSC_WORKS + TRUE + CACHE BOOL "PETSC works with SUNDIALS as configured" FORCE) elseif(PETSC_FOUND AND PETSC_WORKS) - message(STATUS "Skipped PETSC tests, assuming PETSC works with SUNDIALS. Set PETSC_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped PETSC tests, assuming PETSC works with SUNDIALS. Set PETSC_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsPOSIXTimers.cmake b/cmake/tpl/SundialsPOSIXTimers.cmake index 4670849ac5..edf9e4cf29 100644 --- a/cmake/tpl/SundialsPOSIXTimers.cmake +++ b/cmake/tpl/SundialsPOSIXTimers.cmake @@ -17,20 +17,21 @@ macro(posix_timers_test) - set(options ) + set(options) set(oneValueArgs POSIX RT_LIB) - set(multiValueArgs ) + set(multiValueArgs) # parse keyword arguments/options - cmake_parse_arguments(posix_timers_test - "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + cmake_parse_arguments(posix_timers_test "${options}" "${oneValueArgs}" + "${multiValueArgs}" ${ARGN}) # Test timers with a simple program set(POSIX_TIMER_TEST_DIR ${PROJECT_BINARY_DIR}/POSIX_TIMER_TEST) file(MAKE_DIRECTORY ${POSIX_TIMER_TEST_DIR}) # Create a CMakeLists.txt file which will generate the test executable - file(WRITE ${POSIX_TIMER_TEST_DIR}/CMakeLists.txt + file( + WRITE ${POSIX_TIMER_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -48,7 +49,8 @@ macro(posix_timers_test) "TARGET_LINK_LIBRARIES(ltest \"${posix_timers_test_RT_LIB}\")\n") # Create a simple C source for testing - file(WRITE ${POSIX_TIMER_TEST_DIR}/ltest.c + file( + WRITE ${POSIX_TIMER_TEST_DIR}/ltest.c "#include \n" "#include \n" "int main(void) {\n" @@ -58,18 +60,19 @@ macro(posix_timers_test) "return(0);\n" "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${POSIX_TIMER_TEST_DIR}/CMakeFiles) # Use TRY_COMPILE to make the target - try_compile(COMPILE_OK ${POSIX_TIMER_TEST_DIR} ${POSIX_TIMER_TEST_DIR} ltest + try_compile( + COMPILE_OK ${POSIX_TIMER_TEST_DIR} + ${POSIX_TIMER_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) endmacro() - -if (NOT SUNDIALS_POSIX_TIMERS) +if(NOT SUNDIALS_POSIX_TIMERS) # Test for timers without any modifications posix_timers_test() @@ -81,7 +84,8 @@ if (NOT SUNDIALS_POSIX_TIMERS) if(NOT COMPILE_OK) posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L") if(COMPILE_OK) - message(STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE)... found") + message( + STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE)... found") set(POSIX_TIMERS_NEED_POSIX_C_SOURCE TRUE) endif() endif() @@ -109,9 +113,13 @@ if (NOT SUNDIALS_POSIX_TIMERS) # Test failed, try again linking to rt and with -D_POSIX_C_SOURCE=200112L if((NOT COMPILE_OK) AND SUNDIALS_RT_LIBRARY) - posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L" RT_LIB "${SUNDIALS_RT_LIBRARY}") + posix_timers_test(POSIX "_POSIX_C_SOURCE=200112L" RT_LIB + "${SUNDIALS_RT_LIBRARY}") if(COMPILE_OK) - message(STATUS "Looking for POSIX timers (setting _POSIX_C_SOURCE and linking to rt)... found") + message( + STATUS + "Looking for POSIX timers (setting _POSIX_C_SOURCE and linking to rt)... found" + ) set(POSIX_TIMERS_NEED_POSIX_C_SOURCE TRUE) set(POSIX_TIMERS_NEED_RT_LIBRARY TRUE) set(EXE_EXTRA_LINK_LIBS ${EXE_EXTRA_LINK_LIBS} ${SUNDIALS_RT_LIBRARY}) diff --git a/cmake/tpl/SundialsRAJA.cmake b/cmake/tpl/SundialsRAJA.cmake index 1084eb9f6f..64404801b0 100644 --- a/cmake/tpl/SundialsRAJA.cmake +++ b/cmake/tpl/SundialsRAJA.cmake @@ -53,27 +53,36 @@ endif() # ----------------------------------------------------------------------------- # find the library configuration file -find_file(RAJA_CONFIGHPP_PATH config.hpp - HINTS "${RAJA_DIR}" - PATH_SUFFIXES include include/RAJA - NO_DEFAULT_PATH) +find_file( + RAJA_CONFIGHPP_PATH config.hpp + HINTS "${RAJA_DIR}" + PATH_SUFFIXES include include/RAJA + NO_DEFAULT_PATH) mark_as_advanced(FORCE RAJA_CONFIGHPP_PATH) # Look for CMake configuration file in RAJA installation -find_package(RAJA CONFIG - PATHS "${RAJA_DIR}" "${RAJA_DIR}/share/raja/cmake" - NO_DEFAULT_PATH - REQUIRED) +find_package( + RAJA + CONFIG + PATHS + "${RAJA_DIR}" + "${RAJA_DIR}/share/raja/cmake" + NO_DEFAULT_PATH + REQUIRED) # determine the backends foreach(_backend CUDA HIP OPENMP TARGET_OPENMP SYCL) - file(STRINGS "${RAJA_CONFIGHPP_PATH}" _raja_has_backend REGEX "^#define RAJA_ENABLE_${_backend}\$") + file(STRINGS "${RAJA_CONFIGHPP_PATH}" _raja_has_backend + REGEX "^#define RAJA_ENABLE_${_backend}\$") if(_raja_has_backend) set(RAJA_BACKENDS "${_backend};${RAJA_BACKENDS}") endif() endforeach() -message(STATUS "RAJA Version: ${RAJA_VERSION_MAJOR}.${RAJA_VERSION_MINOR}.${RAJA_VERSION_PATCHLEVEL}") +message( + STATUS + "RAJA Version: ${RAJA_VERSION_MAJOR}.${RAJA_VERSION_MINOR}.${RAJA_VERSION_PATCHLEVEL}" +) message(STATUS "RAJA Backends: ${RAJA_BACKENDS}") set(RAJA_NEEDS_THREADS OFF) @@ -82,9 +91,9 @@ if("${RAJA_BACKENDS}" MATCHES "CUDA") if(NOT TARGET Threads::Threads) find_package(Threads) endif() - # The RAJA target links to camp which links to a target 'cuda_runtime' - # which is normally provided by BLT. Since we do not use BLT, we instead - # create the target here and tell it to link to CUDA::cudart. + # The RAJA target links to camp which links to a target 'cuda_runtime' which + # is normally provided by BLT. Since we do not use BLT, we instead create the + # target here and tell it to link to CUDA::cudart. if(NOT TARGET cuda_runtime) add_library(cuda_runtime INTERFACE IMPORTED) target_link_libraries(cuda_runtime INTERFACE CUDA::cudart) @@ -94,25 +103,39 @@ endif() # Section 4: Test the TPL # ----------------------------------------------------------------------------- -if((SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") AND - (NOT RAJA_BACKENDS MATCHES "CUDA")) - message(FATAL_ERROR "Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") AND (NOT RAJA_BACKENDS MATCHES "CUDA" + )) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the CUDA RAJA backend, but RAJA was not built with the CUDA backend." + ) endif() -if((SUNDIALS_RAJA_BACKENDS MATCHES "HIP") AND - (NOT RAJA_BACKENDS MATCHES "HIP")) - message(FATAL_ERROR "Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "HIP") AND (NOT RAJA_BACKENDS MATCHES "HIP")) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the HIP RAJA backend, but RAJA was not built with the HIP backend." + ) endif() if(NOT ENABLE_OPENMP AND RAJA_BACKENDS MATCHES "OPENMP") - message(FATAL_ERROR "RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON.") + message( + FATAL_ERROR + "RAJA was built with OpenMP, but OpenMP is not enabled. Set ENABLE_OPENMP to ON." + ) endif() if(NOT ENABLE_OPENMP_DEVICE AND RAJA_BACKENDS MATCHES "TARGET_OPENMP") - message(FATAL_ERROR "RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON.") + message( + FATAL_ERROR + "RAJA was built with OpenMP device offloading, but OpenMP with device offloading is not enabled. Set ENABLE_OPENMP_DEVICE to ON." + ) endif() -if((SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") AND - (NOT RAJA_BACKENDS MATCHES "SYCL")) - message(FATAL_ERROR "Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend.") +if((SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") AND (NOT RAJA_BACKENDS MATCHES "SYCL" + )) + message( + FATAL_ERROR + "Requested that SUNDIALS uses the SYCL RAJA backend, but RAJA was not built with the SYCL backend." + ) endif() diff --git a/cmake/tpl/SundialsSuperLUDIST.cmake b/cmake/tpl/SundialsSuperLUDIST.cmake index 2dfc84a565..cd5d63421f 100644 --- a/cmake/tpl/SundialsSuperLUDIST.cmake +++ b/cmake/tpl/SundialsSuperLUDIST.cmake @@ -38,17 +38,25 @@ endif() # SuperLU_DIST only supports double precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SuperLU_DIST is not compatible with ${SUNDIALS_PRECISION} precision") endif() # Using SUPERLUDIST requires building with MPI enabled if(ENABLE_SUPERLUDIST AND NOT ENABLE_MPI) - message(FATAL_ERROR "MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR + "MPI is required for SuperLU DIST support. Set ENABLE_MPI to ON.") endif() # Using SUPERLUDIST with OpenMP requires building with OpenMP enabled -if(ENABLE_SUPERLUDIST AND SUPERLUDIST_OpenMP AND NOT ENABLE_OPENMP) - message(FATAL_ERROR "OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") +if(ENABLE_SUPERLUDIST + AND SUPERLUDIST_OpenMP + AND NOT ENABLE_OPENMP) + message( + FATAL_ERROR + "OpenMP is required for SuperLU DIST support. Set ENABLE_OPENMP to ON.") endif() # ----------------------------------------------------------------------------- @@ -77,25 +85,41 @@ message(STATUS "SUPERLUDIST_ROCM: ${SUPERLUDIST_ROCM}") if(SUPERLUDIST_FOUND AND (NOT SUPERLUDIST_WORKS)) if(SUPERLUDIST_CUDA AND (NOT ENABLE_CUDA)) - message(FATAL_ERROR "SuperLU_DIST was built with CUDA but SUNDIALS does not have CUDA enabled. Set ENABLE_CUDA=TRUE.") + message( + FATAL_ERROR + "SuperLU_DIST was built with CUDA but SUNDIALS does not have CUDA enabled. Set ENABLE_CUDA=TRUE." + ) endif() if(SUPERLUDIST_HIP AND (NOT ENABLE_HIP)) - message(FATAL_ERROR "SuperLU_DIST was built with HIP but SUNDIALS does not have HIP enabled. Set ENABLE_HIP=TRUE.") + message( + FATAL_ERROR + "SuperLU_DIST was built with HIP but SUNDIALS does not have HIP enabled. Set ENABLE_HIP=TRUE." + ) endif() # Check index size if(NOT (SUNDIALS_INDEX_SIZE STREQUAL SUPERLUDIST_INDEX_SIZE)) - set(_err_msg_string "SuperLU_DIST not functional due to index size mismatch:\n") - string(APPEND _err_msg_string "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, but SuperLU_DIST was built with ${SUPERLUDIST_INDEX_SIZE}-bit indices\n") - string(APPEND _err_msg_string "SUPERLUDIST_INCLUDE_DIRS: ${SUPERLUDIST_INCLUDE_DIRS}\n") + set(_err_msg_string + "SuperLU_DIST not functional due to index size mismatch:\n") + string( + APPEND + _err_msg_string + "SUNDIALS_INDEX_SIZE=${SUNDIALS_INDEX_SIZE}, but SuperLU_DIST was built with ${SUPERLUDIST_INDEX_SIZE}-bit indices\n" + ) + string(APPEND _err_msg_string + "SUPERLUDIST_INCLUDE_DIRS: ${SUPERLUDIST_INCLUDE_DIRS}\n") message(FATAL_ERROR "${_err_msg_string}") endif() - message(STATUS "Checking if SuperLU_DIST works with SUNDIALS... OK") - set(SUPERLUDIST_WORKS TRUE CACHE BOOL "SuperLU_DIST works with SUNDIALS as configured" FORCE) + set(SUPERLUDIST_WORKS + TRUE + CACHE BOOL "SuperLU_DIST works with SUNDIALS as configured" FORCE) elseif(SUPERLUDIST_FOUND AND SUPERLUDIST_WORKS) - message(STATUS "Skipped SuperLU_DIST tests, assuming SuperLU_DIST works with SUNDIALS. Set SUPERLUDIST_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped SuperLU_DIST tests, assuming SuperLU_DIST works with SUNDIALS. Set SUPERLUDIST_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsSuperLUMT.cmake b/cmake/tpl/SundialsSuperLUMT.cmake index a7b6bf863a..a6c62d8649 100644 --- a/cmake/tpl/SundialsSuperLUMT.cmake +++ b/cmake/tpl/SundialsSuperLUMT.cmake @@ -38,7 +38,9 @@ endif() # SUPERLUMT does not support extended precision if(SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR "SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR + "SUPERLUMT is not compatible with ${SUNDIALS_PRECISION} precision") endif() # ----------------------------------------------------------------------------- @@ -61,7 +63,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) file(MAKE_DIRECTORY ${SUPERLUMT_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${SUPERLUMT_TEST_DIR}/CMakeLists.txt + file( + WRITE ${SUPERLUMT_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest C)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -78,7 +81,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) "TARGET_LINK_LIBRARIES(ltest ${SUPERLUMT_LIBRARIES})\n") # Create a C source file which calls a SUPERLUMT function - file(WRITE ${SUPERLUMT_TEST_DIR}/ltest.c + file( + WRITE ${SUPERLUMT_TEST_DIR}/ltest.c "\#include \"slu_mt_ddefs.h\"\n" "int main(void) {\n" "SuperMatrix *A;\n" @@ -89,19 +93,22 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) "else return(0);\n" "}\n") - # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${SUPERLUMT_TEST_DIR} ${SUPERLUMT_TEST_DIR} ltest + try_compile( + COMPILE_OK ${SUPERLUMT_TEST_DIR} + ${SUPERLUMT_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${SUPERLUMT_TEST_DIR}/CMakeFiles) - # Process test result + # Process test result if(COMPILE_OK) message(STATUS "Checking if SuperLU_MT works with SUNDIALS... OK") - set(SUPERLUMT_WORKS TRUE CACHE BOOL "SuperLU_MT works with SUNDIALS as configured" FORCE) + set(SUPERLUMT_WORKS + TRUE + CACHE BOOL "SuperLU_MT works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if SuperLU_MT works with SUNDIALS... FAILED") message(STATUS "Check output: ") @@ -110,5 +117,8 @@ if(SUPERLUMT_FOUND AND (NOT SUPERLUMT_WORKS)) endif() elseif(SUPERLUMT_FOUND AND SUPERLUMT_WORKS) - message(STATUS "Skipped SuperLU_MT tests, assuming SuperLU_MT works with SUNDIALS. Set SUPERLUMT_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped SuperLU_MT tests, assuming SuperLU_MT works with SUNDIALS. Set SUPERLUMT_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsTrilinos.cmake b/cmake/tpl/SundialsTrilinos.cmake index 849eef6319..7f8940ef90 100644 --- a/cmake/tpl/SundialsTrilinos.cmake +++ b/cmake/tpl/SundialsTrilinos.cmake @@ -43,9 +43,8 @@ endif() # Find Trilinos find_package(Trilinos REQUIRED) -# Check if Trilinos was built with MPI -# Starting with TriBITS 2022-10-16 is no longer defined so we -# base MPI support on ENABLE_MPI +# Check if Trilinos was built with MPI Starting with TriBITS 2022-10-16 +# is no longer defined so we base MPI support on ENABLE_MPI if(Trilinos_TPL_LIST) if(";${Trilinos_TPL_LIST};" MATCHES ";MPI;") set(Trilinos_MPI TRUE) @@ -60,37 +59,66 @@ else() endif() endif() -# For XSDK compatibility, only use the user/spack provided compiler and flags to build -# SUNDIALS modules that use Trilinos. If we are not in XSDK mode, we can use the imported -# Trilinos compiler and flags by default, but allow the user to change it through CMake -# the Trilinos_INTERFACE_* options. +# For XSDK compatibility, only use the user/spack provided compiler and flags to +# build SUNDIALS modules that use Trilinos. If we are not in XSDK mode, we can +# use the imported Trilinos compiler and flags by default, but allow the user to +# change it through CMake the Trilinos_INTERFACE_* options. if(USE_XSDK_DEFAULTS) if(Trilinos_MPI AND MPI_CXX_FOUND) - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" "${MPI_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING + "C++ compiler for Trilinos interface" "${MPI_CXX_COMPILER}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") else() - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C compiler for Trilinos interface" "${CMAKE_CXX_COMPILER}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND FALSE CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING + "C compiler for Trilinos interface" "${CMAKE_CXX_COMPILER}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + FALSE + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") endif() if(Trilinos_MPI AND MPI_C_FOUND) - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${MPI_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${MPI_C_COMPILER}") + set(Trilinos_INTERFACE_MPI_C_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C compiler MPI") else() - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${CMAKE_C_COMPILER}") - set(Trilinos_INTERFACE_MPI_C_FOUND FALSE CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${CMAKE_C_COMPILER}") + set(Trilinos_INTERFACE_MPI_C_FOUND + FALSE + CACHE INTERNAL "Is Trilinos interface C compiler MPI") endif() - force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING "C++ compiler flags specific to Trilinos interface" "") - force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING "C compiler flags specific to Trilinos interface" "") - force_variable(Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" "${MPIEXEC_EXECUTABLE}") + force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags specific to Trilinos interface" "") + force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags specific to Trilinos interface" "") + force_variable( + Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" + "${MPIEXEC_EXECUTABLE}") else() - force_variable(Trilinos_INTERFACE_CXX_COMPILER STRING "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}") - force_variable(Trilinos_INTERFACE_C_COMPILER STRING "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}") - force_variable(Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING "C++ compiler flags for Trilinos interface" "${Trilinos_CXX_COMPILER_FLAGS}") - force_variable(Trilinos_INTERFACE_C_COMPILER_FLAGS STRING "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}") - force_variable(Trilinos_INTERFACE_MPIEXEC STRING "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}") - set(Trilinos_INTERFACE_MPI_CXX_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") - set(Trilinos_INTERFACE_MPI_C_FOUND ${Trilinos_MPI} CACHE INTERNAL "Is Trilinos interface C compiler MPI") + force_variable( + Trilinos_INTERFACE_CXX_COMPILER STRING + "C++ compiler for Trilinos interface" "${Trilinos_CXX_COMPILER}") + force_variable(Trilinos_INTERFACE_C_COMPILER STRING + "C compiler for Trilinos interface" "${Trilinos_C_COMPILER}") + force_variable( + Trilinos_INTERFACE_CXX_COMPILER_FLAGS STRING + "C++ compiler flags for Trilinos interface" + "${Trilinos_CXX_COMPILER_FLAGS}") + force_variable( + Trilinos_INTERFACE_C_COMPILER_FLAGS STRING + "C compiler flags for Trilinos interface" "${Trilinos_C_COMPILER_FLAGS}") + force_variable(Trilinos_INTERFACE_MPIEXEC STRING + "MPI executable for Trilinos interface" "${Trilinos_MPI_EXEC}") + set(Trilinos_INTERFACE_MPI_CXX_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C++ compiler MPI") + set(Trilinos_INTERFACE_MPI_C_FOUND + ${Trilinos_MPI} + CACHE INTERNAL "Is Trilinos interface C compiler MPI") endif() message(STATUS "Trilinos_MPI: ${Trilinos_MPI}") @@ -109,7 +137,8 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) file(MAKE_DIRECTORY ${Trilinos_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${Trilinos_TEST_DIR}/CMakeLists.txt + file( + WRITE ${Trilinos_TEST_DIR}/CMakeLists.txt "CMAKE_MINIMUM_REQUIRED(VERSION ${CMAKE_VERSION})\n" "PROJECT(ltest CXX)\n" "SET(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -125,20 +154,21 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) # Create a C++ source file which calls a Trilinos function file(WRITE ${Trilinos_TEST_DIR}/ltest.cpp - "#include \n" - "int main(void) {\n" - "std::cout << Tpetra::version() << std::endl;\n" - "return(0);\n" - "}\n") + "#include \n" "int main(void) {\n" + "std::cout << Tpetra::version() << std::endl;\n" "return(0);\n" "}\n") # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${Trilinos_TEST_DIR} ${Trilinos_TEST_DIR} ltest + try_compile( + COMPILE_OK ${Trilinos_TEST_DIR} + ${Trilinos_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if Trilinos works with SUNDIALS... OK") - set(Trilinos_WORKS TRUE CACHE BOOL "Trilinos works with SUNDIALS as configured" FORCE) + set(Trilinos_WORKS + TRUE + CACHE BOOL "Trilinos works with SUNDIALS as configured" FORCE) else() message(STATUS "Checking if Trilinos works with SUNDIALS... FAILED") message(STATUS "Check output: ") @@ -147,5 +177,8 @@ if(Trilinos_FOUND AND (NOT Trilinos_WORKS)) endif() elseif(Trilinos_FOUND AND Trilinos_WORKS) - message(STATUS "Skipped Trilinos tests, assuming Trilinos works with SUNDIALS. Set Trilinos_WORKS=FALSE to (re)run compatibility test.") + message( + STATUS + "Skipped Trilinos tests, assuming Trilinos works with SUNDIALS. Set Trilinos_WORKS=FALSE to (re)run compatibility test." + ) endif() diff --git a/cmake/tpl/SundialsXBRAID.cmake b/cmake/tpl/SundialsXBRAID.cmake index e8e8ceb941..ede169ade0 100644 --- a/cmake/tpl/SundialsXBRAID.cmake +++ b/cmake/tpl/SundialsXBRAID.cmake @@ -38,20 +38,21 @@ endif() # Using XBRAID requires building with MPI enabled if(NOT ENABLE_MPI) - message(FATAL_ERROR - "MPI is required for XBraid support. Set ENABLE_MPI to ON.") + message( + FATAL_ERROR "MPI is required for XBraid support. Set ENABLE_MPI to ON.") endif() # XBraid does not support single or extended precision if(SUNDIALS_PRECISION MATCHES "SINGLE" OR SUNDIALS_PRECISION MATCHES "EXTENDED") - message(FATAL_ERROR - "XBraid is not compatible with ${SUNDIALS_PRECISION} precision") + message( + FATAL_ERROR "XBraid is not compatible with ${SUNDIALS_PRECISION} precision") endif() # XBraid does not support 64-bit index sizes if(SUNDIALS_INDEX_SIZE MATCHES "64") - message(FATAL_ERROR - "XBraid is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") + message( + FATAL_ERROR + "XBraid is not compatible with ${SUNDIALS_INDEX_SIZE}-bit indices") endif() # ----------------------------------------------------------------------------- @@ -76,7 +77,8 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) file(MAKE_DIRECTORY ${XBRAID_TEST_DIR}) # Create a CMakeLists.txt file - file(WRITE ${XBRAID_TEST_DIR}/CMakeLists.txt + file( + WRITE ${XBRAID_TEST_DIR}/CMakeLists.txt "cmake_minimum_required(VERSION ${CMAKE_VERSION})\n" "project(ltest C)\n" "set(CMAKE_VERBOSE_MAKEFILE ON)\n" @@ -94,7 +96,8 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) "target_link_libraries(ltest m)\n") # Create a C source file - file(WRITE ${XBRAID_TEST_DIR}/ltest.c + file( + WRITE ${XBRAID_TEST_DIR}/ltest.c "\#include \n" "\#include \"braid.h\"\n" "int main(void) {\n" @@ -104,18 +107,22 @@ if(XBRAID_FOUND AND (NOT XBRAID_WORKS)) "return 0;\n" "}\n") - # To ensure we do not use stuff from the previous attempts, - # we must remove the CMakeFiles directory. + # To ensure we do not use stuff from the previous attempts, we must remove the + # CMakeFiles directory. file(REMOVE_RECURSE ${XBRAID_TEST_DIR}/CMakeFiles) # Attempt to build and link the "ltest" executable - try_compile(COMPILE_OK ${XBRAID_TEST_DIR} ${XBRAID_TEST_DIR} ltest + try_compile( + COMPILE_OK ${XBRAID_TEST_DIR} + ${XBRAID_TEST_DIR} ltest OUTPUT_VARIABLE COMPILE_OUTPUT) # Process test result if(COMPILE_OK) message(STATUS "Checking if XBRAID works... OK") - set(XBRAID_WORKS TRUE CACHE BOOL "XBRAID works as configured" FORCE) + set(XBRAID_WORKS + TRUE + CACHE BOOL "XBRAID works as configured" FORCE) else() message(STATUS "Checking if XBRAID works... FAILED") message(STATUS "Check output: ") diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index a01897bdf2..5a05602867 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -186,7 +186,8 @@ not adhere to all of these rules. #. All new code added to SUNDIALS should be formatted with `clang-format `_ for C/C++, `fprettify - `_ for Fortran, and `black + `_ for Fortran, `cmake-format + `_ for CMake, and `black `_ for Python. See :ref:`Style.Formatting` for details. @@ -380,18 +381,21 @@ Formatting All new code added to SUNDIALS should be formatted with `clang-format `_ for C/C++, `fprettify -`_ for Fortran, and `black +`_ for Fortran, `cmake-format +`_ for CMake, and `black `_ for Python. The ``.clang-format`` file in the root of the project defines our configuration for clang-format. We use the -default fprettify settings, except we use 2-space indentation. We also use the -default black settings. +default fprettify settings, except we use 2-space indentation. The +``.cmake-format.py`` file in the root of the project defines our configuration +for cmake-format. We also use the default black settings. -To apply ``clang-format``, ``fprettify``, and ``black`` you can run: -.. code-block:: shell +To apply ``clang-format``, ``fprettify``, ``cmake-format``, and ``black`` you +can run: - ./scripts/format.sh +.. code-block:: shell + ./scripts/format.sh .. warning:: @@ -401,7 +405,6 @@ To apply ``clang-format``, ``fprettify``, and ``black`` you can run: formatting is required, the action will fail and produce a git patch artifact that you can download (from the job artifacts section) and apply with ``git apply``. - If clang-format breaks lines in a way that is unreadable, use ``//`` to break the line. For example, sometimes (mostly in C++ code) you may have code like this: @@ -457,4 +460,3 @@ There are other scenarios (e.g., a function call with a lot of parameters) where .. }; .. See the clang-tidy documentation for more details. - diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 55b1e52db4..45990b05da 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -15,7 +15,8 @@ # --------------------------------------------------------------- # We need this to ensure the installed templates have MPI when ENABLE_MPI=TRUE, -# at least until we convert all of the templates to use the SUNDIALS CMake target. +# at least until we convert all of the templates to use the SUNDIALS CMake +# target. # =================================================================== # Configure compilers for installed examples @@ -24,10 +25,14 @@ foreach(lang ${_SUNDIALS_ENABLED_LANGS}) if(ENABLE_MPI) if(DEFINED MPI_${lang}_COMPILER) - set(_EXAMPLES_${lang}_COMPILER "${MPI_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${MPI_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() else() - set(_EXAMPLES_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE INTERNAL "${lang} compiler for installed examples") + set(_EXAMPLES_${lang}_COMPILER + "${CMAKE_${lang}_COMPILER}" + CACHE INTERNAL "${lang} compiler for installed examples") endif() endforeach() @@ -62,7 +67,9 @@ if(EXAMPLES_INSTALL) if(CXX_FOUND) set(CXX "${_EXAMPLES_CXX_COMPILER}") set(CXX_LNKR "${_EXAMPLES_CXX_COMPILER}") - set(CXXFLAGS "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}") + set(CXXFLAGS + "${CMAKE_CXX_FLAGS_RELEASE} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" + ) set(CXX_LDFLAGS "${CMAKE_CXX_FLAGS_RELEASE}") list2string(EXE_EXTRA_LINK_LIBS CXX_LIBS) endif() diff --git a/examples/arkode/CMakeLists.txt b/examples/arkode/CMakeLists.txt index defe97ed7c..bfcbe267fd 100644 --- a/examples/arkode/CMakeLists.txt +++ b/examples/arkode/CMakeLists.txt @@ -23,7 +23,9 @@ if(EXAMPLES_ENABLE_C) if(ENABLE_OPENMP AND OPENMP_FOUND) add_subdirectory(C_openmp) endif() - if(ENABLE_OPENMP_DEVICE AND OPENMP_FOUND AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) + if(ENABLE_OPENMP_DEVICE + AND OPENMP_FOUND + AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) add_subdirectory(C_openmpdev) endif() if(ENABLE_MPI AND MPI_C_FOUND) @@ -43,7 +45,10 @@ if(EXAMPLES_ENABLE_CXX) if(ENABLE_MPI AND MPI_CXX_FOUND) add_subdirectory(CXX_parallel) endif() - if(ENABLE_MPI AND MPI_CXX_FOUND AND ENABLE_HYPRE AND HYPRE_FOUND) + if(ENABLE_MPI + AND MPI_CXX_FOUND + AND ENABLE_HYPRE + AND HYPRE_FOUND) add_subdirectory(CXX_parhyp) endif() if(MPI_CXX_FOUND AND ENABLE_SUPERLUDIST) diff --git a/examples/arkode/CXX_parallel/CMakeLists.txt b/examples/arkode/CXX_parallel/CMakeLists.txt index 9e11a5cfe5..2ebc00df7e 100644 --- a/examples/arkode/CXX_parallel/CMakeLists.txt +++ b/examples/arkode/CXX_parallel/CMakeLists.txt @@ -37,8 +37,8 @@ macro(build_examples examples_to_build lang) set(example_target "${example_target}.${example_defines}") endif() - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) set_source_files_properties(${example} PROPERTIES LANGUAGE ${lang}) @@ -54,10 +54,11 @@ macro(build_examples examples_to_build lang) # libraries to link against target_include_directories(${example_target} - PRIVATE ${MPI_CXX_INCLUDE_DIRS}) + PRIVATE ${MPI_CXX_INCLUDE_DIRS}) - target_link_libraries(${example_target} - PRIVATE ${OTHER_LIBS} ${SUNDIALS_LIBS} ${MPI_CXX_LIBRARIES}) + target_link_libraries( + ${example_target} PRIVATE ${OTHER_LIBS} ${SUNDIALS_LIBS} + ${MPI_CXX_LIBRARIES}) # compile definitions if(example_defines) @@ -74,7 +75,8 @@ macro(build_examples examples_to_build lang) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -91,7 +93,7 @@ macro(build_examples examples_to_build lang) # Install example source and out files install(FILES ${example} ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parallel) endif() @@ -102,11 +104,12 @@ endmacro() # Examples to build and install # ----------------------------- -# Example lists are tuples "name\;compile defs\;args\;nodes\;tasks\;type\;float precision" -# where the type develop is for examples excluded from 'make test' in releases. +# Example lists are tuples "name\;compile defs\;args\;nodes\;tasks\;type\;float +# precision" where the type develop is for examples excluded from 'make test' in +# releases. # List of headers to install (appended to below) -set(ARKODE_headers ) +set(ARKODE_headers) # List of additional files to install (appended to below) set(ARKODE_extras) @@ -118,8 +121,7 @@ set(OTHER_LIBS ${EXE_EXTRA_LINK_LIBS}) # MPI examples # ------------ -set(serial_examples - "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default") +set(serial_examples "ark_heat2D_p.cpp\;\;--np 2 2\;1\;4\;develop\;default") set(SUNDIALS_LIBS sundials_arkode sundials_nvecparallel) build_examples(serial_examples CXX) @@ -132,11 +134,13 @@ list(APPEND ARKODE_extras plot_heat2D_p.py) if(BUILD_CVODE) set(examples_cvode - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --imex\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-arkstep\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-global\;1\;4\;exclude-single\;default" - "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-local\;1\;4\;exclude-single\;default") - set(SUNDIALS_LIBS sundials_arkode sundials_cvode sundials_nvecparallel sundials_nvecmpiplusx) + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --imex\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-arkstep\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-global\;1\;4\;exclude-single\;default" + "ark_diffusion_reaction_p.cpp\;\;--np 2 2 --mri-cvode-local\;1\;4\;exclude-single\;default" + ) + set(SUNDIALS_LIBS sundials_arkode sundials_cvode sundials_nvecparallel + sundials_nvecmpiplusx) build_examples(examples_cvode CXX) endif() @@ -144,8 +148,9 @@ endif() # RAJA Examples # ------------- -if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND - (SUNDIALS_INDEX_SIZE MATCHES "32")) +if(ENABLE_RAJA + AND (SUNDIALS_PRECISION MATCHES "DOUBLE") + AND (SUNDIALS_INDEX_SIZE MATCHES "32")) # Header files to install list(APPEND ARKODE_headers ark_brusselator1D.h) @@ -160,7 +165,8 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND endif() # If RAJA has OpenMP enabled, we have to link to OpenMP even if we dont use it - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(OTHER_LIBS OpenMP::OpenMP_CXX ${OTHER_LIBS}) endif() @@ -169,9 +175,10 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND # ------------- set(serial_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --explicit --tf 1\;1\;4\;develop\;2") + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;\;--monitor --explicit --tf 1\;1\;4\;develop\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx) build_examples(serial_raja_examples CXX) @@ -183,16 +190,18 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_CUDA) set(cuda_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDAUVM_NVEC\;--monitor\;1\;4\;exclude\;2" - "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor --global-nls\;1\;4\;develop\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDAUVM_NVEC\;--monitor\;1\;4\;exclude\;2" + "ark_brusselator1D_task_local_nls.cpp\;USE_CUDA_NVEC\;--monitor --global-nls\;1\;4\;develop\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nveccuda) build_examples(cuda_raja_examples CUDA) endif() if(BUILD_NVECTOR_RAJA AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) set(raja_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_RAJA_NVEC\;--monitor\;1\;4\;exclude\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_RAJA_NVEC\;--monitor\;1\;4\;exclude\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvecraja) build_examples(raja_raja_examples CUDA) endif() @@ -203,7 +212,8 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_HIP AND (RAJA_BACKENDS MATCHES "HIP")) set(hip_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_HIP_NVEC\;--monitor\;1\;4\;exclude\;2") + "ark_brusselator1D_task_local_nls.cpp\;USE_HIP_NVEC\;--monitor\;1\;4\;exclude\;2" + ) set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvechip) build_examples(hip_raja_examples CXX) endif() @@ -214,16 +224,18 @@ if(ENABLE_RAJA AND (SUNDIALS_PRECISION MATCHES "DOUBLE") AND if(BUILD_NVECTOR_OPENMPDEV AND (RAJA_BACKENDS MATCHES "TARGET_OPENMP")) set(openmpdev_raja_examples - "ark_brusselator1D_task_local_nls.cpp\;USE_OMPDEV_NVEC\;--monitor\;1\;4\;exclude\;2") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") - set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx sundials_nvecopenmpdev) + "ark_brusselator1D_task_local_nls.cpp\;USE_OMPDEV_NVEC\;--monitor\;1\;4\;exclude\;2" + ) + set(CMAKE_EXE_LINKER_FLAGS + "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_CXX_FLAGS}") + set(SUNDIALS_LIBS sundials_arkode sundials_nvecmpiplusx + sundials_nvecopenmpdev) build_examples(openmpdev_raja_examples CXX) endif() endif() endif() - if(EXAMPLES_INSTALL) set(examples_to_install "${serial_examples}") @@ -235,35 +247,24 @@ if(EXAMPLES_INSTALL) 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() + # 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() - 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 - ) + # if(RAJA_NEEDS_THREADS) set(EXAMPLES_FIND_PACKAGE + # "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() 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() diff --git a/examples/arkode/CXX_parhyp/CMakeLists.txt b/examples/arkode/CXX_parhyp/CMakeLists.txt index 40e7fb13d5..a56531b5e1 100644 --- a/examples/arkode/CXX_parhyp/CMakeLists.txt +++ b/examples/arkode/CXX_parhyp/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for ARKODE C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg_mri\;--np 2 2\;1\;4\;develop" - "ark_heat2D_hypre_pfmg_imex\;--np 2 2\;1\;4\;develop" - ) + "ark_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg_mri\;--np 2 2\;1\;4\;develop" + "ark_heat2D_hypre_pfmg_imex\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(ARKODE_extras - plot_heat2D_p.py - ) +set(ARKODE_extras plot_heat2D_p.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -37,7 +34,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -48,8 +44,8 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -58,8 +54,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -70,7 +66,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -83,12 +80,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -97,7 +93,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -107,39 +104,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp) # 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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/CXX_serial/CMakeLists.txt b/examples/arkode/CXX_serial/CMakeLists.txt index 24ca919088..cdd673c777 100644 --- a/examples/arkode/CXX_serial/CMakeLists.txt +++ b/examples/arkode/CXX_serial/CMakeLists.txt @@ -15,42 +15,37 @@ # CMakeLists.txt file for ARKODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_analytic_sys.cpp\;\;develop" - "ark_heat2D.cpp\;\;develop" - "ark_kpr_Mt.cpp\;0 5\;develop" - "ark_kpr_Mt.cpp\;1 4\;develop" - "ark_kpr_Mt.cpp\;2 8 0 -10\;develop" - "ark_kpr_Mt.cpp\;0 4 1\;develop" - "ark_kpr_Mt.cpp\;0 -4\;exclude-single" - "ark_kpr_Mt.cpp\;1 -5\;exclude-single" - "ark_kpr_Mt.cpp\;2 -5 0 -10\;develop" - "ark_kpr_Mt.cpp\;1 -3 0 -10 0\;exclude-single" - "ark_kpr_Mt.cpp\;0 3 0 -10 0\;develop" - "ark_kpr_Mt.cpp\;2 4 0 -10 0\;develop" - "ark_kpr_Mt.cpp\;0 4 0 -10 1 10 1\;develop" - "ark_kpr_Mt.cpp\;0 4 0 -10 0 10 1\;develop" - "ark_pendulum.cpp\;\;develop" - ) + "ark_analytic_sys.cpp\;\;develop" + "ark_heat2D.cpp\;\;develop" + "ark_kpr_Mt.cpp\;0 5\;develop" + "ark_kpr_Mt.cpp\;1 4\;develop" + "ark_kpr_Mt.cpp\;2 8 0 -10\;develop" + "ark_kpr_Mt.cpp\;0 4 1\;develop" + "ark_kpr_Mt.cpp\;0 -4\;exclude-single" + "ark_kpr_Mt.cpp\;1 -5\;exclude-single" + "ark_kpr_Mt.cpp\;2 -5 0 -10\;develop" + "ark_kpr_Mt.cpp\;1 -3 0 -10 0\;exclude-single" + "ark_kpr_Mt.cpp\;0 3 0 -10 0\;develop" + "ark_kpr_Mt.cpp\;2 4 0 -10 0\;develop" + "ark_kpr_Mt.cpp\;0 4 0 -10 1 10 1\;develop" + "ark_kpr_Mt.cpp\;0 4 0 -10 0 10 1\;develop" + "ark_pendulum.cpp\;\;develop") # Header files to install set(ARKODE_headers) if(BUILD_CVODE) - list(APPEND ARKODE_examples - "ark_advection_diffusion_reaction.cpp\;\;develop") - list(APPEND ARKODE_headers - "ark_advection_diffusion_reaction.hpp") + list(APPEND ARKODE_examples "ark_advection_diffusion_reaction.cpp\;\;develop") + list(APPEND ARKODE_headers "ark_advection_diffusion_reaction.hpp") endif() # Auxiliary files to install -set(ARKODE_extras - plot_heat2D.py - plot_sol.py) +set(ARKODE_extras plot_heat2D.py plot_sol.py) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -71,14 +66,11 @@ foreach(example_tuple ${ARKODE_examples}) # directories to include target_include_directories(${example_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/examples/utilities) + PRIVATE ${PROJECT_SOURCE_DIR}/examples/utilities) # libraries to link against - target_link_libraries(${example_target} - sundials_arkode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_arkode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) if(BUILD_CVODE) target_link_libraries(${example_target} sundials_cvode) @@ -93,7 +85,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -110,25 +103,14 @@ if(EXAMPLES_INSTALL) endif() endif() - sundials_install_examples(arkode ARKODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - MAKE_TEMPLATE - makefile_serial_CXX_ex.in - SUNDIALS_TARGETS - nvecserial - arkode - ${_include_cvode} - ${_include_cvode_stubs} - DESTINATION - arkode/CXX_serial - EXTRA_FILES - README - ${ARKODE_extras} - ${ARKODE_headers} - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - TEST_INSTALL - CXX_serial - ) + sundials_install_examples( + arkode ARKODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + MAKE_TEMPLATE makefile_serial_CXX_ex.in + SUNDIALS_TARGETS nvecserial arkode ${_include_cvode} ${_include_cvode_stubs} + DESTINATION arkode/CXX_serial + EXTRA_FILES README ${ARKODE_extras} ${ARKODE_headers} + "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + TEST_INSTALL CXX_serial) endif() diff --git a/examples/arkode/CXX_superludist/CMakeLists.txt b/examples/arkode/CXX_superludist/CMakeLists.txt index 7d92aaf9ce..b9e286c11c 100644 --- a/examples/arkode/CXX_superludist/CMakeLists.txt +++ b/examples/arkode/CXX_superludist/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for ARKODE C++ SuperLU_DIST examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases list(APPEND ARKODE_examples "ark_brusselator1D_FEM_sludist.cpp\;1\;1\;develop") # Auxiliary files to install -set(ARKODE_extras - ) +set(ARKODE_extras) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -41,17 +40,16 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - MPI::MPI_CXX - sundials_arkode - sundials_sunlinsolsuperludist) + target_link_libraries(${example_target} PRIVATE MPI::MPI_CXX sundials_arkode + sundials_sunlinsolsuperludist) endforeach(example_tuple ${ARKODE_examples}) @@ -66,18 +64,12 @@ endif() # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(arkode_superludist ARKODE_examples - EXTRA_FILES - README - ${ARKODE_extras} - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - arkode - sunlinsolsuperludist - DESTINATION - arkode/CXX_superludist - ) + sundials_install_examples( + arkode_superludist ARKODE_examples + EXTRA_FILES README ${ARKODE_extras} + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS arkode sunlinsolsuperludist + DESTINATION arkode/CXX_superludist) # add test_install target sundials_add_test_install(arkode CXX_superludist) diff --git a/examples/arkode/CXX_xbraid/CMakeLists.txt b/examples/arkode/CXX_xbraid/CMakeLists.txt index 302d0f3232..b788cf1016 100644 --- a/examples/arkode/CXX_xbraid/CMakeLists.txt +++ b/examples/arkode/CXX_xbraid/CMakeLists.txt @@ -14,25 +14,22 @@ # CMakeLists.txt file for ARKODE C++ XBraid examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_heat2D_xbraid\;--x_print_level 0\;1\;4\;develop" - "ark_heat2D_p_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" - ) + "ark_heat2D_xbraid\;--x_print_level 0\;1\;4\;develop" + "ark_heat2D_p_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop") if(ENABLE_HYPRE AND HYPRE_FOUND) set(ARKODE_examples_hypre - "ark_heat2D_hypre_pfmg_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" - ) + "ark_heat2D_hypre_pfmg_xbraid\;--np 2 1 2 --x_print_level 0\;1\;4\;develop" + ) endif() # Auxiliary files to install -set(ARKODE_extras - plot_heat2D.py - ) +set(ARKODE_extras plot_heat2D.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -40,7 +37,8 @@ set(ARKODE_XBRAID_LIB sundials_arkode_xbraid) set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries -set(SUNDIALS_LIBS ${ARKODE_LIB} ${ARKODE_XBRAID_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS ${ARKODE_LIB} ${ARKODE_XBRAID_LIB} ${NVECP_LIB} + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -52,8 +50,8 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -75,7 +73,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -88,13 +87,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endif() endforeach(example_tuple ${ARKODE_examples}) - - if(ENABLE_HYPRE AND HYPRE_FOUND) # Add the build and install targets for each example @@ -107,8 +104,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -118,8 +115,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE SUNDIALS::XBRAID) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE SUNDIALS::XBRAID) endif() @@ -131,7 +128,8 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -144,23 +142,24 @@ if(ENABLE_HYPRE AND HYPRE_FOUND) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endif() endforeach(example_tuple ${ARKODE_examples}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file - install(FILES README.md DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + install(FILES README.md + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -172,41 +171,34 @@ if(EXAMPLES_INSTALL) examples2string(ARKODE_examples_hypre EXAMPLES_HYPRE) # 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. + # 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_xbraid_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid) # 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. + # 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_xbraid_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/CXX_xbraid/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/CXX_xbraid - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) diff --git a/examples/arkode/C_manyvector/CMakeLists.txt b/examples/arkode/C_manyvector/CMakeLists.txt index 380212a16c..25ead792fd 100644 --- a/examples/arkode/C_manyvector/CMakeLists.txt +++ b/examples/arkode/C_manyvector/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for ARKODE ManyVector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_brusselator1D_manyvec\;develop" - ) +set(ARKODE_examples "ark_brusselator1D_manyvec\;develop") # Auxiliary files to install -set(ARKODE_extras - plot_brusselator1D.py - ) +set(ARKODE_extras plot_brusselator1D.py) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -47,7 +43,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,7 +55,7 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) endif() endforeach(example_tuple ${ARKODE_examples}) @@ -71,7 +68,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -81,39 +79,33 @@ if(EXAMPLES_INSTALL) 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector - ) + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/C_manyvector - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_openmp/CMakeLists.txt b/examples/arkode/C_openmp/CMakeLists.txt index 1415e70ceb..8bd1f15e44 100644 --- a/examples/arkode/C_openmp/CMakeLists.txt +++ b/examples/arkode/C_openmp/CMakeLists.txt @@ -14,20 +14,15 @@ # CMakeLists.txt file for ARKODE OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples -# "name\;args\;type\;float precision\;int precision" where the type -# is 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type\;float precision\;int precision" +# where the type is 'develop' for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_brusselator1D_omp\;4\;exclude-single\;default\;default" - "ark_heat1D_omp\;4\;develop\;default\;10" - ) +set(ARKODE_examples "ark_brusselator1D_omp\;4\;exclude-single\;default\;default" + "ark_heat1D_omp\;4\;develop\;default\;10") # Auxiliary files to install -set(ARKODE_extras_OMP - plot_brusselator1D.py - ) +set(ARKODE_extras_OMP plot_brusselator1D.py) # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -45,7 +40,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -54,20 +50,17 @@ foreach(example_tuple ${ARKODE_examples}) INTEGER_PRECISION ${example_int_precision}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecopenmp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecopenmp + ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -76,7 +69,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -86,39 +80,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/arkode/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/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. + # 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/arkode/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_openmpdev/CMakeLists.txt b/examples/arkode/C_openmpdev/CMakeLists.txt index aa1ebdd13f..9c94239a2e 100644 --- a/examples/arkode/C_openmpdev/CMakeLists.txt +++ b/examples/arkode/C_openmpdev/CMakeLists.txt @@ -14,15 +14,13 @@ # CMakeLists.txt file for ARKODE OpenMPDEV examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - "ark_analytic_nonlin_ompdev\;4\;develop" - "ark_heat1D_ompdev\;4\;develop" - "ark_heat1D_adapt_ompdev\;4\;develop" - ) + "ark_analytic_nonlin_ompdev\;4\;develop" "ark_heat1D_ompdev\;4\;develop" + "ark_heat1D_adapt_ompdev\;4\;develop") # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -45,7 +43,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -57,12 +56,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -71,7 +69,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -81,39 +80,32 @@ if(EXAMPLES_INSTALL) 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_openmpdev/CMakeLists.txt + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/C_openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_parallel/CMakeLists.txt b/examples/arkode/C_parallel/CMakeLists.txt index 1ad69580eb..7ace3f347f 100644 --- a/examples/arkode/C_parallel/CMakeLists.txt +++ b/examples/arkode/C_parallel/CMakeLists.txt @@ -14,26 +14,29 @@ # CMakeLists.txt file for ARKODE parallel C examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_diurnal_kry_p\;\;1\;4\;exclude-single\;default" - "ark_diurnal_kry_bbd_p\;\;1\;4\;exclude-single\;default" - ) +set(ARKODE_examples "ark_diurnal_kry_p\;\;1\;4\;exclude-single\;default" + "ark_diurnal_kry_bbd_p\;\;1\;4\;exclude-single\;default") -if(SUNDIALS_PRECISION MATCHES "DOUBLE" AND - SUNDIALS_INDEX_SIZE MATCHES "64") +if(SUNDIALS_PRECISION MATCHES "DOUBLE" AND SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor\;1\;4\;develop\;2") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor --global-nls\;1\;4\;develop\;2") - list(APPEND ARKODE_examples "ark_brusselator1D_task_local_nls\;--monitor --explicit --tf 3\;1\;4\;develop\;2") + list(APPEND ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor\;1\;4\;develop\;2") + list( + APPEND ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor --global-nls\;1\;4\;develop\;2" + ) + list( + APPEND + ARKODE_examples + "ark_brusselator1D_task_local_nls\;--monitor --explicit --tf 3\;1\;4\;develop\;2" + ) # Auxiliary files to install - set(ARKODE_extras - "plot_brusselator1D.py" - ) + set(ARKODE_extras "plot_brusselator1D.py") endif() if(MPI_C_COMPILER) @@ -82,7 +85,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -96,12 +100,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) endif() endforeach(example_tuple ${ARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -110,7 +113,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -120,39 +124,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/C_parhyp/CMakeLists.txt b/examples/arkode/C_parhyp/CMakeLists.txt index 546e17a814..e4d8ebfff2 100644 --- a/examples/arkode/C_parhyp/CMakeLists.txt +++ b/examples/arkode/C_parhyp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for ARKODE parhyp C examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(ARKODE_examples - "ark_diurnal_kry_ph.c\;1\;4\;develop" - ) +set(ARKODE_examples "ark_diurnal_kry_ph.c\;1\;4\;develop") # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -39,13 +37,12 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - sundials_arkode - sundials_nvecparhyp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_arkode sundials_nvecparhyp + ${EXE_EXTRA_LINK_LIBS}) # add to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -53,25 +50,16 @@ foreach(example_tuple ${ARKODE_examples}) endforeach(example_tuple ${ARKODE_examples}) - if(EXAMPLES_INSTALL) - sundials_install_examples(arkode ARKODE_examples - CMAKE_TEMPLATE - cmakelists_C_MPI_ex.in - MAKE_TEMPLATE - makefile_parhyp_C_ex.in - SOLVER_LIBRARY - sundials_arkode - SUNDIALS_TARGETS - arkode - nvecparhyp - DESTINATION - arkode/C_parhyp - EXTRA_FILES - README - TEST_INSTALL - C_parhyp - ) + sundials_install_examples( + arkode ARKODE_examples + CMAKE_TEMPLATE cmakelists_C_MPI_ex.in + MAKE_TEMPLATE makefile_parhyp_C_ex.in + SOLVER_LIBRARY sundials_arkode + SUNDIALS_TARGETS arkode nvecparhyp + DESTINATION arkode/C_parhyp + EXTRA_FILES README + TEST_INSTALL C_parhyp) endif() diff --git a/examples/arkode/C_petsc/CMakeLists.txt b/examples/arkode/C_petsc/CMakeLists.txt index e62a4d57b6..cf32c23863 100644 --- a/examples/arkode/C_petsc/CMakeLists.txt +++ b/examples/arkode/C_petsc/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for ARKODE PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers if(BUILD_SUNNONLINSOL_PETSCSNES) - set(ARKODE_examples - "ark_petsc_ex25\;1\;1\;develop" - ) + set(ARKODE_examples "ark_petsc_ex25\;1\;1\;develop") endif() if(MPI_C_COMPILER) @@ -40,7 +38,8 @@ if(BUILD_SUNNONLINSOL_PETSCSNES) endif() # set-up linker flags and link libraries -set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${SUNNLS_LIB} ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS ${ARKODE_LIB} ${NVECP_LIB} ${SUNNLS_LIB} + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${ARKODE_examples}) @@ -56,7 +55,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -72,12 +72,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) endif() endforeach(example_tuple ${ARKODE_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -90,39 +89,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_petsc - RENAME Makefile - ) + RENAME Makefile) endif() sundials_add_test_install(arkode C_petsc) diff --git a/examples/arkode/C_serial/CMakeLists.txt b/examples/arkode/C_serial/CMakeLists.txt index 5eca809665..86b7633bb4 100644 --- a/examples/arkode/C_serial/CMakeLists.txt +++ b/examples/arkode/C_serial/CMakeLists.txt @@ -15,106 +15,100 @@ # CMakeLists.txt file for ARKODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(ARKODE_examples - # tests that are always run - "ark_analytic\;\;" - # develop tests - "ark_analytic_mels\;\;develop" - "ark_analytic_nonlin\;\;develop" - "ark_brusselator_1D_mri\;\;develop" - "ark_brusselator_fp\;\;exclude-single" - "ark_brusselator_mri\;\;develop" - "ark_brusselator\;\;develop" - "ark_brusselator1D_imexmri\;0 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;2 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;3 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;4 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;5 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;6 0.001\;exclude-single" - "ark_brusselator1D_imexmri\;7 0.001\;exclude-single" - "ark_brusselator1D\;\;exclude-single" - "ark_conserved_exp_entropy_ark\;1 0\;develop" - "ark_conserved_exp_entropy_ark\;1 1\;develop" - "ark_conserved_exp_entropy_erk\;1\;develop" - "ark_damped_harmonic_symplectic\;\;exclude-single" - "ark_dissipated_exp_entropy\;1 0\;develop" - "ark_dissipated_exp_entropy\;1 1\;develop" - "ark_harmonic_symplectic\;\;exclude-single" - "ark_heat1D_adapt\;\;develop" - "ark_heat1D\;\;develop" - "ark_kepler\;--stepper ERK --step-mode adapt\;develop" - "ark_kepler\;--stepper ERK --step-mode fixed --count-orbits\;develop" - "ark_kepler\;--stepper SPRK --step-mode fixed --count-orbits --use-compensated-sums\;develop" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_EULER_1_1 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_3_3 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_4_4 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_5_6 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_RUTH_3_3 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_YOSHIDA_6_8 --tf 50 --check-order --nout 1\;exclude-single" - "ark_kepler\;\;develop" - "ark_kpr_mri\;\;develop" - "ark_kpr_mri\;0 0.002\;develop" - "ark_kpr_mri\;1 0.002\;develop" - "ark_kpr_mri\;2 0.005\;develop" - "ark_kpr_mri\;3 0.01\;develop" - "ark_kpr_mri\;4 0.002\;develop" - "ark_kpr_mri\;5 0.002\;develop" - "ark_kpr_mri\;6 0.005\;develop" - "ark_kpr_mri\;7 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;7 0.001\;exclude-single" - "ark_kpr_mri\;8 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;8 0.001\;exclude-single" - "ark_kpr_mri\;9 0.001 -100 100 0.5 1\;exclude-single" - "ark_kpr_mri\;9 0.001\;exclude-single" - "ark_KrylovDemo_prec\;\;exclude-single" - "ark_KrylovDemo_prec\;1\;exclude-single" - "ark_KrylovDemo_prec\;2\;exclude-single" - "ark_onewaycouple_mri\;\;develop" - "ark_reaction_diffusion_mri\;\;develop" - "ark_robertson_constraints\;\;exclude-single" - "ark_robertson_root\;\;exclude-single" - "ark_robertson\;\;exclude-single" - "ark_twowaycouple_mri\;\;develop" - ) + # tests that are always run + "ark_analytic\;\;" + # develop tests + "ark_analytic_mels\;\;develop" + "ark_analytic_nonlin\;\;develop" + "ark_brusselator_1D_mri\;\;develop" + "ark_brusselator_fp\;\;exclude-single" + "ark_brusselator_mri\;\;develop" + "ark_brusselator\;\;develop" + "ark_brusselator1D_imexmri\;0 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;2 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;3 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;4 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;5 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;6 0.001\;exclude-single" + "ark_brusselator1D_imexmri\;7 0.001\;exclude-single" + "ark_brusselator1D\;\;exclude-single" + "ark_conserved_exp_entropy_ark\;1 0\;develop" + "ark_conserved_exp_entropy_ark\;1 1\;develop" + "ark_conserved_exp_entropy_erk\;1\;develop" + "ark_damped_harmonic_symplectic\;\;exclude-single" + "ark_dissipated_exp_entropy\;1 0\;develop" + "ark_dissipated_exp_entropy\;1 1\;develop" + "ark_harmonic_symplectic\;\;exclude-single" + "ark_heat1D_adapt\;\;develop" + "ark_heat1D\;\;develop" + "ark_kepler\;--stepper ERK --step-mode adapt\;develop" + "ark_kepler\;--stepper ERK --step-mode fixed --count-orbits\;develop" + "ark_kepler\;--stepper SPRK --step-mode fixed --count-orbits --use-compensated-sums\;develop" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_EULER_1_1 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_3_3 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_4_4 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_MCLACHLAN_5_6 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_PSEUDO_LEAPFROG_2_2 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_RUTH_3_3 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;--stepper SPRK --step-mode fixed --method ARKODE_SPRK_YOSHIDA_6_8 --tf 50 --check-order --nout 1\;exclude-single" + "ark_kepler\;\;develop" + "ark_kpr_mri\;\;develop" + "ark_kpr_mri\;0 0.002\;develop" + "ark_kpr_mri\;1 0.002\;develop" + "ark_kpr_mri\;2 0.005\;develop" + "ark_kpr_mri\;3 0.01\;develop" + "ark_kpr_mri\;4 0.002\;develop" + "ark_kpr_mri\;5 0.002\;develop" + "ark_kpr_mri\;6 0.005\;develop" + "ark_kpr_mri\;7 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;7 0.001\;exclude-single" + "ark_kpr_mri\;8 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;8 0.001\;exclude-single" + "ark_kpr_mri\;9 0.001 -100 100 0.5 1\;exclude-single" + "ark_kpr_mri\;9 0.001\;exclude-single" + "ark_KrylovDemo_prec\;\;exclude-single" + "ark_KrylovDemo_prec\;1\;exclude-single" + "ark_KrylovDemo_prec\;2\;exclude-single" + "ark_onewaycouple_mri\;\;develop" + "ark_reaction_diffusion_mri\;\;develop" + "ark_robertson_constraints\;\;exclude-single" + "ark_robertson_root\;\;exclude-single" + "ark_robertson\;\;exclude-single" + "ark_twowaycouple_mri\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND ARKODE_examples "ark_brusselator_fp\;1\;exclude-single") endif() # Examples using KLU linear solver -set(ARKODE_examples_KLU - "ark_brusselator1D_klu\;develop" - ) +set(ARKODE_examples_KLU "ark_brusselator1D_klu\;develop") # Examples using SuperLU_MT linear solver -set(ARKODE_examples_SUPERLUMT - "ark_brusselator1D_FEM_slu\;exclude-single" - ) +set(ARKODE_examples_SUPERLUMT "ark_brusselator1D_FEM_slu\;exclude-single") # Auxiliary files to install set(ARKODE_extras - ark_analytic_nonlin_stats.csv - ark_damped_harmonic_symplectic.h - ark_harmonic_symplectic.h - ark_kepler_plot.py - ark_kepler.h - ark_reaction_diffusion_mri_fast_stats.csv - ark_reaction_diffusion_mri_slow_stats.csv - ark_robertson_stats.csv - plot_brusselator1D_FEM.py - plot_brusselator1D.py - plot_heat1D_adapt.py - plot_heat1D.py - plot_sol_log.py - plot_sol.py - ) + ark_analytic_nonlin_stats.csv + ark_damped_harmonic_symplectic.h + ark_harmonic_symplectic.h + ark_kepler_plot.py + ark_kepler.h + ark_reaction_diffusion_mri_fast_stats.csv + ark_reaction_diffusion_mri_slow_stats.csv + ark_robertson_stats.csv + plot_brusselator1D_FEM.py + plot_brusselator1D.py + plot_heat1D_adapt.py + plot_heat1D.py + plot_sol_log.py + plot_sol.py) # Add the build and install targets for each ARKODE example foreach(example_tuple ${ARKODE_examples}) @@ -124,7 +118,7 @@ foreach(example_tuple ${ARKODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -132,10 +126,8 @@ foreach(example_tuple ${ARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -146,7 +138,8 @@ foreach(example_tuple ${ARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -155,12 +148,11 @@ foreach(example_tuple ${ARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples}) - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -176,29 +168,26 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - sundials_sunlinsolklu - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + sundials_sunlinsolklu ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -214,29 +203,26 @@ if(BUILD_SUNLINSOL_SUPERLUMT) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} - sundials_arkode - sundials_nvecserial - sundials_sunlinsolsuperlumt - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_arkode sundials_nvecserial + sundials_sunlinsolsuperlumt ${EXE_EXTRA_LINK_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endif() endforeach(example_tuple ${ARKODE_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -245,7 +231,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial) endforeach(extrafile ${ARKODE_extras}) # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -262,7 +249,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(ARKODE_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -273,39 +260,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_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. + # 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_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/C_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/C_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_custom/CMakeLists.txt b/examples/arkode/F2003_custom/CMakeLists.txt index 98abe2d887..e2392396bc 100644 --- a/examples/arkode/F2003_custom/CMakeLists.txt +++ b/examples/arkode/F2003_custom/CMakeLists.txt @@ -14,33 +14,25 @@ # CMakeLists.txt file for the ARKode F2003 custom module examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - set(FARKODE_examples - "ark_brusselator1D_f2003\;develop" - "ark_analytic_complex_f2003\;develop" - ) + set(FARKODE_examples "ark_brusselator1D_f2003\;develop" + "ark_analytic_complex_f2003\;develop") set(FARKODE_tests - "test_fnvector_complex_mod\;develop" - "test_fnvector_fortran_mod\;develop" - "test_fsunmatrix_fortran_mod\;develop" - "test_fsunlinsol_fortran_mod\;develop" - ) + "test_fnvector_complex_mod\;develop" "test_fnvector_fortran_mod\;develop" + "test_fsunmatrix_fortran_mod\;develop" + "test_fsunlinsol_fortran_mod\;develop") endif() # note the order matters when auto-generating the installed Makefile -set(FARKODEsources - fnvector_complex_mod.f90 - fnvector_fortran_mod.f90 - fsunmatrix_fortran_mod.f90 - fsunlinsol_fortran_mod.f90 - ) +set(FARKODEsources fnvector_complex_mod.f90 fnvector_fortran_mod.f90 + fsunmatrix_fortran_mod.f90 fsunlinsol_fortran_mod.f90) # Specify libraries to link against set(ARKODE_LIB sundials_arkode) @@ -57,7 +49,8 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90 ${FARKODEsources}) @@ -65,7 +58,8 @@ foreach(example_tuple ${FARKODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -73,10 +67,10 @@ foreach(example_tuple ${FARKODE_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out ${FARKODEsources} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endif() endforeach(example_tuple ${FARKODE_examples}) @@ -89,7 +83,8 @@ foreach(example_tuple ${FARKODE_tests}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90 ${FARKODEsources}) @@ -97,7 +92,8 @@ foreach(example_tuple ${FARKODE_tests}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS "" EXAMPLE_TYPE ${example_type} NODIFF) @@ -108,18 +104,18 @@ foreach(example_tuple ${FARKODE_tests}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${FARKODEsources} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endif() endforeach(example_tuple ${FARKODE_tests}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -135,25 +131,22 @@ if(EXAMPLES_INSTALL) examples2string(FARKODEsources EXAMPLES_DEPENDENCIES) # 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom) # 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. + # building the examples. This makefile can then be used as a template for the + # user's own programs. if(UNIX) # remove file extensions from dependencies for generated Makefile @@ -162,15 +155,12 @@ if(EXAMPLES_INSTALL) # generate Makefile and place it in the binary dir configure_file( ${PROJECT_SOURCE_DIR}/examples/templates/makefile_serial_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_custom/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_custom - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_parallel/CMakeLists.txt b/examples/arkode/F2003_parallel/CMakeLists.txt index 63c87909cf..e8065f43c8 100644 --- a/examples/arkode/F2003_parallel/CMakeLists.txt +++ b/examples/arkode/F2003_parallel/CMakeLists.txt @@ -15,31 +15,31 @@ # CMakeLists.txt file for the ARKode F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases set(FARKODE_examples - "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" - "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --global-nls\;1\;4\;develop\;2" + "ark_brusselator1D_task_local_nls_f2003\;--monitor --explicit --tf 3\;1\;4\;develop\;2" ) if(SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND FARKODE_examples - "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" - "ark_diag_non_f2003\;\;1\;4\;develop\;2" - "ark_heat2D_f2003\;\;1\;4\;develop\;2") + list(APPEND FARKODE_examples "ark_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "ark_diag_non_f2003\;\;1\;4\;develop\;2" + "ark_heat2D_f2003\;\;1\;4\;develop\;2") endif() # Set-up linker flags and link libraries -set(SUNDIALS_LIBS sundials_arkode - sundials_farkode_mod - sundials_nvecparallel - sundials_fnvecparallel_mod - sundials_nvecmpiplusx - sundials_fnvecmpiplusx_mod - sundials_nvecmpimanyvector - sundials_fnvecmpimanyvector_mod - ${EXE_EXTRA_LINK_LIBS}) +set(SUNDIALS_LIBS + sundials_arkode + sundials_farkode_mod + sundials_nvecparallel + sundials_fnvecparallel_mod + sundials_nvecmpiplusx + sundials_fnvecmpiplusx_mod + sundials_nvecmpimanyvector + sundials_fnvecmpimanyvector_mod + ${EXE_EXTRA_LINK_LIBS}) # Add the build and install targets for each example foreach(example_tuple ${FARKODE_examples}) @@ -54,7 +54,8 @@ foreach(example_tuple ${FARKODE_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -73,7 +74,8 @@ foreach(example_tuple ${FARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -87,19 +89,18 @@ foreach(example_tuple ${FARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) endif() endforeach(example_tuple ${FARKODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -107,60 +108,55 @@ if(EXAMPLES_INSTALL) # 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) + 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 separted string - list(TRANSFORM EXAMPLE_LIBS_LIST REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel - ) + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/arkode/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/arkode/F2003_serial/CMakeLists.txt b/examples/arkode/F2003_serial/CMakeLists.txt index f755a4695b..bac936e149 100644 --- a/examples/arkode/F2003_serial/CMakeLists.txt +++ b/examples/arkode/F2003_serial/CMakeLists.txt @@ -15,22 +15,20 @@ # CMakeLists.txt file for the ARKode F2003 module serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases -set(FARKODE_examples - "ark_analytic_f2003\;\;develop" -) +set(FARKODE_examples "ark_analytic_f2003\;\;develop") # Regression tests -set(FARKODE_tests - "test_ark_butcher_f2003\;develop" -) +set(FARKODE_tests "test_ark_butcher_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FARKODE_examples + list( + APPEND + FARKODE_examples "ark_bruss_f2003\;\;develop" "ark_diurnal_kry_bp_f2003\;\;develop" "ark_roberts_dns_f2003\;\;develop" @@ -44,16 +42,11 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") "ark_kpr_mri_f2003\;6 0.005\;develop" "ark_kpr_mri_f2003\;7 0.001\;develop" "ark_kpr_mri_f2003\;8 0.001\;develop" - "ark_kpr_mri_f2003\;9 0.001\;develop" - ) + "ark_kpr_mri_f2003\;9 0.001\;develop") - set(FARKODE_examples_KLU - "ark_bruss1D_FEM_klu_f2003\;develop" - ) + set(FARKODE_examples_KLU "ark_bruss1D_FEM_klu_f2003\;develop") - set(FARKODE_examples_LAPACK - "ark_roberts_dnsL_f2003\;\;develop" - ) + set(FARKODE_examples_LAPACK "ark_roberts_dnsL_f2003\;\;develop") endif() @@ -72,9 +65,10 @@ foreach(example_tuple ${FARKODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -94,7 +88,8 @@ foreach(example_tuple ${FARKODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -103,18 +98,15 @@ foreach(example_tuple ${FARKODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples}) - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) # Sundials KLU linear solver module - set(SUNLINSOLKLU_LIBS - sundials_sunlinsolklu - sundials_fsunlinsolklu_mod) + set(SUNLINSOLKLU_LIBS sundials_sunlinsolklu sundials_fsunlinsolklu_mod) # KLU libraries list(APPEND SUNLINSOLKLU_LIBS) @@ -126,14 +118,16 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # create the cmake executable target add_executable(${example} ${example}.f90) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -144,21 +138,19 @@ if(BUILD_SUNLINSOL_KLU) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples_KLU}) endif() - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -170,7 +162,8 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_type) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -178,7 +171,8 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -186,17 +180,16 @@ if(BUILD_SUNLINSOL_LAPACKDENSE) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_examples_LAPACK}) endif() - # Add the build and install targets for regression test foreach(example_tuple ${FARKODE_tests}) @@ -205,7 +198,8 @@ foreach(example_tuple ${FARKODE_tests}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -213,7 +207,8 @@ foreach(example_tuple ${FARKODE_tests}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS "" EXAMPLE_TYPE ${example_type} NODIFF) @@ -224,18 +219,18 @@ foreach(example_tuple ${FARKODE_tests}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endif() endforeach(example_tuple ${FARKODE_tests}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${ARKODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -248,39 +243,33 @@ if(EXAMPLES_INSTALL) set(EXAMPLES "${EXAMPLES} ${TESTFILES}") # 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/arkode/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/arkode/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/CMakeLists.txt b/examples/cvode/CMakeLists.txt index eab3a925e9..a7e76cef55 100644 --- a/examples/cvode/CMakeLists.txt +++ b/examples/cvode/CMakeLists.txt @@ -21,7 +21,9 @@ if(EXAMPLES_ENABLE_C) if(ENABLE_OPENMP AND OPENMP_FOUND) add_subdirectory(C_openmp) endif() - if(ENABLE_OPENMP_DEVICE AND OPENMP_FOUND AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) + if(ENABLE_OPENMP_DEVICE + AND OPENMP_FOUND + AND OPENMP_SUPPORTS_DEVICE_OFFLOADING) add_subdirectory(C_openmpdev) endif() if(ENABLE_MPI AND MPI_C_FOUND) diff --git a/examples/cvode/CXX_onemkl/CMakeLists.txt b/examples/cvode/CXX_onemkl/CMakeLists.txt index db3d93f5c5..b586e70b06 100644 --- a/examples/cvode/CXX_onemkl/CMakeLists.txt +++ b/examples/cvode/CXX_onemkl/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -set(CVODE_examples - "cvRoberts_blockdiag_onemkl.cpp\;\;develop" -) +set(CVODE_examples "cvRoberts_blockdiag_onemkl.cpp\;\;develop") # Add the build targets for each CVODE example foreach(example_tuple ${CVODE_examples}) @@ -30,7 +28,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -39,14 +37,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecsycl - sundials_sunlinsolonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_nvecsycl sundials_sunlinsolonemkldense + MKL::MKL_DPCPP ${EXE_EXTRA_LINK_LIBS}) endif() @@ -58,7 +52,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -69,17 +64,11 @@ endforeach() # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecsycl - sunlinsolonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - cvode/CXX_onemkl - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS cvode nvecsycl sunlinsolonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION cvode/CXX_onemkl) endif() diff --git a/examples/cvode/CXX_parallel/CMakeLists.txt b/examples/cvode/CXX_parallel/CMakeLists.txt index e325cd6d37..59c3419283 100644 --- a/examples/cvode/CXX_parallel/CMakeLists.txt +++ b/examples/cvode/CXX_parallel/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for CVODE C++ parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D_p\;--np 2 2\;1\;4\;develop" - ) +set(CVODE_examples "cv_heat2D_p\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(CVODE_extras - plot_heat2D_p.py - ) +set(CVODE_extras plot_heat2D_p.py) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -48,8 +44,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -69,7 +65,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -82,12 +79,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -96,7 +92,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -109,39 +106,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_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. + # 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_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parallel - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) # add test_install target diff --git a/examples/cvode/CXX_parhyp/CMakeLists.txt b/examples/cvode/CXX_parhyp/CMakeLists.txt index cef160eeee..5c18f590d1 100644 --- a/examples/cvode/CXX_parhyp/CMakeLists.txt +++ b/examples/cvode/CXX_parhyp/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for CVODE C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" - "cv_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - ) +set(CVODE_examples "cv_heat2D_hypre_ls\;--np 2 2\;1\;4\;develop" + "cv_heat2D_hypre_pfmg\;--np 2 2\;1\;4\;develop") # Auxiliary files to install -set(CVODE_extras - plot_heat2D_p.py - ) +set(CVODE_extras plot_heat2D_p.py) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -49,8 +45,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -59,8 +55,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -71,7 +67,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -84,12 +81,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -98,7 +94,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -111,39 +108,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp) # 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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif(UNIX) # add test_install target diff --git a/examples/cvode/CXX_serial/CMakeLists.txt b/examples/cvode/CXX_serial/CMakeLists.txt index 428b5909fa..d48dd57cec 100644 --- a/examples/cvode/CXX_serial/CMakeLists.txt +++ b/examples/cvode/CXX_serial/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for CVODE C++ serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_heat2D.cpp\;\;\;\;exclude-single" - "cv_kpr.cpp\;\;\;\;develop" - ) +set(CVODE_examples "cv_heat2D.cpp\;\;\;\;exclude-single" + "cv_kpr.cpp\;\;\;\;develop") # Add the build and install targets for each example foreach(example_tuple ${CVODE_examples}) @@ -36,8 +34,8 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -47,19 +45,14 @@ foreach(example_tuple ${CVODE_examples}) # directories to include target_include_directories(${example_target} - PRIVATE - ${PROJECT_SOURCE_DIR}/examples/utilities - ) + PRIVATE ${PROJECT_SOURCE_DIR}/examples/utilities) # libraries to link against - target_link_libraries(${example_target} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example_target} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) - target_link_libraries(${example_target} - sundials_cvode_fused_stubs) + target_link_libraries(${example_target} sundials_cvode_fused_stubs) endif() endif() @@ -71,7 +64,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -79,7 +73,6 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -87,23 +80,14 @@ if(EXAMPLES_INSTALL) set(_fused_stubs cvode_fused_stubs) endif() - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - MAKE_TEMPLATE - makefile_serial_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecserial - ${_fused_stubs} - DESTINATION - cvode/CXX_serial - EXTRA_FILES - README - plot_heat2D.py - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - TEST_INSTALL - CXX_serial - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + MAKE_TEMPLATE makefile_serial_CXX_ex.in + SUNDIALS_TARGETS cvode nvecserial ${_fused_stubs} + DESTINATION cvode/CXX_serial + EXTRA_FILES README plot_heat2D.py + "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + TEST_INSTALL CXX_serial) endif(EXAMPLES_INSTALL) diff --git a/examples/cvode/CXX_sycl/CMakeLists.txt b/examples/cvode/CXX_sycl/CMakeLists.txt index 67969b8d4d..35fcd18d2a 100644 --- a/examples/cvode/CXX_sycl/CMakeLists.txt +++ b/examples/cvode/CXX_sycl/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE SYCL examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_sycl.cpp\;\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_sycl.cpp\;\;develop") # Add the build and install targets for each CVODE example foreach(example_tuple ${CVODE_examples}) @@ -33,7 +31,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -42,11 +40,9 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_cvode - sundials_nvecsycl - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecsycl + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -58,7 +54,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -66,17 +63,13 @@ foreach(example_tuple ${CVODE_examples}) endforeach() - # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - cvode - nvecsycl - DESTINATION - cvode/CXX_sycl) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS cvode nvecsycl + DESTINATION cvode/CXX_sycl) endif() diff --git a/examples/cvode/C_mpimanyvector/CMakeLists.txt b/examples/cvode/C_mpimanyvector/CMakeLists.txt index 6ec51d724e..4a2feaf182 100644 --- a/examples/cvode/C_mpimanyvector/CMakeLists.txt +++ b/examples/cvode/C_mpimanyvector/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE MPIManyVector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvDiurnal_kry_mpimanyvec\;2\;4\;develop" - ) +set(CVODE_examples "cvDiurnal_kry_mpimanyvec\;2\;4\;develop") if(MPI_C_COMPILER) set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) @@ -54,7 +52,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -70,17 +69,17 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the README file - install(FILES README DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) + install(FILES README + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) # Prepare substitution variables for Makefile and/or CMakeLists templates set(SOLVER "CVODE") @@ -92,39 +91,33 @@ if(EXAMPLES_INSTALL) 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_mpimanyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_mpimanyvector - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/C_openmp/CMakeLists.txt b/examples/cvode/C_openmp/CMakeLists.txt index 88e1093b79..004dc50ffe 100644 --- a/examples/cvode/C_openmp/CMakeLists.txt +++ b/examples/cvode/C_openmp/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for CVODE OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_bnd_omp\;4\;develop" - #"cvAdvDiffReac_kry_omp\;4\;develop" - ) +set(CVODE_examples "cvAdvDiff_bnd_omp\;4\;develop" + # "cvAdvDiffReac_kry_omp\;4\;develop" +) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -48,7 +47,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -60,12 +60,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -82,39 +81,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/cvode/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/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. + # 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/cvode/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/C_openmpdev/CMakeLists.txt b/examples/cvode/C_openmpdev/CMakeLists.txt index 3899750ae4..78bd030836 100644 --- a/examples/cvode/C_openmpdev/CMakeLists.txt +++ b/examples/cvode/C_openmpdev/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE OpenMPDEV examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_ompdev\;4\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_ompdev\;4\;develop") # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -47,7 +45,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -59,12 +58,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -81,39 +79,32 @@ if(EXAMPLES_INSTALL) 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/C_openmpdev/CMakeLists.txt + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/cvode/C_openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/F2003_parallel/CMakeLists.txt b/examples/cvode/F2003_parallel/CMakeLists.txt index e686e97fa3..997a83cbc1 100644 --- a/examples/cvode/F2003_parallel/CMakeLists.txt +++ b/examples/cvode/F2003_parallel/CMakeLists.txt @@ -15,21 +15,18 @@ # CMakeLists.txt file for the CVode F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") set(FCVODE_examples - "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" - "cv_diag_kry_f2003\;\;1\;4\;develop\;2" - "cv_diag_non_p_f2003\;\;1\;4\;develop\;2") + "cv_diag_kry_bbd_f2003\;\;1\;4\;develop\;2" + "cv_diag_kry_f2003\;\;1\;4\;develop\;2" + "cv_diag_non_p_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(CVODE_LIBS - sundials_cvode - sundials_fcvode_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(CVODE_LIBS sundials_cvode sundials_fcvode_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${CVODE_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -47,7 +44,8 @@ foreach(example_tuple ${FCVODE_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -66,7 +64,8 @@ foreach(example_tuple ${FCVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -80,19 +79,18 @@ foreach(example_tuple ${FCVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) endif() endforeach(example_tuple ${FCVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -103,45 +101,39 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM CVODE_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) list2string(EXAMPLES_CMAKE_TARGETS_tmp EXAMPLES_CMAKE_TARGETS) examples2string(FCVODE_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. + # 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/cvode/F2003_parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/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. + # 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/cvode/F2003_parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/F2003_serial/CMakeLists.txt b/examples/cvode/F2003_serial/CMakeLists.txt index 1a0458a11e..28d3e9db36 100644 --- a/examples/cvode/F2003_serial/CMakeLists.txt +++ b/examples/cvode/F2003_serial/CMakeLists.txt @@ -15,18 +15,18 @@ # CMakeLists.txt file for the FCVODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(FCVODE_examples - "cv_advdiff_bnd_f2003\;develop" - ) +set(FCVODE_examples "cv_advdiff_bnd_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FCVODE_examples + list( + APPEND + FCVODE_examples "cv_analytic_fp_f2003\;develop" "cv_analytic_sys_dns_f2003\;develop" "cv_analytic_sys_dns_jac_f2003\;develop" @@ -34,18 +34,13 @@ if(SUNDIALS_INDEX_SIZE MATCHES "64") "cv_diurnal_kry_f2003\;develop" "cv_diurnal_kry_bp_f2003\;develop" "cv_roberts_dns_constraints_f2003\;develop" - "cv_roberts_dns_f2003\;develop" - ) + "cv_roberts_dns_f2003\;develop") - set(FCVODE_examples_LAPACK - "cv_roberts_dnsL_f2003\;develop" - ) + set(FCVODE_examples_LAPACK "cv_roberts_dnsL_f2003\;develop") # Examples using KLU linear solver - set(FCVODE_examples_KLU - "cv_analytic_sys_klu_f2003\;develop" - "cv_roberts_klu_f2003\;develop" - ) + set(FCVODE_examples_KLU "cv_analytic_sys_klu_f2003\;develop" + "cv_roberts_klu_f2003\;develop") endif() @@ -67,7 +62,8 @@ foreach(example_tuple ${FCVODE_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -75,7 +71,8 @@ foreach(example_tuple ${FCVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -83,10 +80,10 @@ foreach(example_tuple ${FCVODE_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples}) @@ -103,7 +100,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -111,7 +109,8 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -119,10 +118,10 @@ if(BUILD_SUNLINSOL_KLU) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLKLU_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples_KLU}) @@ -133,9 +132,8 @@ endif() if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackdense + sundials_fsunlinsollapackdense_mod) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -152,7 +150,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -160,10 +159,10 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS} ${SUNLINSOLLAPACK_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial) endif() endforeach(example_tuple ${FCVODE_examples_LAPACK}) @@ -194,39 +193,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/cuda/CMakeLists.txt b/examples/cvode/cuda/CMakeLists.txt index ecf39d378f..aeb2587f14 100644 --- a/examples/cvode/cuda/CMakeLists.txt +++ b/examples/cvode/cuda/CMakeLists.txt @@ -16,22 +16,17 @@ # CMakeLists.txt file for CVODE CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_kry_cuda\;\;develop" - "cvAdvDiff_kry_cuda_managed\;\;develop" - "cvAdvDiff_diag_cuda\;0 0\;develop" - "cvAdvDiff_diag_cuda\;0 1\;develop" - "cvAdvDiff_diag_cuda\;1 1\;develop" - ) + "cvAdvDiff_kry_cuda\;\;develop" "cvAdvDiff_kry_cuda_managed\;\;develop" + "cvAdvDiff_diag_cuda\;0 0\;develop" "cvAdvDiff_diag_cuda\;0 1\;develop" + "cvAdvDiff_diag_cuda\;1 1\;develop") # Examples using cuSolverSP linear solvers -set(CVODE_examples_cusolver - "cvRoberts_block_cusolversp_batchqr\;\;develop" -) +set(CVODE_examples_cusolver "cvRoberts_block_cusolversp_batchqr\;\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "32") set(all_examples "${CVODE_examples_cusolver}") @@ -42,9 +37,7 @@ endif() list(APPEND all_examples "${CVODE_examples}") # Specify libraries to link against -set(SUNDIALS_LIBS ${SUNDIALS_LIBS} - sundials_cvode - sundials_nveccuda) +set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode sundials_nveccuda) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode_fused_cuda) @@ -61,9 +54,10 @@ foreach(example_tuple ${all_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) - if (NOT TARGET ${example}) + if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) @@ -71,7 +65,8 @@ foreach(example_tuple ${all_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -82,7 +77,8 @@ foreach(example_tuple ${all_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -91,11 +87,10 @@ foreach(example_tuple ${all_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -119,39 +114,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/cuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/ginkgo/CMakeLists.txt b/examples/cvode/ginkgo/CMakeLists.txt index 5d1e706371..adaebb7b0c 100644 --- a/examples/cvode/ginkgo/CMakeLists.txt +++ b/examples/cvode/ginkgo/CMakeLists.txt @@ -15,18 +15,18 @@ # Example lists are tuples "name\;args\;type" # Examples that support CPU and GPU Ginkgo backends -set(cpu_gpu_examples - "cv_heat2D_ginkgo.cpp\;\;develop") +set(cpu_gpu_examples "cv_heat2D_ginkgo.cpp\;\;develop") -sundials_add_examples_ginkgo(cpu_gpu_examples +sundials_add_examples_ginkgo( + cpu_gpu_examples TARGETS sundials_cvode BACKENDS REF OMP CUDA HIP SYCL) # Examples that only support CPU Ginkgo backends -set(cpu_examples - "cv_kpr_ginkgo.cpp\;\;develop") +set(cpu_examples "cv_kpr_ginkgo.cpp\;\;develop") -sundials_add_examples_ginkgo(cpu_examples +sundials_add_examples_ginkgo( + cpu_examples TARGETS sundials_cvode BACKENDS REF OMP) @@ -42,25 +42,18 @@ if(EXAMPLES_INSTALL) if(SUNDIALS_GINKGO_BACKENDS MATCHES "SYCL") list(APPEND vectors nvecsycl) endif() - if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR - (SUNDIALS_GINKGO_BACKENDS MATCHES "REF")) + if((SUNDIALS_GINKGO_BACKENDS MATCHES "OMP") OR (SUNDIALS_GINKGO_BACKENDS + MATCHES "REF")) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(cvode - CPU_EXAMPLES_VAR - cpu_examples - CPU_GPU_EXAMPLES_VAR - cpu_gpu_examples - SUNDIALS_COMPONENTS - cvode - ${vectors} - SUNDIALS_TARGETS - cvode - EXTRA_FILES - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - DESTINATION - cvode/ginkgo - ) + sundials_install_examples_ginkgo( + cvode + CPU_EXAMPLES_VAR cpu_examples + CPU_GPU_EXAMPLES_VAR cpu_gpu_examples + SUNDIALS_COMPONENTS cvode ${vectors} + SUNDIALS_TARGETS cvode + EXTRA_FILES "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + DESTINATION cvode/ginkgo) endif() diff --git a/examples/cvode/hip/CMakeLists.txt b/examples/cvode/hip/CMakeLists.txt index 8de1bb3721..18427801b1 100644 --- a/examples/cvode/hip/CMakeLists.txt +++ b/examples/cvode/hip/CMakeLists.txt @@ -14,21 +14,17 @@ # CMakeLists.txt file for CVODE HIP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(all_examples - "cvAdvDiff_kry_hip.cpp\;\;develop" - "cvAdvDiff_diag_hip.cpp\;0 0\;develop" - "cvAdvDiff_diag_hip.cpp\;0 1\;develop" - "cvAdvDiff_diag_hip.cpp\;1 1\;develop" - ) + "cvAdvDiff_kry_hip.cpp\;\;develop" "cvAdvDiff_diag_hip.cpp\;0 0\;develop" + "cvAdvDiff_diag_hip.cpp\;0 1\;develop" + "cvAdvDiff_diag_hip.cpp\;1 1\;develop") # Specify libraries to link against -set(SUNDIALS_LIBS - sundials_cvode - sundials_nvechip) +set(SUNDIALS_LIBS sundials_cvode sundials_nvechip) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(SUNDIALS_LIBS ${SUNDIALS_LIBS} sundials_cvode_fused_hip) @@ -48,7 +44,7 @@ foreach(example_tuple ${all_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -56,7 +52,9 @@ foreach(example_tuple ${all_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE hip::device ${SUNDIALS_LIBS} ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE hip::device ${SUNDIALS_LIBS} + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -67,31 +65,27 @@ foreach(example_tuple ${all_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${all_examples}) - # Install the targets if(EXAMPLES_INSTALL) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_kernels_if_enabled cvode_fused_hip) else() - set(_fused_kernels_if_enabled ) + set(_fused_kernels_if_enabled) endif() - sundials_install_examples(cvode all_examples - CMAKE_TEMPLATE - cmakelists_HIP_ex.in - SUNDIALS_TARGETS - cvode - nvechip - ${_fused_kernels_if_enabled} - DESTINATION - cvode/hip) + sundials_install_examples( + cvode all_examples + CMAKE_TEMPLATE cmakelists_HIP_ex.in + SUNDIALS_TARGETS cvode nvechip ${_fused_kernels_if_enabled} + DESTINATION cvode/hip) endif() diff --git a/examples/cvode/kokkos/CMakeLists.txt b/examples/cvode/kokkos/CMakeLists.txt index c5c1cd4d19..533d3bf630 100644 --- a/examples/cvode/kokkos/CMakeLists.txt +++ b/examples/cvode/kokkos/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(examples_list - "cv_bruss_batched_kokkos.cpp\;\;develop" - "cv_bruss_batched_kokkos_2D.cpp\;\;develop" -) +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases +set(examples_list "cv_bruss_batched_kokkos.cpp\;\;develop" + "cv_bruss_batched_kokkos_2D.cpp\;\;develop") # Add the build targets for each example foreach(example_tuple ${examples_list}) @@ -32,7 +30,7 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -44,23 +42,19 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # directories to include - target_include_directories(${example_target} - PRIVATE - "${PROJECT_SOURCE_DIR}/examples/utilities") + target_include_directories( + ${example_target} PRIVATE "${PROJECT_SOURCE_DIR}/examples/utilities") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nveckokkos - sundials_sunmatrixkokkosdense - sundials_sunlinsolkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_nveckokkos + sundials_sunmatrixkokkosdense sundials_sunlinsolkokkosdense + ${EXE_EXTRA_LINK_LIBS}) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) - target_link_libraries(${example_target} PRIVATE - sundials_cvode_fused_stubs) + target_link_libraries(${example_target} + PRIVATE sundials_cvode_fused_stubs) endif() endif() @@ -72,7 +66,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXTRA_ARGS --kokkos-disable-warnings ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -89,22 +84,12 @@ if(EXAMPLES_INSTALL) set(_fused_stubs cvode_fused_stubs) endif() - sundials_install_examples(cvode examples_list - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - sunlinsolkokkosdense - SUNDIALS_TARGETS - cvode - ${_fused_stubs} - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - EXTRA_FILES - "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" - DESTINATION - cvode/kokkos - ) + sundials_install_examples( + cvode examples_list + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense sunlinsolkokkosdense + SUNDIALS_TARGETS cvode ${_fused_stubs} + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + EXTRA_FILES "${PROJECT_SOURCE_DIR}/examples/utilities/example_utilities.hpp" + DESTINATION cvode/kokkos) endif() diff --git a/examples/cvode/magma/CMakeLists.txt b/examples/cvode/magma/CMakeLists.txt index 55e81a8f6b..756205e83c 100644 --- a/examples/cvode/magma/CMakeLists.txt +++ b/examples/cvode/magma/CMakeLists.txt @@ -12,12 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -set(CVODE_examples - "cv_bruss_batched_magma.cpp\;\;develop" -) +set(CVODE_examples "cv_bruss_batched_magma.cpp\;\;develop") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set(vector nveccuda) @@ -38,7 +36,7 @@ foreach(example_tuple ${CVODE_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set_source_files_properties(${example} PROPERTIES LANGUAGE CUDA) @@ -53,13 +51,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_${vector} - sundials_sunlinsolmagmadense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_cvode sundials_${vector} sundials_sunlinsolmagmadense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -70,7 +65,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -81,15 +77,10 @@ endforeach(example_tuple ${CVODE_examples}) # Install the targets if(EXAMPLES_INSTALL) - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - cvode - ${vector} - sunlinsolmagmadense - DESTINATION - cvode/magma - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS cvode ${vector} sunlinsolmagmadense + DESTINATION cvode/magma) endif() diff --git a/examples/cvode/parallel/CMakeLists.txt b/examples/cvode/parallel/CMakeLists.txt index 598feb1f8c..1f3239f22f 100644 --- a/examples/cvode/parallel/CMakeLists.txt +++ b/examples/cvode/parallel/CMakeLists.txt @@ -14,16 +14,15 @@ # CMakeLists.txt file for CVODE parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_diag_p\;2\;4\;exclude-single" - "cvAdvDiff_non_p\;2\;2\;exclude-single" - "cvDiurnal_kry_bbd_p\;2\;4\;exclude-sigle" - "cvDiurnal_kry_p\;2\;4\;exclude-single" - ) + "cvAdvDiff_diag_p\;2\;4\;exclude-single" + "cvAdvDiff_non_p\;2\;2\;exclude-single" + "cvDiurnal_kry_bbd_p\;2\;4\;exclude-sigle" + "cvDiurnal_kry_p\;2\;4\;exclude-single") if(MPI_C_COMPILER) set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) @@ -57,7 +56,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -73,12 +73,11 @@ foreach(example_tuple ${CVODE_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel) endif() endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -95,39 +94,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/parhyp/CMakeLists.txt b/examples/cvode/parhyp/CMakeLists.txt index 043133a4ca..9571c36ae5 100644 --- a/examples/cvode/parhyp/CMakeLists.txt +++ b/examples/cvode/parhyp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_non_ph.c\;2\;2\;develop" - ) +set(CVODE_examples "cvAdvDiff_non_ph.c\;2\;2\;develop") if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_stubs sundials_cvode_fused_stubs) @@ -44,15 +42,13 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecparhyp - ${_fused_stubs} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecparhyp + ${_fused_stubs} ${EXE_EXTRA_LINK_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -60,7 +56,6 @@ foreach(example_tuple ${CVODE_examples}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -69,23 +64,14 @@ if(EXAMPLES_INSTALL) 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 - ) + 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() diff --git a/examples/cvode/petsc/CMakeLists.txt b/examples/cvode/petsc/CMakeLists.txt index 52def46e9e..0525f8f0e4 100644 --- a/examples/cvode/petsc/CMakeLists.txt +++ b/examples/cvode/petsc/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for CVODE PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cv_petsc_ex7\;1\;1\;develop" - "cvAdvDiff_petsc\;1\;4\;develop" - ) +set(CVODE_examples "cv_petsc_ex7\;1\;1\;develop" + "cvAdvDiff_petsc\;1\;4\;develop") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -57,7 +55,8 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -73,12 +72,11 @@ foreach(example_tuple ${CVODE_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) endif() endforeach(example_tuple ${CVODE_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -94,39 +92,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/petsc - RENAME Makefile - ) + RENAME Makefile) endif() sundials_add_test_install(cvode petsc) diff --git a/examples/cvode/raja/CMakeLists.txt b/examples/cvode/raja/CMakeLists.txt index 2c2e64319b..1cbc5d13ca 100644 --- a/examples/cvode/raja/CMakeLists.txt +++ b/examples/cvode/raja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODE RAJA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODE_examples - "cvAdvDiff_kry_raja.cpp\;develop" - ) +set(CVODE_examples "cvAdvDiff_kry_raja.cpp\;develop") # Add source directory to include directories include_directories(.) @@ -57,23 +55,19 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_cvode - sundials_nvecraja - ${_fused_stubs} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_cvode sundials_nvecraja ${_fused_stubs} + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${CVODE_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -82,34 +76,26 @@ if(EXAMPLES_INSTALL) set(LIBS "-lsundials_cvode_fused_stubs ${LIBS}") endif() - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(cvode CVODE_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - MAKE_TEMPLATE - makefile_serial_RAJA_ex.in - SOLVER_LIBRARY - sundials_cvode - SUNDIALS_TARGETS - cvode - nvecraja - ${_fused_stubs_target} - OTHER_TARGETS - ${_openmp_target} - DESTINATION - cvode/raja - EXTRA_FILES - README - TEST_INSTALL - raja - ) + sundials_install_examples( + cvode CVODE_examples + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + MAKE_TEMPLATE makefile_serial_RAJA_ex.in + SOLVER_LIBRARY sundials_cvode + SUNDIALS_TARGETS cvode nvecraja ${_fused_stubs_target} + OTHER_TARGETS ${_openmp_target} + DESTINATION cvode/raja + EXTRA_FILES README + TEST_INSTALL raja) endif() diff --git a/examples/cvode/serial/CMakeLists.txt b/examples/cvode/serial/CMakeLists.txt index 71abd3cf91..be033dce06 100644 --- a/examples/cvode/serial/CMakeLists.txt +++ b/examples/cvode/serial/CMakeLists.txt @@ -15,57 +15,46 @@ # CMakeLists.txt file for CVODE serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODE_examples - "cvAdvDiff_bnd\;\;develop" - "cvAnalytic_mels\;\;develop" - "cvDirectDemo_ls\;\;develop" - "cvDisc_dns\;\;develop" - "cvDiurnal_kry_bp\;\;develop" - "cvDiurnal_kry\;\;develop" - "cvKrylovDemo_ls\;\;develop" - "cvKrylovDemo_ls\;1\;develop" - "cvKrylovDemo_ls\;2\;develop" - "cvKrylovDemo_prec\;\;develop" - "cvParticle_dns\;\;develop" - "cvPendulum_dns\;\;exclude-single" - "cvRoberts_dns\;\;" - "cvRoberts_dns_constraints\;\;develop" - "cvRoberts_dns_negsol\;\;exclude-single" - "cvRoberts_dns_uw\;\;develop" - "cvRocket_dns\;\;develop" - ) + "cvAdvDiff_bnd\;\;develop" + "cvAnalytic_mels\;\;develop" + "cvDirectDemo_ls\;\;develop" + "cvDisc_dns\;\;develop" + "cvDiurnal_kry_bp\;\;develop" + "cvDiurnal_kry\;\;develop" + "cvKrylovDemo_ls\;\;develop" + "cvKrylovDemo_ls\;1\;develop" + "cvKrylovDemo_ls\;2\;develop" + "cvKrylovDemo_prec\;\;develop" + "cvParticle_dns\;\;develop" + "cvPendulum_dns\;\;exclude-single" + "cvRoberts_dns\;\;" + "cvRoberts_dns_constraints\;\;develop" + "cvRoberts_dns_negsol\;\;exclude-single" + "cvRoberts_dns_uw\;\;develop" + "cvRocket_dns\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND CVODE_examples "cvKrylovDemo_ls\;0 1\;develop") endif() # Examples using LAPACK linear solvers -set(CVODE_examples_BL - "cvAdvDiff_bndL\;\;exclude-single" - "cvRoberts_dnsL\;\;exclude-single" - ) +set(CVODE_examples_BL "cvAdvDiff_bndL\;\;exclude-single" + "cvRoberts_dnsL\;\;exclude-single") # Examples using KLU linear solver -set(CVODE_examples_KLU - "cvRoberts_block_klu\;\;develop" - "cvRoberts_klu\;\;develop" - ) +set(CVODE_examples_KLU "cvRoberts_block_klu\;\;develop" + "cvRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver -set(CVODE_examples_SUPERLUMT - "cvRoberts_sps\;\;develop" - ) +set(CVODE_examples_SUPERLUMT "cvRoberts_sps\;\;develop") # Auxiliary files to install -set(CVODE_extras - plot_cvParticle.py - plot_cvPendulum.py - cvRoberts_dns_stats.csv - ) +set(CVODE_extras plot_cvParticle.py plot_cvPendulum.py cvRoberts_dns_stats.csv) # Specify libraries to link against set(CVODE_LIB sundials_cvode) @@ -86,8 +75,8 @@ foreach(example_tuple ${CVODE_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -107,7 +96,8 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -119,19 +109,17 @@ foreach(example_tuple ${CVODE_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -143,8 +131,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -164,7 +152,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -176,14 +165,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -200,8 +188,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -221,7 +209,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -233,14 +222,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -257,8 +245,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -277,13 +265,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -296,14 +285,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endif() endforeach(example_tuple ${CVODE_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -312,7 +300,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODE_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -338,7 +327,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(CVODE_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -349,39 +338,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/cvode/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/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. + # 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/cvode/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvode/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvode/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvode/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvode/superludist/CMakeLists.txt b/examples/cvode/superludist/CMakeLists.txt index a6ec3ad259..d0c25e651c 100644 --- a/examples/cvode/superludist/CMakeLists.txt +++ b/examples/cvode/superludist/CMakeLists.txt @@ -14,8 +14,8 @@ # CMakeLists.txt file for CVODE SuperLU_DIST examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the type is develop +# for examples excluded from 'make test' in releases list(APPEND CVODE_examples "cvAdvDiff_sludist.cpp\;2 1\;2\;develop") @@ -41,7 +41,10 @@ foreach(example_tuple ${CVODE_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") if(SUNDIALS_INDEX_SIZE STREQUAL "32") - set(integer_precision "15") # superlu-dist seems to result in more output variability (maybe due to a bug with 32-bit indices?) + set(integer_precision "15") + + # superlu-dist seems to result in more output variability (maybe due to a + # bug with 32-bit indices?) set(float_precision "3") else() set(integer_precision "default") @@ -49,24 +52,21 @@ foreach(example_tuple ${CVODE_examples}) endif() # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}_${SUNDIALS_INDEX_SIZE}.out EXAMPLE_TYPE ${example_type} INTEGER_PRECISION ${integer_precision} - FLOAT_PRECISION ${float_precision} - ) + FLOAT_PRECISION ${float_precision}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - MPI::MPI_CXX - sundials_cvode - sundials_nvecparallel - sundials_sunlinsolsuperludist - ${_fused_lib} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE MPI::MPI_CXX sundials_cvode sundials_nvecparallel + sundials_sunlinsolsuperludist ${_fused_lib} ${EXE_EXTRA_LINK_LIBS}) endforeach(example_tuple ${CVODE_examples}) @@ -81,18 +81,12 @@ endif() # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(cvode_superludist CVODE_examples - EXTRA_FILES - README - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - cvode - nvecparallel - sunlinsolsuperludist - DESTINATION - cvode/superludist - ) + sundials_install_examples( + cvode_superludist CVODE_examples + EXTRA_FILES README + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS cvode nvecparallel sunlinsolsuperludist + DESTINATION cvode/superludist) # add test_install target sundials_add_test_install(cvode superludist) diff --git a/examples/cvodes/CMakeLists.txt b/examples/cvodes/CMakeLists.txt index bb57f3e400..58dacdd293 100644 --- a/examples/cvodes/CMakeLists.txt +++ b/examples/cvodes/CMakeLists.txt @@ -27,4 +27,4 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) -endif() \ No newline at end of file +endif() diff --git a/examples/cvodes/C_openmp/CMakeLists.txt b/examples/cvodes/C_openmp/CMakeLists.txt index 02fab6bb9f..cc344d5e07 100644 --- a/examples/cvodes/C_openmp/CMakeLists.txt +++ b/examples/cvodes/C_openmp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for CVODES OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(CVODES_examples_OMP - "cvsAdvDiff_bnd_omp\;4\;develop" - ) +set(CVODES_examples_OMP "cvsAdvDiff_bnd_omp\;4\;develop") # Specify libraries to link against set(CVODES_LIB sundials_cvodes) @@ -37,8 +35,8 @@ foreach(example_tuple ${CVODES_examples_OMP}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -51,7 +49,8 @@ foreach(example_tuple ${CVODES_examples_OMP}) endif() # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -60,12 +59,11 @@ foreach(example_tuple ${CVODES_examples_OMP}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) endif() endforeach(example_tuple ${CVODES_examples_OMP}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -74,7 +72,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODES_extras_OMP}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -84,39 +83,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODES_examples_OMP 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. + # 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/cvodes/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/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. + # 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/cvodes/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/F2003_serial/CMakeLists.txt b/examples/cvodes/F2003_serial/CMakeLists.txt index 5e5bac8953..aa175b2a93 100644 --- a/examples/cvodes/F2003_serial/CMakeLists.txt +++ b/examples/cvodes/F2003_serial/CMakeLists.txt @@ -14,12 +14,12 @@ # CMakeLists.txt file for the F2003 CVODES serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(FCVODES_examples - "cvs_analytic_fp_f2003\;\;develop" - "cvsAdvDiff_FSA_non_f2003\;-sensi stg t\;develop" - "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop") + "cvs_analytic_fp_f2003\;\;develop" + "cvsAdvDiff_FSA_non_f2003\;-sensi stg t\;develop" + "cvsAdvDiff_FSA_non_f2003\;-sensi sim t\;develop") # Specify libraries to link against set(CVODES_LIB sundials_fcvodes_mod) @@ -34,11 +34,12 @@ foreach(example_tuple ${FCVODES_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -58,7 +59,8 @@ foreach(example_tuple ${FCVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -67,10 +69,10 @@ foreach(example_tuple ${FCVODES_examples}) # find all .out files for this example file(GLOB example_out ${example}*.out) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial) endif() endforeach(example_tuple ${FCVODES_examples}) @@ -85,39 +87,33 @@ if(EXAMPLES_INSTALL) examples2string(FCVODES_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/parallel/CMakeLists.txt b/examples/cvodes/parallel/CMakeLists.txt index dc985978ce..1a1ede9689 100644 --- a/examples/cvodes/parallel/CMakeLists.txt +++ b/examples/cvodes/parallel/CMakeLists.txt @@ -14,21 +14,20 @@ # CMakeLists.txt file for CVODES parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODES_examples - "cvsAdvDiff_ASAp_non_p\;\;2\;2\;exclude-single" - "cvsAdvDiff_FSA_non_p\;-sensi stg t\;2\;2\;exclude-single" - "cvsAdvDiff_FSA_non_p\;-sensi sim t\;2\;2\;exclude-single" - "cvsAdvDiff_non_p\;\;2\;2\;exclude-single" - "cvsAtmDisp_ASAi_kry_bbd_p\;\;2\;4\;exclude-single" - "cvsDiurnal_FSA_kry_p\;-sensi stg t\;2\;4\;exclude-single" - "cvsDiurnal_FSA_kry_p\;-sensi sim t\;2\;4\;exclude-single" - "cvsDiurnal_kry_bbd_p\;\;2\;4\;exclude-single" - "cvsDiurnal_kry_p\;\;2\;4\;exclude-single" - ) + "cvsAdvDiff_ASAp_non_p\;\;2\;2\;exclude-single" + "cvsAdvDiff_FSA_non_p\;-sensi stg t\;2\;2\;exclude-single" + "cvsAdvDiff_FSA_non_p\;-sensi sim t\;2\;2\;exclude-single" + "cvsAdvDiff_non_p\;\;2\;2\;exclude-single" + "cvsAtmDisp_ASAi_kry_bbd_p\;\;2\;4\;exclude-single" + "cvsDiurnal_FSA_kry_p\;-sensi stg t\;2\;4\;exclude-single" + "cvsDiurnal_FSA_kry_p\;-sensi sim t\;2\;4\;exclude-single" + "cvsDiurnal_kry_bbd_p\;\;2\;4\;exclude-single" + "cvsDiurnal_kry_p\;\;2\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -45,7 +44,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${CVODES_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${CVODES_examples}) @@ -56,8 +54,8 @@ foreach(example_tuple ${CVODES_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -81,7 +79,8 @@ foreach(example_tuple ${CVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -94,12 +93,11 @@ foreach(example_tuple ${CVODES_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel) endif() endforeach(example_tuple ${CVODES_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -113,39 +111,32 @@ if(EXAMPLES_INSTALL) examples2string(CVODES_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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/cvodes/serial/CMakeLists.txt b/examples/cvodes/serial/CMakeLists.txt index 48cfb72f99..4089accc24 100644 --- a/examples/cvodes/serial/CMakeLists.txt +++ b/examples/cvodes/serial/CMakeLists.txt @@ -15,76 +15,69 @@ # CMakeLists.txt file for CVODES serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(CVODES_examples - "cvsAdvDiff_ASAi_bnd\;\;develop" - "cvsAdvDiff_FSA_non\;-sensi sim t\;exclude-single" - "cvsAdvDiff_FSA_non\;-sensi stg t\;exclude-single" - "cvsAdvDiff_bnd\;\;develop" - "cvsAnalytic_mels\;\;develop" - "cvsDirectDemo_ls\;\;develop" - "cvsDiurnal_FSA_kry\;-sensi sim t\;exclude-single" - "cvsDiurnal_FSA_kry\;-sensi stg t\;exclude-single" - "cvsDiurnal_kry\;\;develop" - "cvsDiurnal_kry_bp\;\;develop" - "cvsFoodWeb_ASAi_kry\;\;develop" - "cvsFoodWeb_ASAp_kry\;\;develop" - "cvsHessian_ASA_FSA\;\;exclude-single" - "cvsKrylovDemo_ls\;\;develop" - "cvsKrylovDemo_ls\;1\;develop" - "cvsKrylovDemo_ls\;2\;develop" - "cvsKrylovDemo_prec\;\;develop" - "cvsParticle_dns\;\;develop" - "cvsPendulum_dns\;\;exclude-single" - "cvsRoberts_ASAi_dns\;\;exclude-single" - "cvsRoberts_ASAi_dns_constraints\;\;develop" - "cvsRoberts_FSA_dns\;-sensi sim t\;exclude-single" - "cvsRoberts_FSA_dns\;-sensi stg1 t\;exclude-single" - "cvsRoberts_FSA_dns_Switch\;\;exclude-single" - "cvsRoberts_FSA_dns_constraints\;-sensi stg1 t\;exclude-single" - "cvsRoberts_dns\;\;" - "cvsRoberts_dns_constraints\;\;develop" - "cvsRoberts_dns_uw\;\;develop" - ) + "cvsAdvDiff_ASAi_bnd\;\;develop" + "cvsAdvDiff_FSA_non\;-sensi sim t\;exclude-single" + "cvsAdvDiff_FSA_non\;-sensi stg t\;exclude-single" + "cvsAdvDiff_bnd\;\;develop" + "cvsAnalytic_mels\;\;develop" + "cvsDirectDemo_ls\;\;develop" + "cvsDiurnal_FSA_kry\;-sensi sim t\;exclude-single" + "cvsDiurnal_FSA_kry\;-sensi stg t\;exclude-single" + "cvsDiurnal_kry\;\;develop" + "cvsDiurnal_kry_bp\;\;develop" + "cvsFoodWeb_ASAi_kry\;\;develop" + "cvsFoodWeb_ASAp_kry\;\;develop" + "cvsHessian_ASA_FSA\;\;exclude-single" + "cvsKrylovDemo_ls\;\;develop" + "cvsKrylovDemo_ls\;1\;develop" + "cvsKrylovDemo_ls\;2\;develop" + "cvsKrylovDemo_prec\;\;develop" + "cvsParticle_dns\;\;develop" + "cvsPendulum_dns\;\;exclude-single" + "cvsRoberts_ASAi_dns\;\;exclude-single" + "cvsRoberts_ASAi_dns_constraints\;\;develop" + "cvsRoberts_FSA_dns\;-sensi sim t\;exclude-single" + "cvsRoberts_FSA_dns\;-sensi stg1 t\;exclude-single" + "cvsRoberts_FSA_dns_Switch\;\;exclude-single" + "cvsRoberts_FSA_dns_constraints\;-sensi stg1 t\;exclude-single" + "cvsRoberts_dns\;\;" + "cvsRoberts_dns_constraints\;\;develop" + "cvsRoberts_dns_uw\;\;develop") if(SUNDIALS_BUILD_WITH_MONITORING) list(APPEND CVODE_examples "cvsKrylovDemo_ls\;0 1\;develop") endif() # Examples using LAPACK linear solvers -set(CVODES_examples_BL - "cvsAdvDiff_bndL\;\;exclude-single" - "cvsRoberts_dnsL\;\;exclude-single" - ) +set(CVODES_examples_BL "cvsAdvDiff_bndL\;\;exclude-single" + "cvsRoberts_dnsL\;\;exclude-single") # Examples using KLU linear solver set(CVODES_examples_KLU - "cvsRoberts_ASAi_klu\;\;develop" - "cvsRoberts_FSA_klu\;-sensi stg1 t\;develop" - "cvsRoberts_klu\;\;develop" - ) + "cvsRoberts_ASAi_klu\;\;develop" + "cvsRoberts_FSA_klu\;-sensi stg1 t\;develop" "cvsRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(CVODES_examples_SUPERLUMT - "cvsRoberts_ASAi_sps\;\;exclude-single" - "cvsRoberts_FSA_sps\;-sensi stg1 t\;exclude-single" - "cvsRoberts_sps\;\;develop" - ) + "cvsRoberts_ASAi_sps\;\;exclude-single" + "cvsRoberts_FSA_sps\;-sensi stg1 t\;exclude-single" + "cvsRoberts_sps\;\;develop") # Auxiliary files to install set(CVODES_extras - plot_cvsParticle.py - plot_cvsPendulum.py - cvsRoberts_ASAi_dns_bkw1_stats.csv - cvsRoberts_ASAi_dns_bkw2_stats.csv - cvsRoberts_ASAi_dns_fwd_stats.csv - cvsRoberts_dns_stats.csv - cvsRoberts_FSA_dns_stats_-sensi_sim_t.csv - cvsRoberts_FSA_dns_stats_-sensi_stg1_t.csv - ) + plot_cvsParticle.py + plot_cvsPendulum.py + cvsRoberts_ASAi_dns_bkw1_stats.csv + cvsRoberts_ASAi_dns_bkw2_stats.csv + cvsRoberts_ASAi_dns_fwd_stats.csv + cvsRoberts_dns_stats.csv + cvsRoberts_FSA_dns_stats_-sensi_sim_t.csv + cvsRoberts_FSA_dns_stats_-sensi_stg1_t.csv) # Specify libraries to link against set(CVODES_LIB sundials_cvodes) @@ -101,8 +94,8 @@ foreach(example_tuple ${CVODES_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -122,7 +115,8 @@ foreach(example_tuple ${CVODES_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -134,19 +128,17 @@ foreach(example_tuple ${CVODES_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -158,8 +150,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -179,7 +171,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -191,14 +184,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -215,8 +207,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -236,7 +228,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -248,14 +241,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -272,8 +264,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -292,13 +284,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int32_t. - # Answer files were generated with int64_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int32_t. Answer files were generated with int64_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "64") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -311,14 +304,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endif() endforeach(example_tuple ${CVODES_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -327,7 +319,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${CVODES_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -350,7 +343,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(CVODES_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -361,39 +354,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/cvodes/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/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. + # 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/cvodes/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/cvodes/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/cvodes/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/cvodes/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/CMakeLists.txt b/examples/ida/CMakeLists.txt index 60b3867f90..c018807336 100644 --- a/examples/ida/CMakeLists.txt +++ b/examples/ida/CMakeLists.txt @@ -33,7 +33,9 @@ endif() if(EXAMPLES_ENABLE_CXX) if(ENABLE_RAJA AND RAJA_FOUND) add_subdirectory(raja) - if(ENABLE_MPI AND MPI_C_FOUND AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) + if(ENABLE_MPI + AND MPI_C_FOUND + AND (SUNDIALS_RAJA_BACKENDS MATCHES "CUDA")) add_subdirectory(mpiraja) endif() endif() diff --git a/examples/ida/C_openmp/CMakeLists.txt b/examples/ida/C_openmp/CMakeLists.txt index bd5632d0c0..6fcf691c6e 100644 --- a/examples/ida/C_openmp/CMakeLists.txt +++ b/examples/ida/C_openmp/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for IDA OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaFoodWeb_bnd_omp\;4\;develop" - "idaFoodWeb_kry_omp\;4\;develop" - ) +set(IDA_examples "idaFoodWeb_bnd_omp\;4\;develop" + "idaFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -43,9 +41,10 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") - if (NOT ${example} MATCHES "idaFoodWeb_kry_omp") + if(NOT ${example} MATCHES "idaFoodWeb_kry_omp") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -58,12 +57,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -77,39 +75,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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/ida/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/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. + # 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/ida/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_openmp/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt index 63fb888572..77a99633c0 100644 --- a/examples/ida/F2003_openmp/CMakeLists.txt +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -15,15 +15,13 @@ # CMakeLists.txt file for the F2003 IDA OpenMP examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - set(FIDA_examples_OMP - "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" - "idaHeat2D_kry_omp_f2003.f90\;8\;exclude" - ) + set(FIDA_examples_OMP "idaHeat2D_kry_omp_f2003.f90\;4\;exclude" + "idaHeat2D_kry_omp_f2003.f90\;8\;exclude") endif() # Specify libraries to link against @@ -48,15 +46,13 @@ foreach(example_tuple ${FIDA_examples_OMP}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_ida - sundials_fida_mod - sundials_nvecopenmp - sundials_fnvecopenmp_mod - ${SUNDIALS_LIBS}) + target_link_libraries( + ${example} sundials_ida sundials_fida_mod sundials_nvecopenmp + sundials_fnvecopenmp_mod ${SUNDIALS_LIBS}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) endif() @@ -68,7 +64,8 @@ foreach(example_tuple ${FIDA_examples_OMP}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -77,7 +74,7 @@ foreach(example_tuple ${FIDA_examples_OMP}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${test_name}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp) endif() endforeach(example_tuple ${FIDA_examples_OMP}) @@ -92,39 +89,32 @@ if(EXAMPLES_INSTALL) examples2string(FIDA_examples_OMP 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_parallel/CMakeLists.txt b/examples/ida/F2003_parallel/CMakeLists.txt index af50a152e3..afaea82c5f 100644 --- a/examples/ida/F2003_parallel/CMakeLists.txt +++ b/examples/ida/F2003_parallel/CMakeLists.txt @@ -15,19 +15,15 @@ # CMakeLists.txt file for the IDA F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") - set(FIDA_examples - "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") + set(FIDA_examples "ida_heat2D_kry_bbd_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(IDA_LIBS - sundials_ida - sundials_fida_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(IDA_LIBS sundials_ida sundials_fida_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${IDA_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -45,7 +41,8 @@ foreach(example_tuple ${FIDA_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -64,7 +61,8 @@ foreach(example_tuple ${FIDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -78,19 +76,18 @@ foreach(example_tuple ${FIDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) endif() endforeach(example_tuple ${FIDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${IDA_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -101,45 +98,38 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM IDA_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_parallel/CMakeLists.txt + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/ida/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/F2003_serial/CMakeLists.txt b/examples/ida/F2003_serial/CMakeLists.txt index 107b423e41..8d0ddb1e75 100644 --- a/examples/ida/F2003_serial/CMakeLists.txt +++ b/examples/ida/F2003_serial/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for the F2003 IDA serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(FIDA_examples - "idaRoberts_dns_f2003\;develop" -) +set(FIDA_examples "idaRoberts_dns_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FIDA_examples - "idaHeat2D_kry_f2003\;develop" - ) + list(APPEND FIDA_examples "idaHeat2D_kry_f2003\;develop") endif() # Specify libraries to link against @@ -42,7 +38,8 @@ foreach(example_tuple ${FIDA_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -50,7 +47,8 @@ foreach(example_tuple ${FIDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,10 +56,10 @@ foreach(example_tuple ${FIDA_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial) endif() endforeach(example_tuple ${FIDA_examples}) @@ -76,39 +74,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/cuda/CMakeLists.txt b/examples/ida/cuda/CMakeLists.txt index cc420c0721..81c74e96df 100644 --- a/examples/ida/cuda/CMakeLists.txt +++ b/examples/ida/cuda/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_cuda\;develop" - ) +set(IDA_examples "idaHeat2D_kry_cuda\;develop") # Add source directory to include directories include_directories(.) @@ -39,7 +37,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 0 example) list(GET example_tuple 1 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) # add example source files add_executable(${example} ${example}.cu) @@ -47,7 +46,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -58,12 +58,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -78,39 +77,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/cuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/mpicuda/CMakeLists.txt b/examples/ida/mpicuda/CMakeLists.txt index ff3129ba28..fb01b8b3b6 100644 --- a/examples/ida/mpicuda/CMakeLists.txt +++ b/examples/ida/mpicuda/CMakeLists.txt @@ -14,12 +14,11 @@ # CMakeLists.txt file for IDA CUDA examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_p_mpicuda\;1\;4\;develop") +set(IDA_examples "idaHeat2D_kry_p_mpicuda\;1\;4\;develop") # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -37,7 +36,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 2 number_of_tasks) list(GET example_tuple 3 example_type) - set_source_files_properties(${example}.cu PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) + set_source_files_properties(${example}.cu + PROPERTIES CUDA_SOURCE_PROPERTY_FORMAT OBJ) # add example source files add_executable(${example} ${example}.cu) @@ -45,25 +45,24 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS}) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cu ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -77,39 +76,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/mpicuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/mpicuda - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/mpiraja/CMakeLists.txt b/examples/ida/mpiraja/CMakeLists.txt index ede0737c54..9db66e0922 100644 --- a/examples/ida/mpiraja/CMakeLists.txt +++ b/examples/ida/mpiraja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA raja examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_p_mpiraja.cpp\;1\;4\;develop" - ) +set(IDA_examples "idaHeat2D_kry_p_mpiraja.cpp\;1\;4\;develop") if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_lang CUDA) @@ -54,17 +52,14 @@ foreach(example_tuple ${IDA_examples}) target_include_directories(${example_target} PUBLIC ${MPI_CXX_INCLUDE_DIRS}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_ida - sundials_nvecmpiplusx - sundials_nvecraja - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_ida sundials_nvecmpiplusx sundials_nvecraja + ${MPI_CXX_LIBRARIES} ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -72,38 +67,29 @@ foreach(example_tuple ${IDA_examples}) endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(ida IDA_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_RAJA_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - ida - nvecmpiplusx - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - ida/mpiraja - EXTRA_FILES - README - TEST_INSTALL - mpiraja - ) + sundials_install_examples( + ida IDA_examples + CMAKE_TEMPLATE cmakelists_${_lang}_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_RAJA_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS ida nvecmpiplusx nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION ida/mpiraja + EXTRA_FILES README + TEST_INSTALL mpiraja) endif() diff --git a/examples/ida/parallel/CMakeLists.txt b/examples/ida/parallel/CMakeLists.txt index 726502d5f9..0eff8ed069 100644 --- a/examples/ida/parallel/CMakeLists.txt +++ b/examples/ida/parallel/CMakeLists.txt @@ -14,16 +14,15 @@ # CMakeLists.txt file for IDA parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaFoodWeb_kry_bbd_p\;1\;4\;exclude-single" - "idaFoodWeb_kry_p\;1\;4\;exclude-single" - "idaHeat2D_kry_bbd_p\;1\;4\;exclude-single" - "idaHeat2D_kry_p\;1\;4\;exclude-single" - ) + "idaFoodWeb_kry_bbd_p\;1\;4\;exclude-single" + "idaFoodWeb_kry_p\;1\;4\;exclude-single" + "idaHeat2D_kry_bbd_p\;1\;4\;exclude-single" + "idaHeat2D_kry_p\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -54,7 +53,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -70,12 +70,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -89,39 +88,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/petsc/CMakeLists.txt b/examples/ida/petsc/CMakeLists.txt index d75471d8c4..098ce24569 100644 --- a/examples/ida/petsc/CMakeLists.txt +++ b/examples/ida/petsc/CMakeLists.txt @@ -14,17 +14,16 @@ # CMakeLists.txt file for IDA PETSc examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args;\nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args;\nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaHeat2D_petsc_spgmr\;\;1\;4\;develop" - "idaHeat2D_petsc_snes\;\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" - "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop" - ) + "idaHeat2D_petsc_spgmr\;\;1\;4\;develop" + "idaHeat2D_petsc_snes\;\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-pre\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-jac\;1\;4\;develop" + "idaHeat2D_petsc_snes\;-jac -pre\;1\;4\;develop") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -51,8 +50,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) add_executable(${example} ${example}.c) @@ -75,7 +74,8 @@ foreach(example_tuple ${IDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -88,12 +88,11 @@ foreach(example_tuple ${IDA_examples}) # install example if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) endif() endforeach(example_tuple ${IDA_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +105,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/petsc - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/raja/CMakeLists.txt b/examples/ida/raja/CMakeLists.txt index 2117b9c1bc..98ea198a79 100644 --- a/examples/ida/raja/CMakeLists.txt +++ b/examples/ida/raja/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for IDA raja examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDA_examples - "idaHeat2D_kry_raja.cpp\;develop" - ) +set(IDA_examples "idaHeat2D_kry_raja.cpp\;develop") # Add source directory to include directories include_directories(.) @@ -53,52 +51,42 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_ida - sundials_nvecraja - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE sundials_ida sundials_nvecraja + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out EXAMPLE_TYPE ${example_type}) endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(ida IDA_examples - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - MAKE_TEMPLATE - makefile_serial_RAJA_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - ida - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - ida/raja - EXTRA_FILES - README - TEST_INSTALL - raja - ) + sundials_install_examples( + ida IDA_examples + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + MAKE_TEMPLATE makefile_serial_RAJA_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS ida nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION ida/raja + EXTRA_FILES README + TEST_INSTALL raja) endif() diff --git a/examples/ida/serial/CMakeLists.txt b/examples/ida/serial/CMakeLists.txt index e11c3fd56a..809c6be76d 100644 --- a/examples/ida/serial/CMakeLists.txt +++ b/examples/ida/serial/CMakeLists.txt @@ -15,43 +15,36 @@ # CMakeLists.txt file for IDA serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDA_examples - "idaAnalytic_mels\;\;exclude-single" - "idaFoodWeb_bnd\;\;develop" - "idaFoodWeb_kry\;\;develop" - "idaHeat2D_bnd\;\;develop" - "idaHeat2D_kry\;\;develop" - "idaKrylovDemo_ls\;\;develop" - "idaKrylovDemo_ls\;1\;develop" - "idaKrylovDemo_ls\;2\;develop" - "idaRoberts_dns\;\;" - "idaSlCrank_dns\;\;exclude-single" - ) + "idaAnalytic_mels\;\;exclude-single" + "idaFoodWeb_bnd\;\;develop" + "idaFoodWeb_kry\;\;develop" + "idaHeat2D_bnd\;\;develop" + "idaHeat2D_kry\;\;develop" + "idaKrylovDemo_ls\;\;develop" + "idaKrylovDemo_ls\;1\;develop" + "idaKrylovDemo_ls\;2\;develop" + "idaRoberts_dns\;\;" + "idaSlCrank_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(IDA_examples_BL - ) +set(IDA_examples_BL) # Examples using KLU linear solver -set(IDA_examples_KLU - "idaHeat2D_klu\;\;develop" - "idaRoberts_klu\;\;develop" - ) +set(IDA_examples_KLU "idaHeat2D_klu\;\;develop" "idaRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(IDA_examples_SUPERLUMT "idaRoberts_sps\;\;develop" - #"idaHeat2D_sps\;develop" # not ready yet, incorrect answer. - ) + # "idaHeat2D_sps\;develop" # not ready yet, incorrect answer. +) # Auxiliary files to install -set(IDA_extras - idaRoberts_dns_stats.csv - ) +set(IDA_extras idaRoberts_dns_stats.csv) # Specify libraries to link against set(IDA_LIB sundials_ida) @@ -68,8 +61,8 @@ foreach(example_tuple ${IDA_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -89,7 +82,8 @@ foreach(example_tuple ${IDA_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -101,19 +95,17 @@ foreach(example_tuple ${IDA_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -125,8 +117,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -146,7 +138,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -158,14 +151,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -182,8 +174,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -203,7 +195,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -215,14 +208,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -239,8 +231,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -259,13 +251,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -278,14 +271,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial) endif() endforeach(example_tuple ${IDA_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -317,7 +309,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(IDA_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -328,39 +320,32 @@ if(EXAMPLES_INSTALL) 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. + # 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 - ) + ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/serial/CMakeLists.txt + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/ida/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/ida/trilinos/CMakeLists.txt b/examples/ida/trilinos/CMakeLists.txt index 384d549478..9a11456931 100644 --- a/examples/ida/trilinos/CMakeLists.txt +++ b/examples/ida/trilinos/CMakeLists.txt @@ -14,25 +14,22 @@ # CMakeLists.txt file for IDA Trilinos examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers if(Trilinos_INTERFACE_MPI_CXX_FOUND) - set(IDA_examples - "idaHeat2D_kry_tpetra\;1\;1\;develop" - "idaHeat2D_kry_p_tpetra\;1\;4\;develop" - ) + set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop" + "idaHeat2D_kry_p_tpetra\;1\;4\;develop") else() - set(IDA_examples - "idaHeat2D_kry_tpetra\;1\;1\;develop" - ) + set(IDA_examples "idaHeat2D_kry_tpetra\;1\;1\;develop") endif() # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") set(MPIEXEC_EXECUTABLE ${Trilinos_INTERFACE_MPIEXEC}) @@ -59,7 +56,8 @@ foreach(example_tuple ${IDA_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -71,12 +69,11 @@ foreach(example_tuple ${IDA_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) endif() endforeach(example_tuple ${IDA_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -90,39 +87,32 @@ if(EXAMPLES_INSTALL) examples2string(IDA_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. + # 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_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos) # 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. + # 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_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/ida/trilinos/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/trilinos - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/CMakeLists.txt b/examples/idas/CMakeLists.txt index b191f2effa..90617df855 100644 --- a/examples/idas/CMakeLists.txt +++ b/examples/idas/CMakeLists.txt @@ -27,4 +27,4 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE AND EXAMPLES_ENABLE_F2003) add_subdirectory(F2003_serial) -endif() \ No newline at end of file +endif() diff --git a/examples/idas/C_openmp/CMakeLists.txt b/examples/idas/C_openmp/CMakeLists.txt index 1a0eb6c8f3..d9bf8c422a 100644 --- a/examples/idas/C_openmp/CMakeLists.txt +++ b/examples/idas/C_openmp/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for IDAS OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(IDAS_examples - "idasFoodWeb_bnd_omp\;4\;develop" - "idasFoodWeb_kry_omp\;4\;develop" - ) +set(IDAS_examples "idasFoodWeb_bnd_omp\;4\;develop" + "idasFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(IDAS_LIB sundials_idas) @@ -38,8 +36,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -52,16 +50,14 @@ foreach(example_tuple ${IDAS_examples}) endif() # check if example args are provided and set the test name - # IF("${example_args}" STREQUAL "") - # SET(test_name ${example}) - # ELSE() - # STRING(REGEX REPLACE " " "_" test_name ${example}_${example_args}) - # ENDIF() + # IF("${example_args}" STREQUAL "") SET(test_name ${example}) ELSE() + # STRING(REGEX REPLACE " " "_" test_name ${example}_${example_args}) ENDIF() # LEB NOTE: This goes away with TestRunner fix for OpenMP if(NOT ${example} MATCHES "idasFoodWeb_kry_omp") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -71,12 +67,11 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) endif() endforeach(example_tuple ${IDAS_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -85,7 +80,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${IDAS_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/C_openmp) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -95,39 +91,32 @@ if(EXAMPLES_INSTALL) 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/idas/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/C_openmp/CMakeLists.txt + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/idas/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/F2003_serial/CMakeLists.txt b/examples/idas/F2003_serial/CMakeLists.txt index d66b309729..d019e822c9 100644 --- a/examples/idas/F2003_serial/CMakeLists.txt +++ b/examples/idas/F2003_serial/CMakeLists.txt @@ -14,17 +14,13 @@ # CMakeLists.txt file for the F2003 IDAS serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(FIDAS_examples - "idasAkzoNob_ASAi_dns_f2003\;develop" - ) +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases +set(FIDAS_examples "idasAkzoNob_ASAi_dns_f2003\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") # Examples using SUNDIALS linear solvers - list(APPEND FIDAS_examples - "idasHeat2D_kry_f2003\;develop" - ) + list(APPEND FIDAS_examples "idasHeat2D_kry_f2003\;develop") endif() # Specify libraries to link against @@ -40,7 +36,8 @@ foreach(example_tuple ${FIDAS_examples}) list(GET example_tuple 1 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -48,7 +45,8 @@ foreach(example_tuple ${FIDAS_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -56,10 +54,10 @@ foreach(example_tuple ${FIDAS_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial) endif() endforeach(example_tuple ${FIDAS_examples}) @@ -74,39 +72,32 @@ if(EXAMPLES_INSTALL) examples2string(FIDAS_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/parallel/CMakeLists.txt b/examples/idas/parallel/CMakeLists.txt index f6cd322534..3c18e878fc 100644 --- a/examples/idas/parallel/CMakeLists.txt +++ b/examples/idas/parallel/CMakeLists.txt @@ -14,20 +14,19 @@ # CMakeLists.txt file for IDAS parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDAS_examples - "idasBruss_ASAp_kry_bbd_p\;\;1\;4\;exclude-single" - "idasBruss_FSA_kry_bbd_p\;\;1\;4\;exclude-single" - "idasBruss_kry_bbd_p\;\;1\;4\;exclude-single" - "idasFoodWeb_kry_bbd_p\;\;1\;4\;exclude-single" - "idasFoodWeb_kry_p\;\;1\;4\;exclude-single" - "idasHeat2D_FSA_kry_bbd_p\;-sensi stg t\;1\;4\;exclude-single" - "idasHeat2D_kry_bbd_p\;\;1\;4\;exclude-single" - "idasHeat2D_kry_p\;\;1\;4\;exclude-single" - ) + "idasBruss_ASAp_kry_bbd_p\;\;1\;4\;exclude-single" + "idasBruss_FSA_kry_bbd_p\;\;1\;4\;exclude-single" + "idasBruss_kry_bbd_p\;\;1\;4\;exclude-single" + "idasFoodWeb_kry_bbd_p\;\;1\;4\;exclude-single" + "idasFoodWeb_kry_p\;\;1\;4\;exclude-single" + "idasHeat2D_FSA_kry_bbd_p\;-sensi stg t\;1\;4\;exclude-single" + "idasHeat2D_kry_bbd_p\;\;1\;4\;exclude-single" + "idasHeat2D_kry_p\;\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -44,7 +43,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${IDAS_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${IDAS_examples}) @@ -55,8 +53,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -80,7 +78,8 @@ foreach(example_tuple ${IDAS_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -93,12 +92,11 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel) endif() endforeach(example_tuple ${IDAS_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -112,39 +110,32 @@ if(EXAMPLES_INSTALL) 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/idas/serial/CMakeLists.txt b/examples/idas/serial/CMakeLists.txt index b4531f52c5..c90e776019 100644 --- a/examples/idas/serial/CMakeLists.txt +++ b/examples/idas/serial/CMakeLists.txt @@ -15,53 +15,45 @@ # CMakeLists.txt file for IDAS serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(IDAS_examples - "idasAkzoNob_ASAi_dns\;\;exclude-single" - "idasAkzoNob_dns\;\;exclude-single" - "idasAnalytic_mels\;\;exclude-single" - "idasFoodWeb_bnd\;\;develop" - "idasHeat2D_bnd\;\;exclude-single" - "idasHeat2D_kry\;\;exclude-single" - "idasHessian_ASA_FSA\;\;exclude-single" - "idasKrylovDemo_ls\;\;develop" - "idasKrylovDemo_ls\;1\;develop" - "idasKrylovDemo_ls\;2\;develop" - "idasRoberts_ASAi_dns\;\;exclude-single" - "idasRoberts_FSA_dns\;-sensi stg t\;exclude-single" - "idasRoberts_dns\;\;" - "idasSlCrank_dns\;\;exclude-single" - "idasSlCrank_FSA_dns\;\;exclude-single" - ) + "idasAkzoNob_ASAi_dns\;\;exclude-single" + "idasAkzoNob_dns\;\;exclude-single" + "idasAnalytic_mels\;\;exclude-single" + "idasFoodWeb_bnd\;\;develop" + "idasHeat2D_bnd\;\;exclude-single" + "idasHeat2D_kry\;\;exclude-single" + "idasHessian_ASA_FSA\;\;exclude-single" + "idasKrylovDemo_ls\;\;develop" + "idasKrylovDemo_ls\;1\;develop" + "idasKrylovDemo_ls\;2\;develop" + "idasRoberts_ASAi_dns\;\;exclude-single" + "idasRoberts_FSA_dns\;-sensi stg t\;exclude-single" + "idasRoberts_dns\;\;" + "idasSlCrank_dns\;\;exclude-single" + "idasSlCrank_FSA_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(IDAS_examples_BL - ) +set(IDAS_examples_BL) # Examples using KLU linear solver set(IDAS_examples_KLU - "idasRoberts_ASAi_klu\;\;develop" - "idasRoberts_FSA_klu\;-sensi stg t\;develop" - "idasRoberts_klu\;\;develop" - ) + "idasRoberts_ASAi_klu\;\;develop" + "idasRoberts_FSA_klu\;-sensi stg t\;develop" "idasRoberts_klu\;\;develop") # Examples using SuperLU_MT linear solver set(IDAS_examples_SUPERLUMT - "idasRoberts_ASAi_sps\;\;exclude-single" - "idasRoberts_FSA_sps\;-sensi stg t\;exclude-single" - "idasRoberts_sps\;\;exclude-single" - ) + "idasRoberts_ASAi_sps\;\;exclude-single" + "idasRoberts_FSA_sps\;-sensi stg t\;exclude-single" + "idasRoberts_sps\;\;exclude-single") # Auxiliary files to install set(IDAS_extras - idasRoberts_ASAi_dns_bkw1_stats.csv - idasRoberts_ASAi_dns_fwd_stats.csv - idasRoberts_dns_stats.csv - idasRoberts_FSA_dns_stats_-sensi_stg_t.csv - ) + idasRoberts_ASAi_dns_bkw1_stats.csv idasRoberts_ASAi_dns_fwd_stats.csv + idasRoberts_dns_stats.csv idasRoberts_FSA_dns_stats_-sensi_stg_t.csv) # Specify libraries to link against set(IDAS_LIB sundials_idas) @@ -78,8 +70,8 @@ foreach(example_tuple ${IDAS_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -99,7 +91,8 @@ foreach(example_tuple ${IDAS_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -111,19 +104,17 @@ foreach(example_tuple ${IDAS_examples}) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -135,8 +126,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -156,7 +147,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -168,14 +160,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -192,8 +183,8 @@ if(BUILD_SUNLINSOL_KLU) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -213,7 +204,8 @@ if(BUILD_SUNLINSOL_KLU) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -225,14 +217,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -249,8 +240,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # add example source files add_executable(${example} ${example}.c) @@ -269,13 +260,14 @@ if(BUILD_SUNLINSOL_SUPERLUMT) string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) endif() - # Do not include SuperLUMT examples in testing when the indextype is int64_t. - # Answer files were generated with int32_t and minor differences in output - # occur causing a false positive when testing. These tests can be re-enabled - # when type specific answer files are added. + # Do not include SuperLUMT examples in testing when the indextype is + # int64_t. Answer files were generated with int32_t and minor differences in + # output occur causing a false positive when testing. These tests can be + # re-enabled when type specific answer files are added. if(SUNDIALS_INDEX_SIZE MATCHES "32") # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -288,14 +280,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and .out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial) endif() endforeach(example_tuple ${IDAS_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -327,7 +318,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(IDAS_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -338,39 +329,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/idas/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/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. + # 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/idas/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/idas/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/idas/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/idas/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/CMakeLists.txt b/examples/kinsol/CMakeLists.txt index 67657f9399..46c2da46a9 100644 --- a/examples/kinsol/CMakeLists.txt +++ b/examples/kinsol/CMakeLists.txt @@ -19,7 +19,8 @@ if(EXAMPLES_ENABLE_C) add_subdirectory(serial) if(ENABLE_OPENMP AND OPENMP_FOUND) - # the only example here need special handling from testrunner (not yet implemented) + # the only example here need special handling from testrunner (not yet + # implemented) add_subdirectory(C_openmp) endif() if(ENABLE_MPI AND MPI_C_FOUND) @@ -32,7 +33,10 @@ if(EXAMPLES_ENABLE_CXX) if(ENABLE_MPI AND MPI_CXX_FOUND) add_subdirectory(CXX_parallel) endif() - if(ENABLE_MPI AND MPI_CXX_FOUND AND ENABLE_HYPRE AND HYPRE_FOUND) + if(ENABLE_MPI + AND MPI_CXX_FOUND + AND ENABLE_HYPRE + AND HYPRE_FOUND) add_subdirectory(CXX_parhyp) endif() endif() diff --git a/examples/kinsol/CUDA_mpi/CMakeLists.txt b/examples/kinsol/CUDA_mpi/CMakeLists.txt index cc134aacfe..c938ca7702 100644 --- a/examples/kinsol/CUDA_mpi/CMakeLists.txt +++ b/examples/kinsol/CUDA_mpi/CMakeLists.txt @@ -18,12 +18,10 @@ # for examples excluded from 'make test' in releases. # Examples to build -set(KINSOL_examples - "kin_em_mpicuda.cu\;1\;2\;develop") +set(KINSOL_examples "kin_em_mpicuda.cu\;1\;2\;develop") # Header files to install -set(KINSOL_headers - "kin_em_mpicuda.hpp") +set(KINSOL_headers "kin_em_mpicuda.hpp") # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -46,15 +44,14 @@ foreach(example_tuple ${KINSOL_examples}) target_include_directories(${example_target} PRIVATE ${MPI_CXX_INCLUDE_DIRS}) # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_kinsol - sundials_nvecmpiplusx - sundials_nveccuda - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_kinsol sundials_nvecmpiplusx sundials_nveccuda + ${MPI_CXX_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) # add example to regression tests - sundials_add_test(${example_target} ${example_target} + sundials_add_test( + ${example_target} ${example_target} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example_target}.out @@ -62,28 +59,17 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(kinsol KINSOL_examples - CMAKE_TEMPLATE - cmakelists_CUDA_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_CUDA_ex.in - SOLVER_LIBRARY - sundials_kinsol - SUNDIALS_TARGETS - kinsol - nvecmpiplusx - nveccuda - DESTINATION - kinsol/CUDA_mpi - EXTRA_FILES - ${KINSOL_headers} - README - TEST_INSTALL - CUDA_mpi - ) + sundials_install_examples( + kinsol KINSOL_examples + CMAKE_TEMPLATE cmakelists_CUDA_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_CUDA_ex.in + SOLVER_LIBRARY sundials_kinsol + SUNDIALS_TARGETS kinsol nvecmpiplusx nveccuda + DESTINATION kinsol/CUDA_mpi + EXTRA_FILES ${KINSOL_headers} README + TEST_INSTALL CUDA_mpi) endif() diff --git a/examples/kinsol/CXX_parallel/CMakeLists.txt b/examples/kinsol/CXX_parallel/CMakeLists.txt index 83c6501b77..64657bdae9 100644 --- a/examples/kinsol/CXX_parallel/CMakeLists.txt +++ b/examples/kinsol/CXX_parallel/CMakeLists.txt @@ -18,9 +18,8 @@ # develop for examples excluded from 'make test' in releases. # Examples to build -set(KINSOL_examples - "kin_heat2D_nonlin_p.cpp\;--np 2 2\;1\;4\;exclude-single" - "kin_em_p.cpp\;\;1\;2\;exclude-single") +set(KINSOL_examples "kin_heat2D_nonlin_p.cpp\;--np 2 2\;1\;4\;exclude-single" + "kin_em_p.cpp\;\;1\;2\;exclude-single") # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -43,13 +42,10 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_kinsol - sundials_nvecparallel - sundials_nvecmpiplusx - sundials_nvecserial - MPI::MPI_CXX - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_kinsol sundials_nvecparallel sundials_nvecmpiplusx + sundials_nvecserial MPI::MPI_CXX ${EXE_EXTRA_LINK_LIBS}) endif() @@ -61,7 +57,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add regression test - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -70,28 +67,17 @@ foreach(example_tuple ${KINSOL_examples}) endforeach() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) - sundials_install_examples(kinsol KINSOL_examples - CMAKE_TEMPLATE - cmakelists_CXX_MPI_ex.in - MAKE_TEMPLATE - makefile_parallel_CXX_ex.in - SOLVER_LIBRARY - sundials_kinsol - SUNDIALS_TARGETS - kinsol - nvecparallel - nvecmpiplusx - nvecserial - DESTINATION - kinsol/CXX_parallel - EXTRA_FILES - README - TEST_INSTALL - CXX_parallel - ) + sundials_install_examples( + kinsol KINSOL_examples + CMAKE_TEMPLATE cmakelists_CXX_MPI_ex.in + MAKE_TEMPLATE makefile_parallel_CXX_ex.in + SOLVER_LIBRARY sundials_kinsol + SUNDIALS_TARGETS kinsol nvecparallel nvecmpiplusx nvecserial + DESTINATION kinsol/CXX_parallel + EXTRA_FILES README + TEST_INSTALL CXX_parallel) endif() diff --git a/examples/kinsol/CXX_parhyp/CMakeLists.txt b/examples/kinsol/CXX_parhyp/CMakeLists.txt index fb9e2540df..6f5fe21285 100644 --- a/examples/kinsol/CXX_parhyp/CMakeLists.txt +++ b/examples/kinsol/CXX_parhyp/CMakeLists.txt @@ -14,18 +14,15 @@ # CMakeLists.txt file for KINSOL C++ parhyp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kin_bratu2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" - "kin_heat2D_nonlin_hypre_pfmg\;--np 2 2\;1\;4\;develop" - ) +set(KINSOL_examples "kin_bratu2D_hypre_pfmg\;--np 2 2\;1\;4\;develop" + "kin_heat2D_nonlin_hypre_pfmg\;--np 2 2\;1\;4\;develop") -set(KINSOL_headers - "kin_bratu2D_hypre_pfmg.hpp" - "kin_heat2D_nonlin_hypre_pfmg.hpp") +set(KINSOL_headers "kin_bratu2D_hypre_pfmg.hpp" + "kin_heat2D_nonlin_hypre_pfmg.hpp") # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -34,7 +31,6 @@ set(NVECP_LIB sundials_nvecparallel) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIB} ${NVECP_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build target for each example foreach(example_tuple ${KINSOL_examples}) @@ -45,8 +41,8 @@ foreach(example_tuple ${KINSOL_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) @@ -55,8 +51,8 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - MPI::MPI_CXX ${SUNDIALS_LIBS} SUNDIALS::HYPRE) + target_link_libraries(${example} PRIVATE MPI::MPI_CXX ${SUNDIALS_LIBS} + SUNDIALS::HYPRE) endif() # check if example args are provided and set the test name @@ -67,7 +63,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -80,18 +77,18 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.cpp ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) endif() endforeach(example_tuple ${KINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the header files foreach(extrafile ${KINSOL_headers}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) endforeach() # Install the README file @@ -104,39 +101,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp) # 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. + # 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_parhyp_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/CXX_parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/CXX_parhyp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/C_openmp/CMakeLists.txt b/examples/kinsol/C_openmp/CMakeLists.txt index 1fa6c190c9..80beb7a8aa 100644 --- a/examples/kinsol/C_openmp/CMakeLists.txt +++ b/examples/kinsol/C_openmp/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for KINSOL OpenMP examples # ----------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kinFoodWeb_kry_omp\;4\;develop" - ) +set(KINSOL_examples "kinFoodWeb_kry_omp\;4\;develop") # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -42,9 +40,11 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") - if (NOT ${example} MATCHES "kinFoodWeb_kry_omp") # No test until TestRunner modified for OpenMP + if(NOT ${example} MATCHES "kinFoodWeb_kry_omp") # No test until TestRunner + # modified for OpenMP # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -57,12 +57,11 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp) endif() endforeach(example_tuple ${KINSOL_examples_OMP}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -76,39 +75,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_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. + # 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/kinsol/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/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. + # 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/kinsol/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/F2003_parallel/CMakeLists.txt b/examples/kinsol/F2003_parallel/CMakeLists.txt index d6ea17cb03..53fe77561c 100644 --- a/examples/kinsol/F2003_parallel/CMakeLists.txt +++ b/examples/kinsol/F2003_parallel/CMakeLists.txt @@ -15,19 +15,15 @@ # CMakeLists.txt file for the KINsol F2003 module parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases if(SUNDIALS_INDEX_SIZE MATCHES "64") - set(FKINSOL_examples - "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") + set(FKINSOL_examples "kin_diagon_kry_f2003\;\;1\;4\;develop\;2") endif() # Specify libraries to link against -set(KINSOL_LIBS - sundials_kinsol - sundials_fkinsol_mod - sundials_nvecparallel - sundials_fnvecparallel_mod) +set(KINSOL_LIBS sundials_kinsol sundials_fkinsol_mod sundials_nvecparallel + sundials_fnvecparallel_mod) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIBS} ${EXE_EXTRA_LINK_LIBS}) @@ -45,7 +41,8 @@ foreach(example_tuple ${FKINSOL_examples}) if(NOT TARGET ${example}) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -64,7 +61,8 @@ foreach(example_tuple ${FKINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} @@ -78,19 +76,18 @@ foreach(example_tuple ${FKINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example_out} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) endif() endforeach(example_tuple ${FKINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${KINSOL_extras}) install(FILES ${extrafile} - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -101,45 +98,39 @@ if(EXAMPLES_INSTALL) # CMakeLists: replace sundials_ prefix and convert to space separted string list(TRANSFORM KINSOL_LIBS REPLACE "sundials_" "SUNDIALS::" - OUTPUT_VARIABLE EXAMPLES_CMAKE_TARGETS_tmp) + 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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel - ) + DESTINATION ${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. + # 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 - ) + ${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 ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/F2003_serial/CMakeLists.txt b/examples/kinsol/F2003_serial/CMakeLists.txt index 1bca9e8dd3..6a71b7c40a 100644 --- a/examples/kinsol/F2003_serial/CMakeLists.txt +++ b/examples/kinsol/F2003_serial/CMakeLists.txt @@ -14,17 +14,14 @@ # CMakeLists.txt file for the F2003 KINSOL serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases -set(FKINSOL_examples - "kinDiagon_kry_f2003\;\;develop") +# Example lists are tuples "name\;type" where the type is 'develop' for examples +# excluded from 'make test' in releases +set(FKINSOL_examples "kinDiagon_kry_f2003\;\;develop") if(SUNDIALS_INDEX_SIZE MATCHES "64") - list(APPEND FKINSOL_examples - "kinRoboKin_dns_f2003\;\;develop" - "kinLaplace_bnd_f2003\;\;develop" - "kinLaplace_picard_kry_f2003\;\;develop" - ) + list(APPEND FKINSOL_examples "kinRoboKin_dns_f2003\;\;develop" + "kinLaplace_bnd_f2003\;\;develop" + "kinLaplace_picard_kry_f2003\;\;develop") endif() # Specify libraries to link against @@ -41,7 +38,8 @@ foreach(example_tuple ${FKINSOL_examples}) list(GET example_tuple 2 example_type) # Install fortran modules to a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files add_executable(${example} ${example}.f90) @@ -49,7 +47,8 @@ foreach(example_tuple ${FKINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -58,10 +57,10 @@ foreach(example_tuple ${FKINSOL_examples}) # libraries to link against target_link_libraries(${example} ${SUNDIALS_LIBS}) - # install example source and out files + # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.f90 ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial) endif() endforeach(example_tuple ${FKINSOL_examples}) @@ -76,39 +75,33 @@ if(EXAMPLES_INSTALL) 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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_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. + # 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_F2003_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/F2003_serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/F2003_serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/parallel/CMakeLists.txt b/examples/kinsol/parallel/CMakeLists.txt index 2b3cbf7c88..e043a6b221 100644 --- a/examples/kinsol/parallel/CMakeLists.txt +++ b/examples/kinsol/parallel/CMakeLists.txt @@ -14,14 +14,12 @@ # CMakeLists.txt file for KINSOL parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;nodes\;tasks\;type" where the type is develop +# for examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers -set(KINSOL_examples - "kinFoodWeb_kry_bbd_p\;1\;4\;exclude-single" - "kinFoodWeb_kry_p\;1\;4\;exclude-single" - ) +set(KINSOL_examples "kinFoodWeb_kry_bbd_p\;1\;4\;exclude-single" + "kinFoodWeb_kry_p\;1\;4\;exclude-single") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -53,7 +51,8 @@ foreach(example_tuple ${KINSOL_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} MPI_NPROCS ${number_of_tasks} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out @@ -69,12 +68,11 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel) endif() endforeach(example_tuple ${KINSOL_examples}) - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -88,39 +86,32 @@ if(EXAMPLES_INSTALL) examples2string(KINSOL_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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/parallel - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/kinsol/serial/CMakeLists.txt b/examples/kinsol/serial/CMakeLists.txt index 9ca7edb76f..47d5fae83a 100644 --- a/examples/kinsol/serial/CMakeLists.txt +++ b/examples/kinsol/serial/CMakeLists.txt @@ -15,47 +15,39 @@ # CMakeLists.txt file for KINSOL serial examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS linear solvers set(KINSOL_examples - "kinAnalytic_fp\;\;" - "kinAnalytic_fp\;--damping_fp 0.5\;develop" - "kinAnalytic_fp\;--m_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --delay_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --damping_aa 0.5\;develop" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 1\;" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 2\;" - "kinAnalytic_fp\;--m_aa 2 --orth_aa 3\;" - "kinFerTron_dns\;\;develop" - "kinFoodWeb_kry\;\;exclude-single" - "kinKrylovDemo_ls\;\;exclude-single" - "kinLaplace_bnd\;\;exclude-single" - "kinLaplace_picard_bnd\;\;exclude-single" - "kinLaplace_picard_kry\;\;exclude-single" - "kinRoberts_fp\;\;develop" - "kinRoboKin_dns\;\;exclude-single" - ) + "kinAnalytic_fp\;\;" + "kinAnalytic_fp\;--damping_fp 0.5\;develop" + "kinAnalytic_fp\;--m_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --delay_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --damping_aa 0.5\;develop" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 1\;" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 2\;" + "kinAnalytic_fp\;--m_aa 2 --orth_aa 3\;" + "kinFerTron_dns\;\;develop" + "kinFoodWeb_kry\;\;exclude-single" + "kinKrylovDemo_ls\;\;exclude-single" + "kinLaplace_bnd\;\;exclude-single" + "kinLaplace_picard_bnd\;\;exclude-single" + "kinLaplace_picard_kry\;\;exclude-single" + "kinRoberts_fp\;\;develop" + "kinRoboKin_dns\;\;exclude-single") # Examples using LAPACK linear solvers -set(KINSOL_examples_BL - ) +set(KINSOL_examples_BL) # Examples using KLU linear solver -set(KINSOL_examples_KLU - "kinFerTron_klu\;develop" - ) +set(KINSOL_examples_KLU "kinFerTron_klu\;develop") # Examples using SuperLU_MT linear solver -set(KINSOL_examples_SUPERLUMT - "kinRoboKin_slu\;develop" - ) +set(KINSOL_examples_SUPERLUMT "kinRoboKin_slu\;develop") # Auxiliary files to install -set(KINSOL_extras - kinRoboKin_dns_stats.csv - ) +set(KINSOL_extras kinRoboKin_dns_stats.csv) # Specify libraries to link against set(KINSOL_LIB sundials_kinsol) @@ -64,7 +56,6 @@ set(NVECS_LIB sundials_nvecserial) # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${KINSOL_LIB} ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${KINSOL_examples}) @@ -73,8 +64,8 @@ foreach(example_tuple ${KINSOL_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -95,7 +86,8 @@ foreach(example_tuple ${KINSOL_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out @@ -107,19 +99,17 @@ foreach(example_tuple ${KINSOL_examples}) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples}) - # Add the build and install targets for each LAPACK example (if needed) if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # Sundials LAPACK linear solver modules - set(SUNLINSOLLAPACK_LIBS - sundials_sunlinsollapackband - sundials_sunlinsollapackdense) + set(SUNLINSOLLAPACK_LIBS sundials_sunlinsollapackband + sundials_sunlinsollapackdense) # LAPACK libraries list(APPEND SUNLINSOLLAPACK_LIBS ${LAPACK_LIBRARIES}) @@ -136,7 +126,8 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -147,14 +138,13 @@ if(BUILD_SUNLINSOL_LAPACKBAND AND BUILD_SUNLINSOL_LAPACKDENSE) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_BL}) endif() - # Add the build and install targets for each KLU example (if needed) if(BUILD_SUNLINSOL_KLU) @@ -176,7 +166,8 @@ if(BUILD_SUNLINSOL_KLU) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -187,14 +178,13 @@ if(BUILD_SUNLINSOL_KLU) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_KLU}) endif() - # Add the build and install targets for each SuperLU_MT example (if needed) if(BUILD_SUNLINSOL_SUPERLUMT) @@ -216,7 +206,8 @@ if(BUILD_SUNLINSOL_SUPERLUMT) set_target_properties(${example} PROPERTIES FOLDER "Examples") # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test( + ${example} ${example} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${example}.out EXAMPLE_TYPE ${example_type}) @@ -227,14 +218,13 @@ if(BUILD_SUNLINSOL_SUPERLUMT) # install example source and out files if(EXAMPLES_INSTALL) install(FILES ${example}.c ${example}.out - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endif() endforeach(example_tuple ${KINSOL_examples_SUPERLUMT}) endif() - # create Makfile and CMakeLists.txt for examples if(EXAMPLES_INSTALL) @@ -243,7 +233,8 @@ if(EXAMPLES_INSTALL) # Install the extra files foreach(extrafile ${KINSOL_extras}) - install(FILES ${extrafile} DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) + install(FILES ${extrafile} + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial) endforeach() # Prepare substitution variables for Makefile and/or CMakeLists templates @@ -266,7 +257,7 @@ if(EXAMPLES_INSTALL) if(BUILD_SUNLINSOL_SUPERLUMT) examples2string(KINSOL_examples_SUPERLUMT EXAMPLES_SLUMT) - if (SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") + if(SUNDIALS_SUPERLUMT_THREAD_TYPE STREQUAL "PTHREAD") set(THREAD_LIBRARY_SLUMT ${CMAKE_THREAD_LIBS_INIT}) else() set(THREAD_LIBRARY_SLUMT "") @@ -277,39 +268,32 @@ if(EXAMPLES_INSTALL) 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. + # 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/kinsol/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/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. + # 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/kinsol/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/kinsol/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/kinsol/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/kinsol/serial - RENAME Makefile - ) + RENAME Makefile) endif() # add test_install target diff --git a/examples/nvector/CMakeLists.txt b/examples/nvector/CMakeLists.txt index 54aa22f08d..35a9279997 100644 --- a/examples/nvector/CMakeLists.txt +++ b/examples/nvector/CMakeLists.txt @@ -26,12 +26,12 @@ add_subdirectory(serial) # Build the nvector test utilities add_library(test_nvector_obj OBJECT test_nvector.c) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib + # need PIC when shared libs are used since the example executables will link + # to the shared lib set_property(TARGET test_nvector_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) endif() target_link_libraries(test_nvector_obj PRIVATE sundials_nvecserial) - if(ENABLE_MPI AND MPI_C_FOUND) add_subdirectory(parallel) if(BUILD_NVECTOR_MPIMANYVECTOR) @@ -41,9 +41,11 @@ if(ENABLE_MPI AND MPI_C_FOUND) # Build the mpi nvector test utilities add_library(test_nvectormpi_obj OBJECT test_mpinvector.c) if(BUILD_SHARED_LIBS) - set_property(TARGET test_nvectormpi_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + set_property(TARGET test_nvectormpi_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() - target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C sundials_nvecparallel) + target_link_libraries(test_nvectormpi_obj PRIVATE MPI::MPI_C + sundials_nvecparallel) endif() if(BUILD_NVECTOR_MANYVECTOR) add_subdirectory(manyvector) diff --git a/examples/nvector/C_openmp/CMakeLists.txt b/examples/nvector/C_openmp/CMakeLists.txt index b332f20064..5ed142e6da 100644 --- a/examples/nvector/C_openmp/CMakeLists.txt +++ b/examples/nvector/C_openmp/CMakeLists.txt @@ -14,28 +14,21 @@ # CMakeLists.txt file for OpenMP nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS OpenMP nvector set(nvector_openmp_examples - "test_nvector_openmp\;1000 1 0\;" - "test_nvector_openmp\;1000 2 0\;" - "test_nvector_openmp\;1000 4 0\;" - "test_nvector_openmp\;10000 1 0\;" - "test_nvector_openmp\;10000 2 0\;" - "test_nvector_openmp\;10000 4 0\;" - ) + "test_nvector_openmp\;1000 1 0\;" "test_nvector_openmp\;1000 2 0\;" + "test_nvector_openmp\;1000 4 0\;" "test_nvector_openmp\;10000 1 0\;" + "test_nvector_openmp\;10000 2 0\;" "test_nvector_openmp\;10000 4 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_openmp_fortran_examples - "test_fnvector_openmp_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_openmp_fortran_examples "test_fnvector_openmp_mod\;\;") endif() # Add source directory to include directories @@ -43,7 +36,7 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecopenmp) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecopenmp_mod) endif() @@ -58,8 +51,8 @@ foreach(example_tuple ${nvector_openmp_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -82,17 +75,16 @@ foreach(example_tuple ${nvector_openmp_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp) endif() endforeach(example_tuple ${nvector_openmp_examples}) @@ -105,14 +97,17 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -131,7 +126,8 @@ foreach(example_tuple ${nvector_openmp_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -150,39 +146,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/nvector/C_openmp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/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. + # 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/nvector/C_openmp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/C_openmp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/C_openmp - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/cuda/CMakeLists.txt b/examples/nvector/cuda/CMakeLists.txt index 99893704f8..e60c7f11ef 100644 --- a/examples/nvector/cuda/CMakeLists.txt +++ b/examples/nvector/cuda/CMakeLists.txt @@ -14,20 +14,16 @@ # CMakeLists.txt file for CUDA nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS cuda nvector set(nvector_cuda_examples - "test_nvector_cuda\;3 32 0\;\;\;" - "test_nvector_cuda\;500 128 0\;\;\;" - "test_nvector_cuda\;1000 0 0\;\;\;" - ) + "test_nvector_cuda\;3 32 0\;\;\;" "test_nvector_cuda\;500 128 0\;\;\;" + "test_nvector_cuda\;1000 0 0\;\;\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -48,8 +44,8 @@ foreach(example_tuple ${nvector_cuda_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) @@ -75,28 +71,28 @@ foreach(example_tuple ${nvector_cuda_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cu - ../test_nvector.c - ../test_nvector.h - ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h + install( + FILES ${example}.cu ../test_nvector.c ../test_nvector.h + ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda) endif() endforeach(example_tuple ${nvector_cuda_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -109,39 +105,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/cuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/cuda - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/hip/CMakeLists.txt b/examples/nvector/hip/CMakeLists.txt index f2ef2e7621..9d303d2ccd 100644 --- a/examples/nvector/hip/CMakeLists.txt +++ b/examples/nvector/hip/CMakeLists.txt @@ -14,8 +14,8 @@ # CMakeLists.txt file for HIP nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases if(HIP_PLATFORM STREQUAL "nvcc") set(_warp_size 32) @@ -25,10 +25,9 @@ endif() # Examples using SUNDIALS hip nvector set(nvector_hip_examples - "test_nvector_hip.cpp\;3 ${_warp_size} 0\;\;\;" - "test_nvector_hip.cpp\;500 128 0\;\;\;" - "test_nvector_hip.cpp\;1000 0 0\;\;\;" - ) + "test_nvector_hip.cpp\;3 ${_warp_size} 0\;\;\;" + "test_nvector_hip.cpp\;500 128 0\;\;\;" + "test_nvector_hip.cpp\;1000 0 0\;\;\;") # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -52,8 +51,8 @@ foreach(example_tuple ${nvector_hip_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -73,18 +72,21 @@ foreach(example_tuple ${nvector_hip_examples}) if("${number_of_tasks}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_tasks}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_tasks}) endif() else() if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -93,18 +95,14 @@ endforeach(example_tuple ${nvector_hip_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(nvector nvector_hip_examples - SUNDIALS_TARGETS - nvechip - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvector nvector_hip_examples + SUNDIALS_TARGETS nvechip + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES - ../test_nvector.c - ../test_nvector.h + ../test_nvector.c ../test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_gpu.h - CMAKE_TEMPLATE - cmakelists_HIP_ex.in - DESTINATION - nvector/hip) + CMAKE_TEMPLATE cmakelists_HIP_ex.in + DESTINATION nvector/hip) endif(EXAMPLES_INSTALL) diff --git a/examples/nvector/kokkos/CMakeLists.txt b/examples/nvector/kokkos/CMakeLists.txt index 6f1d8bf9f6..648d867ea0 100644 --- a/examples/nvector/kokkos/CMakeLists.txt +++ b/examples/nvector/kokkos/CMakeLists.txt @@ -14,11 +14,9 @@ # CMakeLists.txt file for Kokkos nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_nvector_kokkos.cpp\;1000 0\;" -) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_nvector_kokkos.cpp\;1000 0\;") include_directories(..) @@ -35,8 +33,8 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -48,10 +46,8 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # link vector test utilties - target_link_libraries(${example_target} PRIVATE - test_nvector_obj - sundials_nveckokkos - ) + target_link_libraries(${example_target} PRIVATE test_nvector_obj + sundials_nveckokkos) endif() # check if example args are provided and set the test name @@ -62,7 +58,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -72,22 +69,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(nvec_kokkos examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c - ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - DESTINATION - nvector/kokkos - ) + sundials_install_examples( + nvec_kokkos examples_list + EXAMPLES_DEPENDENCIES test_nvector.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c + ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos + DESTINATION nvector/kokkos) endif() diff --git a/examples/nvector/manyvector/CMakeLists.txt b/examples/nvector/manyvector/CMakeLists.txt index a43d1e4c15..abba295138 100644 --- a/examples/nvector/manyvector/CMakeLists.txt +++ b/examples/nvector/manyvector/CMakeLists.txt @@ -14,24 +14,19 @@ # CMakeLists.txt file for ManyVector nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS manyvector nvector -set(nvector_manyvector_examples - "test_nvector_manyvector\;1000 100 0\;" - "test_nvector_manyvector\;100 1000 0\;" - ) +set(nvector_manyvector_examples "test_nvector_manyvector\;1000 100 0\;" + "test_nvector_manyvector\;100 1000 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_manyvector_fortran_examples - "test_fnvector_manyvector_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_manyvector_fortran_examples "test_fnvector_manyvector_mod\;\;") endif() # Add source directory to include directories @@ -39,14 +34,13 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecserial sundials_nvecmanyvector) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecserial_mod sundials_fnvecmanyvector_mod) endif() # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${nvector_manyvector_examples}) @@ -55,8 +49,8 @@ foreach(example_tuple ${nvector_manyvector_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -79,17 +73,16 @@ foreach(example_tuple ${nvector_manyvector_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector) endif() endforeach(example_tuple ${nvector_manyvector_examples}) @@ -102,14 +95,17 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -128,7 +124,8 @@ foreach(example_tuple ${nvector_manyvector_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -147,39 +144,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/nvector/manyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/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. + # 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/nvector/manyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/manyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/manyvector - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpicuda/CMakeLists.txt b/examples/nvector/mpicuda/CMakeLists.txt index ce44c0c26e..35f33a5e1b 100644 --- a/examples/nvector/mpicuda/CMakeLists.txt +++ b/examples/nvector/mpicuda/CMakeLists.txt @@ -14,20 +14,17 @@ # CMakeLists.txt file for MPIPlusX, X = CUDA NVECTOR examples. # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI+cuda nvector set(nvector_cuda_examples - "test_nvector_mpicuda\;1000 0\;\;\;" # run sequentially - "test_nvector_mpicuda\;1000 0\;1\;4\;" # run parallel on 4 - ) + "test_nvector_mpicuda\;1000 0\;\;\;" # run sequentially + "test_nvector_mpicuda\;1000 0\;1\;4\;" # run parallel on 4 +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -48,14 +45,15 @@ foreach(example_tuple ${nvector_cuda_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cu) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -79,12 +77,14 @@ foreach(example_tuple ${nvector_cuda_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -92,16 +92,13 @@ foreach(example_tuple ${nvector_cuda_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cu - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) + install(FILES ${example}.cu ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) endif() endforeach(example_tuple ${nvector_cuda_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -111,39 +108,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda) # 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. + # 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_CUDA_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpicuda/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpicuda - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpimanyvector/CMakeLists.txt b/examples/nvector/mpimanyvector/CMakeLists.txt index 66c7253bc9..b6f185aa1f 100644 --- a/examples/nvector/mpimanyvector/CMakeLists.txt +++ b/examples/nvector/mpimanyvector/CMakeLists.txt @@ -14,38 +14,36 @@ # CMakeLists.txt file for MPIManyVector nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPIManyVector module set(nvector_mpimanyvector_examples - "test_nvector_mpimanyvector_parallel1\;1000 200 0\;1\;4\;" # run parallel on 4 procs - "test_nvector_mpimanyvector_parallel2\;200 1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpimanyvector_parallel1\;1000 200 0\;1\;4\;" # run parallel on + # 4 procs + "test_nvector_mpimanyvector_parallel2\;200 1000 0\;1\;4\;" # run parallel on + # 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(nvector_mpimanyvector_fortran_examples - "test_fnvector_mpimanyvector_mod\;\;1\;1\;" - "test_fnvector_mpimanyvector_mod\;\;1\;4\;") + "test_fnvector_mpimanyvector_mod\;\;1\;1\;" + "test_fnvector_mpimanyvector_mod\;\;1\;4\;") endif() # Add source directory to include directories include_directories(. ..) # Specify libraries to link against -set(NVECS_LIB sundials_nvecmpimanyvector - sundials_nvecparallel +set(NVECS_LIB sundials_nvecmpimanyvector sundials_nvecparallel sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecmpimanyvector_mod - sundials_fnvecserial_mod) + sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries @@ -59,7 +57,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -69,7 +67,6 @@ if (BUILD_FORTRAN_MODULE_INTERFACE) endif() endif() - # Add the build and install targets for each example foreach(example_tuple ${nvector_mpimanyvector_examples}) @@ -80,14 +77,15 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -111,12 +109,14 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -124,11 +124,9 @@ foreach(example_tuple ${nvector_mpimanyvector_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) endif() endforeach(example_tuple ${nvector_mpimanyvector_examples}) @@ -143,14 +141,17 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -176,12 +177,14 @@ foreach(example_tuple ${nvector_mpimanyvector_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -201,39 +204,33 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpimanyvector/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpimanyvector - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpiplusx/CMakeLists.txt b/examples/nvector/mpiplusx/CMakeLists.txt index 195bcb6868..88e551386b 100644 --- a/examples/nvector/mpiplusx/CMakeLists.txt +++ b/examples/nvector/mpiplusx/CMakeLists.txt @@ -14,37 +14,30 @@ # CMakeLists.txt file for parallel MPIPlusX nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI nvector set(nvector_mpiplusx_examples - "test_nvector_mpiplusx\;1000 9\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpiplusx\;1000 9\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_mpiplusx_fortran_examples - "test_fnvector_mpiplusx_mod\;\;1\;1\;" - "test_fnvector_mpiplusx_mod\;\;1\;4\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_mpiplusx_fortran_examples "test_fnvector_mpiplusx_mod\;\;1\;1\;" + "test_fnvector_mpiplusx_mod\;\;1\;4\;") endif() # Add source directory to include directories include_directories(. ..) # Specify libraries to link against -set(NVECS_LIB sundials_nvecmpiplusx - sundials_nvecparallel - sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) - list(APPEND NVECS_LIB sundials_fnvecmpiplusx_mod - sundials_fnvecserial_mod) +set(NVECS_LIB sundials_nvecmpiplusx sundials_nvecparallel sundials_nvecserial) +if(BUILD_FORTRAN_MODULE_INTERFACE) + list(APPEND NVECS_LIB sundials_fnvecmpiplusx_mod sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries @@ -58,7 +51,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -78,14 +71,15 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -109,12 +103,14 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -122,11 +118,9 @@ foreach(example_tuple ${nvector_mpiplusx_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) endif() endforeach(example_tuple ${nvector_mpiplusx_examples}) @@ -141,14 +135,17 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -174,12 +171,14 @@ foreach(example_tuple ${nvector_mpiplusx_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -199,39 +198,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/mpiplusx/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/mpiplusx - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/mpiraja/CMakeLists.txt b/examples/nvector/mpiraja/CMakeLists.txt index ffd97ab5a1..bd64a2cf78 100644 --- a/examples/nvector/mpiraja/CMakeLists.txt +++ b/examples/nvector/mpiraja/CMakeLists.txt @@ -14,12 +14,12 @@ # CMakeLists.txt file for raja nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases set(examples_list - "test_nvector_mpiraja.cpp\;1000 0\;\;\;" # run sequentially - "test_nvector_mpiraja.cpp\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpiraja.cpp\;1000 0\;\;\;" # run sequentially + "test_nvector_mpiraja.cpp\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Add source directory to include directories include_directories(. ..) @@ -47,8 +47,8 @@ foreach(example_tuple ${nvector_raja_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files @@ -60,15 +60,15 @@ foreach(example_tuple ${nvector_raja_examples}) target_include_directories(${example_target} PUBLIC ${MPI_CXX_INCLUDE_DIRS}) - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - test_nvectormpi_obj - sundials_nvecmpiplusx - sundials_nvecraja - ${MPI_CXX_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE test_nvector_obj + test_nvectormpi_obj + sundials_nvecmpiplusx + sundials_nvecraja + ${MPI_CXX_LIBRARIES} + ${EXE_EXTRA_LINK_LIBS} + ${OTHER_LIBS}) endif() @@ -83,12 +83,14 @@ foreach(example_tuple ${nvector_raja_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -98,35 +100,28 @@ endforeach() if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(nvec_mpiraja examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c - test_mpinvector.c + sundials_install_examples( + nvec_mpiraja examples_list + EXAMPLES_DEPENDENCIES test_nvector.c test_mpinvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_mpinvector.c - CMAKE_TEMPLATE - cmakelists_${_lang}_MPI_ex.in - SOLVER_LIBRARY - sundials_ida - SUNDIALS_TARGETS - generic - nvecmpiplusx - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - nvector/mpiraja - ) + CMAKE_TEMPLATE cmakelists_${_lang}_MPI_ex.in + SOLVER_LIBRARY sundials_ida + SUNDIALS_TARGETS generic nvecmpiplusx nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION nvector/mpiraja) endif() diff --git a/examples/nvector/openmpdev/CMakeLists.txt b/examples/nvector/openmpdev/CMakeLists.txt index f115e3c982..d1d301e125 100644 --- a/examples/nvector/openmpdev/CMakeLists.txt +++ b/examples/nvector/openmpdev/CMakeLists.txt @@ -14,19 +14,15 @@ # CMakeLists.txt file for OpenMP DEV nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS OpenMP DEV nvector -set(nvector_openmpdev_examples - "test_nvector_openmpdev\;1000 0\;" - "test_nvector_openmpdev\;10000 0\;" - ) +set(nvector_openmpdev_examples "test_nvector_openmpdev\;1000 0\;" + "test_nvector_openmpdev\;10000 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # Add source directory to include directories include_directories(. ..) @@ -47,8 +43,8 @@ foreach(example_tuple ${nvector_openmpdev_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -71,22 +67,20 @@ foreach(example_tuple ${nvector_openmpdev_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev) endif() endforeach() - if(EXAMPLES_INSTALL) # Install the README file @@ -99,39 +93,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/nvector/openmpdev/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/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. + # 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/nvector/openmpdev/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/openmpdev/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/openmpdev - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/parallel/CMakeLists.txt b/examples/nvector/parallel/CMakeLists.txt index bfdf74eec8..c49f6e2f6f 100644 --- a/examples/nvector/parallel/CMakeLists.txt +++ b/examples/nvector/parallel/CMakeLists.txt @@ -14,25 +14,21 @@ # CMakeLists.txt file for MPI nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS MPI nvector set(nvector_parallel_examples - "test_nvector_mpi\;1000 0\;\;\;" # run sequentially - "test_nvector_mpi\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_mpi\;1000 0\;\;\;" # run sequentially + "test_nvector_mpi\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_parallel_fortran_examples - "test_fnvector_parallel_mod\;\;1\;4\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_parallel_fortran_examples "test_fnvector_parallel_mod\;\;1\;4\;") endif() # Add source directory to include directories @@ -46,7 +42,7 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) if(MPI_Fortran_COMPILER) # use MPI wrapper as the compiler set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) @@ -66,8 +62,8 @@ foreach(example_tuple ${nvector_parallel_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -76,11 +72,9 @@ foreach(example_tuple ${nvector_parallel_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE - test_nvector_obj - test_nvectormpi_obj - sundials_nvecparallel - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} PRIVATE test_nvector_obj test_nvectormpi_obj + sundials_nvecparallel ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} PRIVATE ${MPI_LIBRARIES}) @@ -98,12 +92,14 @@ foreach(example_tuple ${nvector_parallel_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -111,11 +107,9 @@ foreach(example_tuple ${nvector_parallel_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel) endif() endforeach(example_tuple ${nvector_parallel_examples}) @@ -130,14 +124,17 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -145,10 +142,8 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_fnvecparallel_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_fnvecparallel_mod ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_Fortran_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -166,12 +161,14 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -179,7 +176,6 @@ foreach(example_tuple ${nvector_parallel_fortran_examples}) endforeach(example_tuple ${nvector_parallel_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -192,39 +188,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/parhyp/CMakeLists.txt b/examples/nvector/parhyp/CMakeLists.txt index 2c51e65c59..90b2f7e11a 100644 --- a/examples/nvector/parhyp/CMakeLists.txt +++ b/examples/nvector/parhyp/CMakeLists.txt @@ -14,20 +14,17 @@ # CMakeLists.txt file for hypre nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS parallel hypre nvector set(nvector_parhyp_examples - "test_nvector_parhyp\;1000 0\;1\;1\;" # run sequentially - "test_nvector_parhyp\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_parhyp\;1000 0\;1\;1\;" # run sequentially + "test_nvector_parhyp\;1000 0\;1\;4\;" # run parallel on 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -61,14 +58,15 @@ foreach(example_tuple ${nvector_parhyp_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -92,12 +90,14 @@ foreach(example_tuple ${nvector_parhyp_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -105,11 +105,9 @@ foreach(example_tuple ${nvector_parhyp_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - ../test_mpinvector.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + ../test_mpinvector.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) endif() endforeach(example_tuple ${nvector_parhyp_examples}) @@ -126,39 +124,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_parhyp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp) # 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. + # 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_parhyp_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/parhyp/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/parhyp - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/petsc/CMakeLists.txt b/examples/nvector/petsc/CMakeLists.txt index 7c838ee724..db3d53c851 100644 --- a/examples/nvector/petsc/CMakeLists.txt +++ b/examples/nvector/petsc/CMakeLists.txt @@ -14,20 +14,16 @@ # CMakeLists.txt file for PETSc nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS PETSc nvector -set(nvector_petsc_examples - "test_nvector_petsc\;1000 0\;\;\;" # run sequentially - "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs - ) +set(nvector_petsc_examples "test_nvector_petsc\;1000 0\;\;\;" # run sequentially + "test_nvector_petsc\;1000 0\;1\;4\;" # run 4 procs +) # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) +set(nvector_examples_dependencies test_nvector test_mpinvector) # Add source directory to include directories include_directories(. ..) @@ -47,7 +43,6 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() - # Add the build and install targets for each nvector example foreach(example_tuple ${nvector_petsc_examples}) @@ -58,14 +53,15 @@ foreach(example_tuple ${nvector_petsc_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) # link vector test utilties - target_link_libraries(${example} PRIVATE test_nvector_obj test_nvectormpi_obj) + target_link_libraries(${example} PRIVATE test_nvector_obj + test_nvectormpi_obj) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -89,12 +85,14 @@ foreach(example_tuple ${nvector_petsc_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -102,16 +100,13 @@ foreach(example_tuple ${nvector_petsc_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) + install(FILES ${example}.c ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) endif() endforeach(example_tuple ${nvector_petsc_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -124,39 +119,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/petsc/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/petsc - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/pthreads/CMakeLists.txt b/examples/nvector/pthreads/CMakeLists.txt index e9fefd7191..4dc45ff76d 100644 --- a/examples/nvector/pthreads/CMakeLists.txt +++ b/examples/nvector/pthreads/CMakeLists.txt @@ -14,28 +14,21 @@ # CMakeLists.txt file for PThread nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS pthread nvector set(nvector_pthreads_examples - "test_nvector_pthreads\;1000 1 0\;" - "test_nvector_pthreads\;1000 2 0\;" - "test_nvector_pthreads\;1000 4 0\;" - "test_nvector_pthreads\;10000 1 0\;" - "test_nvector_pthreads\;10000 2 0\;" - "test_nvector_pthreads\;10000 4 0\;" - ) + "test_nvector_pthreads\;1000 1 0\;" "test_nvector_pthreads\;1000 2 0\;" + "test_nvector_pthreads\;1000 4 0\;" "test_nvector_pthreads\;10000 1 0\;" + "test_nvector_pthreads\;10000 2 0\;" "test_nvector_pthreads\;10000 4 0\;") # Dependencies for nvector examples -set(nvector_examples_dependencies - test_nvector - ) +set(nvector_examples_dependencies test_nvector) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_pthreads_fortran_examples - "test_fnvector_pthreads_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_pthreads_fortran_examples "test_fnvector_pthreads_mod\;\;") endif() # Add source directory to include directories @@ -43,7 +36,7 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecpthreads) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecpthreads_mod) endif() @@ -58,8 +51,8 @@ foreach(example_tuple ${nvector_pthreads_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -71,7 +64,8 @@ foreach(example_tuple ${nvector_pthreads_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS} + ${CMAKE_THREAD_LIBS_INIT}) endif() # check if example args are provided and set the test name @@ -82,17 +76,16 @@ foreach(example_tuple ${nvector_pthreads_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) endif() endforeach(example_tuple ${nvector_pthreads_examples}) @@ -105,14 +98,17 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -131,7 +127,8 @@ foreach(example_tuple ${nvector_pthreads_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -150,39 +147,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_pthreads_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads) # 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. + # 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_pthreads_C_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/pthreads/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/pthreads - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/raja/CMakeLists.txt b/examples/nvector/raja/CMakeLists.txt index ad87ee3902..3e8d716eaf 100644 --- a/examples/nvector/raja/CMakeLists.txt +++ b/examples/nvector/raja/CMakeLists.txt @@ -14,15 +14,12 @@ # CMakeLists.txt file for raja nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_nvector_raja.cpp\;1000 0\;" - ) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_nvector_raja.cpp\;1000 0\;") # Add source directory to include directories -include_directories(. .. - ${SUNDIALS_SOURCE_DIR}/examples/utilities) +include_directories(. .. ${SUNDIALS_SOURCE_DIR}/examples/utilities) if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_lang CUDA) @@ -51,8 +48,8 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # add example source files @@ -63,12 +60,9 @@ foreach(example_tuple ${examples_list}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - sundials_nvecraja - ${EXE_EXTRA_LINK_LIBS} - ${OTHER_LIBS}) + target_link_libraries( + ${example_target} PRIVATE test_nvector_obj sundials_nvecraja + ${EXE_EXTRA_LINK_LIBS} ${OTHER_LIBS}) endif() @@ -80,7 +74,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -89,31 +84,27 @@ endforeach() if(EXAMPLES_INSTALL) - if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP")) + if((RAJA_BACKENDS MATCHES "TARGET_OPENMP") OR (RAJA_BACKENDS MATCHES "OPENMP" + )) set(EXAMPLES_FIND_PACKAGE "find_package(OpenMP REQUIRED)\n") set(_openmp_target OpenMP::OpenMP_CXX) endif() if(RAJA_NEEDS_THREADS) - set(EXAMPLES_FIND_PACKAGE "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") + set(EXAMPLES_FIND_PACKAGE + "${EXAMPLES_FIND_PACKAGE}find_package(Threads REQUIRED)\n") endif() - sundials_install_examples(nvec_raja examples_list - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvec_raja examples_list + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/${_custom_memhelper} - CMAKE_TEMPLATE - cmakelists_${_lang}_ex.in - SUNDIALS_TARGETS - generic - nvecraja - OTHER_TARGETS - ${_openmp_target} - DESTINATION - nvector/raja - ) + CMAKE_TEMPLATE cmakelists_${_lang}_ex.in + SUNDIALS_TARGETS generic nvecraja + OTHER_TARGETS ${_openmp_target} + DESTINATION nvector/raja) endif() diff --git a/examples/nvector/serial/CMakeLists.txt b/examples/nvector/serial/CMakeLists.txt index 6807562188..5e74daf715 100644 --- a/examples/nvector/serial/CMakeLists.txt +++ b/examples/nvector/serial/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for serial nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS serial nvector -set(nvector_serial_examples - "test_nvector_serial\;1000 0\;" - "test_nvector_serial\;10000 0\;" - ) +set(nvector_serial_examples "test_nvector_serial\;1000 0\;" + "test_nvector_serial\;10000 0\;") # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(nvector_serial_fortran_examples - "test_fnvector_serial_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(nvector_serial_fortran_examples "test_fnvector_serial_mod\;\;") endif() # Add source directory to include directories @@ -34,14 +31,13 @@ include_directories(. ..) # Specify libraries to link against set(NVECS_LIB sundials_nvecserial) -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) list(APPEND NVECS_LIB sundials_fnvecserial_mod) endif() # Set-up linker flags and link libraries set(SUNDIALS_LIBS ${NVECS_LIB} ${EXE_EXTRA_LINK_LIBS}) - # Add the build and install targets for each example foreach(example_tuple ${nvector_serial_examples}) @@ -50,8 +46,8 @@ foreach(example_tuple ${nvector_serial_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -74,17 +70,16 @@ foreach(example_tuple ${nvector_serial_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_nvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial) + install(FILES ${example}.c ../test_nvector.c ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial) endif() endforeach(example_tuple ${nvector_serial_examples}) @@ -97,14 +92,17 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.f90) @@ -123,7 +121,8 @@ foreach(example_tuple ${nvector_serial_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -143,26 +142,22 @@ if(EXAMPLES_INSTALL) examples2string(nvector_serial_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/nvector/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/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. - set(EXAMPLES_DEPENDENCIES ) + # building the examples. This makefile can then be used as a template for the + # user's own programs. + set(EXAMPLES_DEPENDENCIES) set(nvector_serial_dependencies test_nvector) examples2string(nvector_serial_dependencies EXAMPLES_DEPENDENCIES) @@ -170,15 +165,12 @@ if(EXAMPLES_INSTALL) # 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/nvector/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/nvector/sycl/CMakeLists.txt b/examples/nvector/sycl/CMakeLists.txt index f667464755..70e7b04121 100644 --- a/examples/nvector/sycl/CMakeLists.txt +++ b/examples/nvector/sycl/CMakeLists.txt @@ -14,15 +14,13 @@ # CMakeLists.txt file for SYCL nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using SUNDIALS sycl nvector set(nvector_sycl_examples - "test_nvector_sycl.cpp\;7 32 0\;" - "test_nvector_sycl.cpp\;500 128 0\;" - "test_nvector_sycl.cpp\;1000 0 0\;" - ) + "test_nvector_sycl.cpp\;7 32 0\;" "test_nvector_sycl.cpp\;500 128 0\;" + "test_nvector_sycl.cpp\;1000 0 0\;") # Add source directory to include directories include_directories(. .. ${PROJECT_SOURCE_DIR}/examples/utilities) @@ -38,8 +36,8 @@ foreach(example_tuple ${nvector_sycl_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files @@ -49,11 +47,9 @@ foreach(example_tuple ${nvector_sycl_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_nvector_obj - sundials_nvecsycl - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} PRIVATE test_nvector_obj sundials_nvecsycl + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -65,29 +61,25 @@ foreach(example_tuple ${nvector_sycl_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(nvector_sycl nvector_sycl_examples - EXAMPLES_DEPENDENCIES - test_nvector.c + sundials_install_examples( + nvector_sycl nvector_sycl_examples + EXAMPLES_DEPENDENCIES test_nvector.c EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.c ${SUNDIALS_SOURCE_DIR}/examples/nvector/test_nvector.h ${SUNDIALS_SOURCE_DIR}/examples/utilities/custom_memory_helper_sycl.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - DESTINATION - nvector/sycl - ) + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl + DESTINATION nvector/sycl) endif() diff --git a/examples/nvector/trilinos/CMakeLists.txt b/examples/nvector/trilinos/CMakeLists.txt index 0bda6e0cb7..909b1366b9 100644 --- a/examples/nvector/trilinos/CMakeLists.txt +++ b/examples/nvector/trilinos/CMakeLists.txt @@ -14,37 +14,33 @@ # CMakeLists.txt file for Trilinos nvector examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;tasks\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;tasks\;type" where the type is 'develop' +# for examples excluded from 'make test' in releases # Examples using SUNDIALS Trilinos nvector wrapper if(Trilinos_INTERFACE_MPI_CXX_FOUND) set(nvector_trilinos_examples - "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially - "test_nvector_trilinos\;1000 0\;1\;4\;" # run parallel on 4 procs - ) + "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially + "test_nvector_trilinos\;1000 0\;1\;4\;" # run parallel on 4 procs + ) else() set(nvector_trilinos_examples - "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially - ) + "test_nvector_trilinos\;1000 0\;\;\;" # run sequentially + ) endif() # Dependencies for nvector examples if(Trilinos_MPI) - set(nvector_examples_dependencies - test_nvector - test_mpinvector - ) + set(nvector_examples_dependencies test_nvector test_mpinvector) else() - set(nvector_examples_dependencies - test_nvector - ) + set(nvector_examples_dependencies test_nvector) endif() # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") # Set Trilinos MPI executable for trilinos tests @@ -69,22 +65,22 @@ foreach(example_tuple ${nvector_trilinos_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.cpp) # link vector test utilties target_link_libraries(${example} PRIVATE test_nvector_obj) - if (Trilinos_MPI) + if(Trilinos_MPI) target_link_libraries(${example} PRIVATE test_nvectormpi_obj) endif() set_target_properties(${example} PROPERTIES FOLDER "Examples") - # Trilinos libraries must be linked after SUNDIALS libraries! - # Otherwise, segfaults may occur; something to do with RCPs. + # Trilinos libraries must be linked after SUNDIALS libraries! Otherwise, + # segfaults may occur; something to do with RCPs. target_link_libraries(${example} PRIVATE ${SUNDIALS_LIBS}) endif() @@ -99,12 +95,14 @@ foreach(example_tuple ${nvector_trilinos_examples}) if("${number_of_tasks}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${number_of_tasks}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example}_${number_of_tasks}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -112,16 +110,13 @@ foreach(example_tuple ${nvector_trilinos_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.cpp - ../test_nvector.c - ../test_mpinvector.c - ../test_nvector.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) + install(FILES ${example}.cpp ../test_nvector.c ../test_mpinvector.c + ../test_nvector.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) endif() endforeach(example_tuple ${nvector_trilinos_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -134,39 +129,32 @@ if(EXAMPLES_INSTALL) examples2string(nvector_examples_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos) # 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. + # 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_trilinos_CXX_ex.in - ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/nvector/trilinos/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/nvector/trilinos - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/CMakeLists.txt b/examples/sunlinsol/CMakeLists.txt index c57c73797f..34eecd211b 100644 --- a/examples/sunlinsol/CMakeLists.txt +++ b/examples/sunlinsol/CMakeLists.txt @@ -33,8 +33,10 @@ add_subdirectory(pcg/serial) # Build the sunlinsol test utilities add_library(test_sunlinsol_obj OBJECT test_sunlinsol.c test_sunlinsol.h) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib - set_property(TARGET test_sunlinsol_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + # need PIC when shared libs are used since the example executables will link + # to the shared lib + set_property(TARGET test_sunlinsol_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() target_link_libraries(test_sunlinsol_obj PRIVATE sundials_sunlinsoldense) diff --git a/examples/sunlinsol/band/CMakeLists.txt b/examples/sunlinsol/band/CMakeLists.txt index 8a6d09997e..ef4cf305f2 100644 --- a/examples/sunlinsol/band/CMakeLists.txt +++ b/examples/sunlinsol/band/CMakeLists.txt @@ -14,26 +14,20 @@ # CMakeLists.txt file for sunlinsol band examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS band linear solver set(sunlinsol_band_examples - "test_sunlinsol_band\;10 2 3 0\;" - "test_sunlinsol_band\;300 7 4 0\;" - "test_sunlinsol_band\;1000 8 8 0\;" - "test_sunlinsol_band\;5000 3 100 0\;" -) + "test_sunlinsol_band\;10 2 3 0\;" "test_sunlinsol_band\;300 7 4 0\;" + "test_sunlinsol_band\;1000 8 8 0\;" "test_sunlinsol_band\;5000 3 100 0\;") # Dependencies for nvector examples -set(sunlinsol_band_dependencies - test_sunlinsol - ) +set(sunlinsol_band_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_band_fortran_examples - "test_fsunlinsol_band_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_band_fortran_examples "test_fsunlinsol_band_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +41,8 @@ foreach(example_tuple ${sunlinsol_band_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -57,10 +51,8 @@ foreach(example_tuple ${sunlinsol_band_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolband - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunlinsolband + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,17 +63,16 @@ foreach(example_tuple ${sunlinsol_band_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) endif() endforeach(example_tuple ${sunlinsol_band_examples}) @@ -94,14 +85,17 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -109,12 +103,9 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolband - sundials_fsunlinsolband_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolband sundials_fsunlinsolband_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name if("${example_args}" STREQUAL "") @@ -124,7 +115,8 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -132,7 +124,6 @@ foreach(example_tuple ${sunlinsol_band_fortran_examples}) endforeach(example_tuple ${sunlinsol_band_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -142,47 +133,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolband") set(LIBS "${LIBS} -lsundials_sunmatrixband") - # Set the link directory for the band sunmatrix library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the band sunmatrix library The generated + # CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_band_examples EXAMPLES) examples2string(sunlinsol_band_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/band/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band) # 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. + # 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/sunlinsol/band/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/band/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/band - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/cusolversp/CMakeLists.txt b/examples/sunlinsol/cusolversp/CMakeLists.txt index ed288d8014..69bc49e030 100644 --- a/examples/sunlinsol/cusolversp/CMakeLists.txt +++ b/examples/sunlinsol/cusolversp/CMakeLists.txt @@ -14,12 +14,10 @@ # CMakeLists.txt file for cuSolverSp examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases -set(examples_list - "test_sunlinsol_cusolversp_batchqr.cu\;100 1 0\;" - "test_sunlinsol_cusolversp_batchqr.cu\;10 10 0\;" - ) +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases +set(examples_list "test_sunlinsol_cusolversp_batchqr.cu\;100 1 0\;" + "test_sunlinsol_cusolversp_batchqr.cu\;10 10 0\;") # Add source directory to include directories include_directories(. ..) @@ -35,25 +33,26 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_nveccuda - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunmatrixcusparse - sundials_sunlinsolcusolversp - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_nveccuda + sundials_nvecserial + sundials_sunmatrixdense + sundials_sunmatrixsparse + sundials_sunmatrixcusparse + sundials_sunlinsolcusolversp + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -64,7 +63,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -73,23 +73,14 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_cusolversp examples_list - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CUDA_ex.in - SUNDIALS_TARGETS - nveccuda - nvecserial - sunmatrixdense - sunmatrixsparse - sunmatrixcusparse - sunlinsolcusolversp - DESTINATION - sunlinsol/cusolversp - ) + sundials_install_examples( + sunlinsol_cusolversp examples_list + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CUDA_ex.in + SUNDIALS_TARGETS nveccuda nvecserial sunmatrixdense sunmatrixsparse + sunmatrixcusparse sunlinsolcusolversp + DESTINATION sunlinsol/cusolversp) endif() diff --git a/examples/sunlinsol/dense/CMakeLists.txt b/examples/sunlinsol/dense/CMakeLists.txt index 03b6155811..7dec711c8a 100644 --- a/examples/sunlinsol/dense/CMakeLists.txt +++ b/examples/sunlinsol/dense/CMakeLists.txt @@ -15,26 +15,20 @@ # CMakeLists.txt file for sunlinsol dense examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS dense linear solver set(sunlinsol_dense_examples - "test_sunlinsol_dense\;10 0\;" - "test_sunlinsol_dense\;100 0\;" - "test_sunlinsol_dense\;500 0\;" - "test_sunlinsol_dense\;1000 0\;" -) + "test_sunlinsol_dense\;10 0\;" "test_sunlinsol_dense\;100 0\;" + "test_sunlinsol_dense\;500 0\;" "test_sunlinsol_dense\;1000 0\;") # Dependencies for nvector examples -set(sunlinsol_dense_dependencies - test_sunlinsol - ) +set(sunlinsol_dense_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_dense_fortran_examples - "test_fsunlinsol_dense_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_dense_fortran_examples "test_fsunlinsol_dense_mod\;\;") endif() # Add source directory to include directories @@ -48,8 +42,8 @@ foreach(example_tuple ${sunlinsol_dense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -58,10 +52,8 @@ foreach(example_tuple ${sunlinsol_dense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsoldense - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsoldense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,16 +64,15 @@ foreach(example_tuple ${sunlinsol_dense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) endif() endforeach(example_tuple ${sunlinsol_dense_examples}) @@ -94,14 +85,17 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -109,11 +103,9 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsoldense - sundials_fsunlinsoldense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsoldense sundials_fsunlinsoldense_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -124,7 +116,8 @@ foreach(example_tuple ${sunlinsol_dense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -141,47 +134,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsoldense") set(LIBS "${LIBS} -lsundials_sunmatrixdense") - # Set the link directory for the dense sunmatrix library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix library The generated + # CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_dense_examples EXAMPLES) examples2string(sunlinsol_dense_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/dense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense) # 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. + # 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/sunlinsol/dense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/dense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/dense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/ginkgo/CMakeLists.txt b/examples/sunlinsol/ginkgo/CMakeLists.txt index 6d3cae204f..c701ffc672 100644 --- a/examples/sunlinsol/ginkgo/CMakeLists.txt +++ b/examples/sunlinsol/ginkgo/CMakeLists.txt @@ -12,25 +12,26 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples - "test_sunlinsol_ginkgo.cpp\;bicg csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;bicg dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;cgs csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;cgs dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;gmres csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;gmres dense 100 0 100 0\;" - "test_sunlinsol_ginkgo.cpp\;idr csr 100 0 100 0\;" -# "test_sunlinsol_ginkgo.cpp\;idr dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;bicg csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;bicg dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;bicgstab csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;bicgstab dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;cgs csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;cgs dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;gmres csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;gmres dense 100 0 100 0\;" + "test_sunlinsol_ginkgo.cpp\;idr csr 100 0 100 0\;" + # "test_sunlinsol_ginkgo.cpp\;idr dense 100 0 100 0\;" ) # Add source directory to include directories include_directories(..) -sundials_add_examples_ginkgo(examples +sundials_add_examples_ginkgo( + examples TARGETS test_sunlinsol_obj BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) @@ -54,16 +55,12 @@ if(EXAMPLES_INSTALL) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(sunlinsol - CPU_GPU_EXAMPLES_VAR - examples - SUNDIALS_COMPONENTS - ${vectors} - DEPENDENCIES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - DESTINATION - sunlinsol/ginkgo - ) + sundials_install_examples_ginkgo( + sunlinsol + CPU_GPU_EXAMPLES_VAR examples + SUNDIALS_COMPONENTS ${vectors} + DEPENDENCIES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + DESTINATION sunlinsol/ginkgo) endif() diff --git a/examples/sunlinsol/klu/CMakeLists.txt b/examples/sunlinsol/klu/CMakeLists.txt index 664ec266a1..e3f54ce991 100644 --- a/examples/sunlinsol/klu/CMakeLists.txt +++ b/examples/sunlinsol/klu/CMakeLists.txt @@ -14,26 +14,20 @@ # CMakeLists.txt file for sunlinsol KLU examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the KLU linear solver set(sunlinsol_klu_examples - "test_sunlinsol_klu\;300 0 0\;" - "test_sunlinsol_klu\;300 1 0\;" - "test_sunlinsol_klu\;1000 0 0\;" - "test_sunlinsol_klu\;1000 1 0\;" - ) + "test_sunlinsol_klu\;300 0 0\;" "test_sunlinsol_klu\;300 1 0\;" + "test_sunlinsol_klu\;1000 0 0\;" "test_sunlinsol_klu\;1000 1 0\;") # Dependencies for nvector examples -set(sunlinsol_klu_dependencies - test_sunlinsol - ) +set(sunlinsol_klu_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_klu_fortran_examples - "test_fsunlinsol_klu_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_klu_fortran_examples "test_fsunlinsol_klu_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +41,8 @@ foreach(example_tuple ${sunlinsol_klu_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -57,11 +51,9 @@ foreach(example_tuple ${sunlinsol_klu_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunlinsolklu - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunlinsolklu ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,17 +64,16 @@ foreach(example_tuple ${sunlinsol_klu_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) endif() endforeach(example_tuple ${sunlinsol_klu_examples}) @@ -95,14 +86,17 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -110,7 +104,8 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod sundials_sunmatrixdense @@ -127,7 +122,8 @@ foreach(example_tuple ${sunlinsol_klu_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -144,47 +140,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolklu") set(LIBS "${LIBS} -lsundials_sunmatrixsparse -lsundials_sunmatrixdense") - # Set the link directory for the sparse and dense sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the sparse and dense sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_klu_examples EXAMPLES_KLU) examples2string(sunlinsol_klu_dependencies EXAMPLES_DEPENDENCIES_KLU) # 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. + # 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/sunlinsol/klu/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu) # 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. + # 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/sunlinsol/klu/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/klu/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/klu - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/kokkos/CMakeLists.txt b/examples/sunlinsol/kokkos/CMakeLists.txt index 7a4c9e0f5c..08964355dc 100644 --- a/examples/sunlinsol/kokkos/CMakeLists.txt +++ b/examples/sunlinsol/kokkos/CMakeLists.txt @@ -12,14 +12,13 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples_list - "test_sunlinsol_kokkosdense.cpp\;10 1 0\;" - "test_sunlinsol_kokkosdense.cpp\;100 1 0\;" - "test_sunlinsol_kokkosdense.cpp\;10 1000 0\;" - "test_sunlinsol_kokkosdense.cpp\;100 50 0\;" - ) + "test_sunlinsol_kokkosdense.cpp\;10 1 0\;" + "test_sunlinsol_kokkosdense.cpp\;100 1 0\;" + "test_sunlinsol_kokkosdense.cpp\;10 1000 0\;" + "test_sunlinsol_kokkosdense.cpp\;100 50 0\;") # Add source directory to include directories include_directories(..) @@ -37,10 +36,10 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -49,13 +48,10 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_nveckokkos - sundials_sunmatrixkokkosdense - sundials_sunlinsolkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_nveckokkos sundials_sunmatrixkokkosdense + sundials_sunlinsolkokkosdense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -66,7 +62,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -76,25 +73,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_kokkosdense examples_list - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - sunlinsolkokkosdense - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - DESTINATION - sunlinsol/kokkos - ) + sundials_install_examples( + sunlinsol_kokkosdense examples_list + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense sunlinsolkokkosdense + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + DESTINATION sunlinsol/kokkos) endif() diff --git a/examples/sunlinsol/lapackband/CMakeLists.txt b/examples/sunlinsol/lapackband/CMakeLists.txt index 672a6ab46f..fefcb00eb3 100644 --- a/examples/sunlinsol/lapackband/CMakeLists.txt +++ b/examples/sunlinsol/lapackband/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for sunlinsol LAPACK band examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the LAPACK band linear solver set(sunlinsol_lapackband_examples - "test_sunlinsol_lapackband\;10 2 3 0 0\;" - "test_sunlinsol_lapackband\;300 7 4 0 0\;" - "test_sunlinsol_lapackband\;1000 8 8 0 0\;" - "test_sunlinsol_lapackband\;5000 3 100 0 0\;" - ) + "test_sunlinsol_lapackband\;10 2 3 0 0\;" + "test_sunlinsol_lapackband\;300 7 4 0 0\;" + "test_sunlinsol_lapackband\;1000 8 8 0 0\;" + "test_sunlinsol_lapackband\;5000 3 100 0 0\;") # Dependencies for nvector examples -set(sunlinsol_lapackband_dependencies - test_sunlinsol - ) +set(sunlinsol_lapackband_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ..) @@ -41,8 +38,8 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -51,12 +48,9 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixband - sundials_sunlinsollapackband - ${LAPACK_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixband + sundials_sunlinsollapackband ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -67,22 +61,20 @@ foreach(example_tuple ${sunlinsol_lapackband_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) endif() endforeach(example_tuple ${sunlinsol_lapackband_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -92,47 +84,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsollapackband") set(LIBS "${LIBS} -lsundials_sunmatrixband -lsundials_sunmatrixdense") - # Set the link directory for the band and dense sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the band and dense sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_lapackband_examples EXAMPLES_BL) examples2string(sunlinsol_lapackband_dependencies EXAMPLES_DEPENDENCIES_BL) # 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. + # 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/sunlinsol/lapackband/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband) # 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. + # 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/sunlinsol/lapackband/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackband/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackband - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/lapackdense/CMakeLists.txt b/examples/sunlinsol/lapackdense/CMakeLists.txt index 0dd6ea947e..e5ff8e32b4 100644 --- a/examples/sunlinsol/lapackdense/CMakeLists.txt +++ b/examples/sunlinsol/lapackdense/CMakeLists.txt @@ -14,30 +14,26 @@ # CMakeLists.txt file for sunlinsol LAPACK dense examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using the LAPACK dense linear solver set(sunlinsol_lapackdense_examples - "test_sunlinsol_lapackdense\;10 0 0\;" - "test_sunlinsol_lapackdense\;100 0 0\;" - "test_sunlinsol_lapackdense\;500 0 0\;" - "test_sunlinsol_lapackdense\;1000 0 0\;" -) + "test_sunlinsol_lapackdense\;10 0 0\;" + "test_sunlinsol_lapackdense\;100 0 0\;" + "test_sunlinsol_lapackdense\;500 0 0\;" + "test_sunlinsol_lapackdense\;1000 0 0\;") # Dependencies for nvector examples -set(sunlinsol_lapackdense_dependencies - test_sunlinsol -) +set(sunlinsol_lapackdense_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(sunlinsol_lapackdense_fortran_examples - "test_fsunlinsol_lapackdense_mod\;10 0 0\;" - "test_fsunlinsol_lapackdense_mod\;100 0 0\;" - "test_fsunlinsol_lapackdense_mod\;500 0 0\;" - "test_fsunlinsol_lapackdense_mod\;1000 0 0\;" - ) + "test_fsunlinsol_lapackdense_mod\;10 0 0\;" + "test_fsunlinsol_lapackdense_mod\;100 0 0\;" + "test_fsunlinsol_lapackdense_mod\;500 0 0\;" + "test_fsunlinsol_lapackdense_mod\;1000 0 0\;") endif() # Add source directory to include directories @@ -51,8 +47,8 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -61,12 +57,9 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunlinsollapackdense - ${LAPACK_LIBRARIES} - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunlinsollapackdense ${LAPACK_LIBRARIES} ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -77,17 +70,16 @@ foreach(example_tuple ${sunlinsol_lapackdense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) endif() endforeach(example_tuple ${sunlinsol_lapackdense_examples}) @@ -100,14 +92,17 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -115,11 +110,9 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsollapackdense - sundials_fsunlinsollapackdense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsollapackdense sundials_fsunlinsollapackdense_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -130,7 +123,8 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -138,7 +132,6 @@ foreach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) endforeach(example_tuple ${sunlinsol_lapackdense_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -148,47 +141,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsollapackdense") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixband") - # Set the link directory for the dense and band sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and band sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_lapackdense_examples EXAMPLES_BL) examples2string(sunlinsol_lapackdense_dependencies EXAMPLES_DEPENDENCIES_BL) # 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. + # 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/sunlinsol/lapackdense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense) # 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. + # 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/sunlinsol/lapackdense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/lapackdense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/lapackdense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/magmadense/CMakeLists.txt b/examples/sunlinsol/magmadense/CMakeLists.txt index 0d58eed8f3..9a2b4460c6 100644 --- a/examples/sunlinsol/magmadense/CMakeLists.txt +++ b/examples/sunlinsol/magmadense/CMakeLists.txt @@ -12,23 +12,24 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS MAGMA dense matrix set(sunlinsols_magmadense_examples - "test_sunlinsol_magmadense.cpp\;10 1 0\;" - "test_sunlinsol_magmadense.cpp\;100 1 0\;" - "test_sunlinsol_magmadense.cpp\;10 1000 0\;" - "test_sunlinsol_magmadense.cpp\;100 100 0\;" - ) + "test_sunlinsol_magmadense.cpp\;10 1 0\;" + "test_sunlinsol_magmadense.cpp\;100 1 0\;" + "test_sunlinsol_magmadense.cpp\;10 1000 0\;" + "test_sunlinsol_magmadense.cpp\;100 100 0\;") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE CUDA) + set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE + CUDA) set(vector nveccuda) set(cuda_or_hip CUDA) elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") - set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE CXX) + set_source_files_properties(test_sunlinsol_magmadense.cpp PROPERTIES LANGUAGE + CXX) set(vector nvechip) set(cuda_or_hip HIP) endif() @@ -47,20 +48,18 @@ foreach(example_tuple ${sunlinsols_magmadense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} ../test_sunlinsol.c ../test_sunlinsol.h) + add_executable(${example_target} ${example} ../test_sunlinsol.c + ../test_sunlinsol.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_${vector} - sundials_sunlinsolmagmadense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_${vector} sundials_sunlinsolmagmadense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,7 +70,8 @@ foreach(example_tuple ${sunlinsols_magmadense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -80,19 +80,13 @@ endforeach(example_tuple ${sunlinsols_magmadense_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_magma sunlinsols_magmadense_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - ${vector} - sunlinsolmagmadense - DESTINATION - sunlinsol/magmadense - ) + sundials_install_examples( + sunlinsol_magma sunlinsols_magmadense_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS ${vector} sunlinsolmagmadense + DESTINATION sunlinsol/magmadense) endif() diff --git a/examples/sunlinsol/onemkldense/CMakeLists.txt b/examples/sunlinsol/onemkldense/CMakeLists.txt index de5cf8b81a..bdf4c4fb5c 100644 --- a/examples/sunlinsol/onemkldense/CMakeLists.txt +++ b/examples/sunlinsol/onemkldense/CMakeLists.txt @@ -12,16 +12,15 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS ONEMKL dense matrix set(sunlinsols_onemkldense_examples - "test_sunlinsol_onemkldense.cpp\;10 1 0\;" - "test_sunlinsol_onemkldense.cpp\;100 1 0\;" - "test_sunlinsol_onemkldense.cpp\;10 1000 0\;" - "test_sunlinsol_onemkldense.cpp\;100 100 0\;" - ) + "test_sunlinsol_onemkldense.cpp\;10 1 0\;" + "test_sunlinsol_onemkldense.cpp\;100 1 0\;" + "test_sunlinsol_onemkldense.cpp\;10 1000 0\;" + "test_sunlinsol_onemkldense.cpp\;100 100 0\;") # Add source directory to include directories include_directories(..) @@ -37,7 +36,7 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -46,14 +45,11 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_sunlinsol_obj - sundials_nvecsycl - sundials_sunlinsolonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE test_sunlinsol_obj sundials_nvecsycl + sundials_sunlinsolonemkldense MKL::MKL_DPCPP + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -65,31 +61,24 @@ foreach(example_tuple ${sunlinsols_onemkldense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_onemkl sunlinsols_onemkldense_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - sunlinsolonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - sunlinsol/onemkldense - ) + sundials_install_examples( + sunlinsol_onemkl sunlinsols_onemkldense_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl sunlinsolonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION sunlinsol/onemkldense) endif() diff --git a/examples/sunlinsol/pcg/parallel/CMakeLists.txt b/examples/sunlinsol/pcg/parallel/CMakeLists.txt index 35982c87cf..7048c8f022 100644 --- a/examples/sunlinsol/pcg/parallel/CMakeLists.txt +++ b/examples/sunlinsol/pcg/parallel/CMakeLists.txt @@ -23,18 +23,15 @@ else() set(TOL "1e-13") endif() -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS PCG linear solver set(sunlinsol_pcg_examples - "test_sunlinsol_pcg_parallel\;100 500 ${TOL} 0\;1\;4\;" - ) + "test_sunlinsol_pcg_parallel\;100 500 ${TOL} 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_pcg_dependencies - test_sunlinsol - ) +set(sunlinsol_pcg_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -57,21 +54,18 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files - add_executable(${example} ${example}.c - ../../test_sunlinsol.c) + add_executable(${example} ${example}.c ../../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolpcg - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolpcg ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -86,7 +80,8 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -94,15 +89,12 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel) endif() endforeach(example_tuple ${sunlinsol_pcg_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -115,39 +107,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_pcg_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/pcg/serial/CMakeLists.txt b/examples/sunlinsol/pcg/serial/CMakeLists.txt index 4d6be609ee..353c4a4b97 100644 --- a/examples/sunlinsol/pcg/serial/CMakeLists.txt +++ b/examples/sunlinsol/pcg/serial/CMakeLists.txt @@ -23,23 +23,18 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS PCG linear solver -set(sunlinsol_pcg_examples - "test_sunlinsol_pcg_serial\;100 500 ${TOL} 0\;" - ) +set(sunlinsol_pcg_examples "test_sunlinsol_pcg_serial\;100 500 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_pcg_dependencies - test_sunlinsol - ) +set(sunlinsol_pcg_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_pcg_fortran_examples - "test_fsunlinsol_pcg_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_pcg_fortran_examples "test_fsunlinsol_pcg_mod_serial\;\;") endif() # Add source directory to include directories @@ -53,21 +48,18 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files - add_executable(${example} ${example}.c - ../../test_sunlinsol.c) + add_executable(${example} ${example}.c ../../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolpcg - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunlinsolpcg + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +70,16 @@ foreach(example_tuple ${sunlinsol_pcg_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial) endif() endforeach(example_tuple ${sunlinsol_pcg_examples}) @@ -101,14 +92,17 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,12 +110,9 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolpcg - sundials_fsunlinsolpcg_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolpcg sundials_fsunlinsolpcg_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name if("${example_args}" STREQUAL "") @@ -131,7 +122,8 @@ foreach(example_tuple ${sunlinsol_pcg_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +143,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_pcg_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/pcg/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/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. + # 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/sunlinsol/pcg/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/pcg/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/pcg/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt b/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt index 2423663c52..d5934add2f 100644 --- a/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPBCGS parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPBCGS linear solver set(sunlinsol_spbcgs_examples - "test_sunlinsol_spbcgs_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spbcgs_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spbcgs_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spbcgs_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spbcgs_dependencies - test_sunlinsol - ) +set(sunlinsol_spbcgs_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspbcgs - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspbcgs ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_include_directories(${example} ${MPI_INCLUDE_PATH}) @@ -78,7 +73,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -86,15 +82,12 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel) endif() endforeach(example_tuple ${sunlinsol_spbcgs_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -107,39 +100,36 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spbcgs_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt index 005f743cdf..1868e93bee 100644 --- a/examples/sunlinsol/spbcgs/serial/CMakeLists.txt +++ b/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @@ -23,24 +23,20 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPBCGS linear solver set(sunlinsol_spbcgs_examples - "test_sunlinsol_spbcgs_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_spbcgs_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spbcgs_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_spbcgs_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spbcgs_dependencies - test_sunlinsol - ) +set(sunlinsol_spbcgs_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spbcgs_fortran_examples - "test_fsunlinsol_spbcgs_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spbcgs_fortran_examples "test_fsunlinsol_spbcgs_mod_serial\;\;") endif() # Add source directory to include directories @@ -54,8 +50,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -64,10 +60,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspbcgs - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspbcgs ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +72,16 @@ foreach(example_tuple ${sunlinsol_spbcgs_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial) endif() endforeach(example_tuple ${sunlinsol_spbcgs_examples}) @@ -101,14 +94,17 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,11 +112,9 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspbcgs - sundials_fsunlinsolspbcgs_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspbcgs sundials_fsunlinsolspbcgs_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -131,7 +125,8 @@ foreach(example_tuple ${sunlinsol_spbcgs_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +146,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spbcgs_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/spbcgs/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/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. + # 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/sunlinsol/spbcgs/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spbcgs/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spbcgs/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt b/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt index c687877fcb..0d95eb0e53 100644 --- a/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPFGMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPTFQMR linear solver set(sunlinsol_spfgmr_examples - "test_sunlinsol_spfgmr_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spfgmr_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spfgmr_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spfgmr_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spfgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spfgmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspfgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspfgmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -77,7 +72,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -85,15 +81,12 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) # add example to regression tests if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel) endif() endforeach(example_tuple ${sunlinsol_spfgmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +99,36 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spfgmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt index daa7d9fca3..aca3e453af 100644 --- a/examples/sunlinsol/spfgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @@ -23,23 +23,19 @@ else() set(TOL "1e-14") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPFGMR linear solver set(sunlinsol_spfgmr_examples - "test_sunlinsol_spfgmr_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_spfgmr_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spfgmr_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_spfgmr_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spfgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spfgmr_dependencies test_sunlinsol) -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spfgmr_fortran_examples - "test_fsunlinsol_spfgmr_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spfgmr_fortran_examples "test_fsunlinsol_spfgmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -53,8 +49,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -63,10 +59,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspfgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspfgmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -77,17 +71,16 @@ foreach(example_tuple ${sunlinsol_spfgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial) endif() endforeach(example_tuple ${sunlinsol_spfgmr_examples}) @@ -100,14 +93,17 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -115,11 +111,9 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspfgmr - sundials_fsunlinsolspfgmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspfgmr sundials_fsunlinsolspfgmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -130,7 +124,8 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -138,7 +133,6 @@ foreach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) endforeach(example_tuple ${sunlinsol_spfgmr_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -151,39 +145,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spfgmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/spfgmr/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/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. + # 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/sunlinsol/spfgmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spfgmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spfgmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spgmr/parallel/CMakeLists.txt b/examples/sunlinsol/spgmr/parallel/CMakeLists.txt index db280af33d..3dbda67ac8 100644 --- a/examples/sunlinsol/spgmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/parallel/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for sunlinsol SPGMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPGMR linear solver set(sunlinsol_spgmr_examples - "test_sunlinsol_spgmr_parallel\;100 1 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 1 2 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 2 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_spgmr_parallel\;100 2 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_spgmr_parallel\;100 1 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 1 2 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 2 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_spgmr_parallel\;100 2 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_spgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spgmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -41,7 +38,6 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() - # Add the build and install targets for each example foreach(example_tuple ${sunlinsol_spgmr_examples}) @@ -52,8 +48,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -62,10 +58,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolspgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolspgmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -80,7 +74,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -88,15 +83,12 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel) endif() endforeach(example_tuple ${sunlinsol_spgmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -109,39 +101,34 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spgmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/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. + # 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_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/spgmr/serial/CMakeLists.txt b/examples/sunlinsol/spgmr/serial/CMakeLists.txt index 3353f2a829..e318ed93a0 100644 --- a/examples/sunlinsol/spgmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/spgmr/serial/CMakeLists.txt @@ -23,26 +23,22 @@ else() set(TOL "1e-14") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPGMR linear solver set(sunlinsol_spgmr_examples - "test_sunlinsol_spgmr_serial\;100 1 1 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 2 1 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 1 2 100 ${TOL} 0\;" - "test_sunlinsol_spgmr_serial\;100 2 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_spgmr_serial\;100 1 1 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 2 1 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 1 2 100 ${TOL} 0\;" + "test_sunlinsol_spgmr_serial\;100 2 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_spgmr_dependencies - test_sunlinsol - ) +set(sunlinsol_spgmr_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunlinsol_spgmr_fortran_examples - "test_fsunlinsol_spgmr_mod_serial\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunlinsol_spgmr_fortran_examples "test_fsunlinsol_spgmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -56,8 +52,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -66,10 +62,8 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolspgmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolspgmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -80,17 +74,16 @@ foreach(example_tuple ${sunlinsol_spgmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial) endif() endforeach(example_tuple ${sunlinsol_spgmr_examples}) @@ -103,14 +96,17 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -118,11 +114,9 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolspgmr - sundials_fsunlinsolspgmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolspgmr sundials_fsunlinsolspgmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -133,7 +127,8 @@ foreach(example_tuple ${sunlinsol_spgmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -153,39 +148,33 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_spgmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/spgmr/serial/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/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. + # 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/sunlinsol/spgmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/spgmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/spgmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt b/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt index bb6b44935f..247c68ef57 100644 --- a/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt @@ -14,19 +14,16 @@ # CMakeLists.txt file for sunlinsol SPTFQMR parallel examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;tasks\;type" where the type is +# develop for examples excluded from 'make test' in releases # Examples using the SUNDIALS SPTFQMR linear solver set(sunlinsol_sptfqmr_examples - "test_sunlinsol_sptfqmr_parallel\;100 1 50 1e-3 0\;1\;4\;" - "test_sunlinsol_sptfqmr_parallel\;100 2 50 1e-3 0\;1\;4\;" - ) + "test_sunlinsol_sptfqmr_parallel\;100 1 50 1e-3 0\;1\;4\;" + "test_sunlinsol_sptfqmr_parallel\;100 2 50 1e-3 0\;1\;4\;") # Dependencies for nvector examples -set(sunlinsol_sptfqmr_dependencies - test_sunlinsol - ) +set(sunlinsol_sptfqmr_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ../..) @@ -49,8 +46,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) list(GET example_tuple 3 number_of_tasks) list(GET example_tuple 4 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -59,10 +56,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecparallel - sundials_sunlinsolsptfqmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecparallel + sundials_sunlinsolsptfqmr ${EXE_EXTRA_LINK_LIBS}) if(NOT MPI_C_COMPILER) target_link_libraries(${example} ${MPI_LIBRARIES}) @@ -77,7 +72,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_tasks} EXAMPLE_TYPE ${example_type} @@ -85,15 +81,12 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel) endif() endforeach(example_tuple ${sunlinsol_sptfqmr_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -106,39 +99,37 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_sptfqmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel - ) + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/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. + # 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_C_ex.in ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex - @ONLY - ) + @ONLY) # install the configured Makefile_ex as Makefile install( - FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex + FILES + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/parallel/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/parallel - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt index c985445c51..5d64fd308e 100644 --- a/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt +++ b/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt @@ -23,24 +23,21 @@ else() set(TOL "1e-16") endif() -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SPTFQMR linear solver set(sunlinsol_sptfqmr_examples - "test_sunlinsol_sptfqmr_serial\;100 1 100 ${TOL} 0\;" - "test_sunlinsol_sptfqmr_serial\;100 2 100 ${TOL} 0\;" - ) + "test_sunlinsol_sptfqmr_serial\;100 1 100 ${TOL} 0\;" + "test_sunlinsol_sptfqmr_serial\;100 2 100 ${TOL} 0\;") # Dependencies for nvector examples -set(sunlinsol_sptfqmr_dependencies - test_sunlinsol - ) +set(sunlinsol_sptfqmr_dependencies test_sunlinsol) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) +if(BUILD_FORTRAN_MODULE_INTERFACE) set(sunlinsol_sptfqmr_fortran_examples - "test_fsunlinsol_sptfqmr_mod_serial\;\;") + "test_fsunlinsol_sptfqmr_mod_serial\;\;") endif() # Add source directory to include directories @@ -54,8 +51,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../../test_sunlinsol.c) @@ -64,10 +61,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunlinsolsptfqmr - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunlinsolsptfqmr ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -78,17 +73,16 @@ foreach(example_tuple ${sunlinsol_sptfqmr_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../../test_sunlinsol.h - ../../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial) + install(FILES ${example}.c ../../test_sunlinsol.h ../../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial) endif() endforeach(example_tuple ${sunlinsol_sptfqmr_examples}) @@ -101,14 +95,17 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.f90) @@ -116,11 +113,9 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunlinsolsptfqmr - sundials_fsunlinsolsptfqmr_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunlinsolsptfqmr sundials_fsunlinsolsptfqmr_mod ${EXE_EXTRA_LINK_LIBS}) # check if example args are provided and set the test name @@ -131,7 +126,8 @@ foreach(example_tuple ${sunlinsol_sptfqmr_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -151,39 +147,34 @@ if(EXAMPLES_INSTALL) examples2string(sunlinsol_sptfqmr_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunlinsol/sptfqmr/serial/CMakeLists.txt - @ONLY - ) + @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/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. + # 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/sunlinsol/sptfqmr/serial/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/sptfqmr/serial/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/sptfqmr/serial - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunlinsol/superludist/CMakeLists.txt b/examples/sunlinsol/superludist/CMakeLists.txt index bba860e2eb..03f7e028cc 100644 --- a/examples/sunlinsol/superludist/CMakeLists.txt +++ b/examples/sunlinsol/superludist/CMakeLists.txt @@ -14,21 +14,18 @@ # CMakeLists.txt file for the superlu-dist SUNLinearSolver examples # ----------------------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the 'develop' for +# examples excluded from 'make test' in releases # Examples using the SuperLU_MT linear solver set(sunlinsol_superludist_examples - "test_sunlinsol_superludist.cpp\;100 1 1 0\;1\;" - "test_sunlinsol_superludist.cpp\;400 1 2 0\;2\;" - "test_sunlinsol_superludist.cpp\;900 3 1 0\;3\;" - "test_sunlinsol_superludist.cpp\;1000 2 2 0\;4\;" -) + "test_sunlinsol_superludist.cpp\;100 1 1 0\;1\;" + "test_sunlinsol_superludist.cpp\;400 1 2 0\;2\;" + "test_sunlinsol_superludist.cpp\;900 3 1 0\;3\;" + "test_sunlinsol_superludist.cpp\;1000 2 2 0\;4\;") # Dependencies for nvector examples -set(sunlinsol_superludist_dependencies - test_sunlinsol - ) +set(sunlinsol_superludist_dependencies test_sunlinsol) if(SUPERLUDIST_CUDA) set(_ex_lang CUDA) @@ -53,26 +50,22 @@ foreach(example_tuple ${sunlinsol_superludist_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunlinsol.c) + add_executable(${example_target} ${example} ../test_sunlinsol.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_sunlinsolsuperludist - sundials_sunmatrixslunrloc - sundials_sunmatrixdense - sundials_nvecparallel - sundials_nvecserial - MPI::MPI_CXX) + target_link_libraries( + ${example_target} + PRIVATE sundials_sunlinsolsuperludist sundials_sunmatrixslunrloc + sundials_sunmatrixdense sundials_nvecparallel sundials_nvecserial + MPI::MPI_CXX) endif() # check if example args are provided and set the test name @@ -80,18 +73,21 @@ foreach(example_tuple ${sunlinsol_superludist_examples}) if("${number_of_nodes}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}) endif() else() if("${number_of_nodes}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} EXAMPLE_TYPE ${example_type} @@ -101,21 +97,13 @@ endforeach(example_tuple ${sunlinsol_superludist_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunlinsol_superludist sunlinsol_superludist_examples - EXAMPLES_DEPENDENCIES - test_sunlinsol.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c - ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - nvecserial - nvecparallel - sunlinsoldense - sunlinsolsuperludist - DESTINATION - sunlinsol/superludist - ) + sundials_install_examples( + sunlinsol_superludist sunlinsol_superludist_examples + EXAMPLES_DEPENDENCIES test_sunlinsol.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.c + ${SUNDIALS_SOURCE_DIR}/examples/sunlinsol/test_sunlinsol.h + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS nvecserial nvecparallel sunlinsoldense sunlinsolsuperludist + DESTINATION sunlinsol/superludist) endif() diff --git a/examples/sunlinsol/superlumt/CMakeLists.txt b/examples/sunlinsol/superlumt/CMakeLists.txt index c2142f7bf2..794d69fe5f 100644 --- a/examples/sunlinsol/superlumt/CMakeLists.txt +++ b/examples/sunlinsol/superlumt/CMakeLists.txt @@ -14,23 +14,19 @@ # CMakeLists.txt file for sunlinsol SuperLU_MT examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases -# Examples using the SuperLU_MT linear solver -# Note: threaded tests are excluded because of a potential bug in -# SuperLU_MT that causes random test failures +# Examples using the SuperLU_MT linear solver Note: threaded tests are excluded +# because of a potential bug in SuperLU_MT that causes random test failures set(sunlinsol_superlumt_examples - "test_sunlinsol_superlumt\;300 0 1 0\;" - "test_sunlinsol_superlumt\;300 1 1 0\;" - "test_sunlinsol_superlumt\;1000 0 3 0\;exclude" - "test_sunlinsol_superlumt\;1000 1 3 0\;exclude" -) + "test_sunlinsol_superlumt\;300 0 1 0\;" + "test_sunlinsol_superlumt\;300 1 1 0\;" + "test_sunlinsol_superlumt\;1000 0 3 0\;exclude" + "test_sunlinsol_superlumt\;1000 1 3 0\;exclude") # Dependencies for nvector examples -set(sunlinsol_superlumt_dependencies - test_sunlinsol -) +set(sunlinsol_superlumt_dependencies test_sunlinsol) # Add source directory to include directories include_directories(. ..) @@ -43,8 +39,8 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunlinsol.c) @@ -53,11 +49,9 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunlinsolsuperlumt + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunmatrixsparse sundials_sunlinsolsuperlumt ${EXE_EXTRA_LINK_LIBS}) endif() @@ -69,21 +63,19 @@ foreach(example_tuple ${sunlinsol_superlumt_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunlinsol.h - ../test_sunlinsol.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) + install(FILES ${example}.c ../test_sunlinsol.h ../test_sunlinsol.c + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) endif() endforeach(example_tuple ${sunlinsol_superlumt_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -93,8 +85,8 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunlinsolsuperlumt") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixsparse") - # Set the link directory for the dense and sparse sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and sparse sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunlinsol_superlumt_examples EXAMPLES_SLUMT) @@ -107,39 +99,33 @@ if(EXAMPLES_INSTALL) 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. + # 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/sunlinsol/superlumt/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt) # 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. + # 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/sunlinsol/superlumt/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunlinsol/superlumt/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunlinsol/superlumt - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/CMakeLists.txt b/examples/sunmatrix/CMakeLists.txt index ecb74f6faa..97fe929142 100644 --- a/examples/sunmatrix/CMakeLists.txt +++ b/examples/sunmatrix/CMakeLists.txt @@ -28,8 +28,10 @@ add_subdirectory(sparse) # Build the sunmatrix test utilities add_library(test_sunmatrix_obj OBJECT test_sunmatrix.c test_sunmatrix.h) if(BUILD_SHARED_LIBS) - # need PIC when shared libs are used since the example executables will link to the shared lib - set_property(TARGET test_sunmatrix_obj PROPERTY POSITION_INDEPENDENT_CODE TRUE) + # need PIC when shared libs are used since the example executables will link + # to the shared lib + set_property(TARGET test_sunmatrix_obj PROPERTY POSITION_INDEPENDENT_CODE + TRUE) endif() target_link_libraries(test_sunmatrix_obj PRIVATE sundials_sunmatrixdense) diff --git a/examples/sunmatrix/band/CMakeLists.txt b/examples/sunmatrix/band/CMakeLists.txt index 1db5a837a3..fa6848a4c9 100644 --- a/examples/sunmatrix/band/CMakeLists.txt +++ b/examples/sunmatrix/band/CMakeLists.txt @@ -15,26 +15,20 @@ # CMakeLists.txt file for banded sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS banded matrix set(sunmatrix_band_examples - "test_sunmatrix_band\;10 2 3 0\;" - "test_sunmatrix_band\;300 7 4 0\;" - "test_sunmatrix_band\;1000 8 8 0\;" - "test_sunmatrix_band\;5000 3 20 0\;" -) + "test_sunmatrix_band\;10 2 3 0\;" "test_sunmatrix_band\;300 7 4 0\;" + "test_sunmatrix_band\;1000 8 8 0\;" "test_sunmatrix_band\;5000 3 20 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_band_dependencies - test_sunmatrix - ) +set(sunmatrix_band_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_band_fortran_examples - "test_fsunmatrix_band_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_band_fortran_examples "test_fsunmatrix_band_mod\;\;") endif() # Add source directory to include directories @@ -48,8 +42,8 @@ foreach(example_tuple ${sunmatrix_band_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -58,10 +52,8 @@ foreach(example_tuple ${sunmatrix_band_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixband - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial sundials_sunmatrixband + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -72,17 +64,16 @@ foreach(example_tuple ${sunmatrix_band_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) endif() endforeach(example_tuple ${sunmatrix_band_examples}) @@ -95,14 +86,17 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -110,12 +104,9 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunmatrixband - sundials_fsunmatrixband_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunmatrixband sundials_fsunmatrixband_mod ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -126,7 +117,8 @@ foreach(example_tuple ${sunmatrix_band_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -145,39 +137,32 @@ if(EXAMPLES_INSTALL) examples2string(sunmatrix_band_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunmatrix/band/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band) # 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. + # 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/sunmatrix/band/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/band/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/band - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/cusparse/CMakeLists.txt b/examples/sunmatrix/cusparse/CMakeLists.txt index 5f3e2d0707..d3b3782fea 100644 --- a/examples/sunmatrix/cusparse/CMakeLists.txt +++ b/examples/sunmatrix/cusparse/CMakeLists.txt @@ -14,14 +14,13 @@ # CMakeLists.txt file for SUNMATRIX_CUSPARSE examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the -# type is develop for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is develop for +# examples excluded from 'make test' in releases set(examples_list - "test_sunmatrix_cusparse.cu\;random 100 100 1 CSR 0\;" - "test_sunmatrix_cusparse.cu\;random 101 100 1 CSR 0\;" - "test_sunmatrix_cusparse.cu\;random 10 10 50 BCSR 0\;" - "test_sunmatrix_cusparse.cu\;random 100 100 5 BCSR 0\;" - ) + "test_sunmatrix_cusparse.cu\;random 100 100 1 CSR 0\;" + "test_sunmatrix_cusparse.cu\;random 101 100 1 CSR 0\;" + "test_sunmatrix_cusparse.cu\;random 10 10 50 BCSR 0\;" + "test_sunmatrix_cusparse.cu\;random 100 100 5 BCSR 0\;") # Add source directory to include directories include_directories(. ..) @@ -37,24 +36,22 @@ foreach(example_tuple ${examples_list}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c ../dreadrb.c) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../dreadrb.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} PRIVATE - sundials_nvecserial - sundials_nveccuda - sundials_sunmatrixdense - sundials_sunmatrixsparse - sundials_sunmatrixcusparse - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example_target} + PRIVATE sundials_nvecserial sundials_nveccuda sundials_sunmatrixdense + sundials_sunmatrixsparse sundials_sunmatrixcusparse + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -65,7 +62,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -74,27 +72,17 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_cusparse examples_list - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - test_sunmatrix.h - dreadrb.c - dreadrb.h + sundials_install_examples( + sunmatrix_cusparse examples_list + EXAMPLES_DEPENDENCIES test_sunmatrix.c test_sunmatrix.h dreadrb.c dreadrb.h EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/dreadrb.c ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/dreadrb.h - CMAKE_TEMPLATE - cmakelists_CUDA_ex.in - SUNDIALS_TARGETS - nveccuda - nvecserial - sunmatrixdense - sunmatrixsparse - sunmatrixcusparse - DESTINATION - sunmatrix/cusparse - ) + CMAKE_TEMPLATE cmakelists_CUDA_ex.in + SUNDIALS_TARGETS nveccuda nvecserial sunmatrixdense sunmatrixsparse + sunmatrixcusparse + DESTINATION sunmatrix/cusparse) endif() diff --git a/examples/sunmatrix/dense/CMakeLists.txt b/examples/sunmatrix/dense/CMakeLists.txt index e5e5f9a346..577abf7011 100644 --- a/examples/sunmatrix/dense/CMakeLists.txt +++ b/examples/sunmatrix/dense/CMakeLists.txt @@ -15,25 +15,20 @@ # CMakeLists.txt file for dense sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS dense matrix set(sunmatrix_dense_examples - "test_sunmatrix_dense\;100 100 0\;" - "test_sunmatrix_dense\;200 1000 0\;" - "test_sunmatrix_dense\;2000 100 0\;" - ) + "test_sunmatrix_dense\;100 100 0\;" "test_sunmatrix_dense\;200 1000 0\;" + "test_sunmatrix_dense\;2000 100 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_dense_dependencies - test_sunmatrix - ) +set(sunmatrix_dense_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_dense_fortran_examples - "test_fsunmatrix_dense_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_dense_fortran_examples "test_fsunmatrix_dense_mod\;\;") endif() # Add source directory to include directories @@ -47,8 +42,8 @@ foreach(example_tuple ${sunmatrix_dense_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -57,10 +52,8 @@ foreach(example_tuple ${sunmatrix_dense_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${example} sundials_nvecserial + sundials_sunmatrixdense ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -71,17 +64,16 @@ foreach(example_tuple ${sunmatrix_dense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) endif() endforeach(example_tuple ${sunmatrix_dense_examples}) @@ -94,13 +86,16 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -108,11 +103,9 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_fnvecserial_mod - sundials_sunmatrixdense - sundials_fsunmatrixdense_mod + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod + sundials_sunmatrixdense sundials_fsunmatrixdense_mod ${EXE_EXTRA_LINK_LIBS}) endif() @@ -124,14 +117,14 @@ foreach(example_tuple ${sunmatrix_dense_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${sunmatrix_dense_fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -144,39 +137,32 @@ if(EXAMPLES_INSTALL) examples2string(sunmatrix_dense_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunmatrix/dense/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense) # 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. + # 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/sunmatrix/dense/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/dense/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/dense - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunmatrix/ginkgo/CMakeLists.txt b/examples/sunmatrix/ginkgo/CMakeLists.txt index 0e17ab0821..84c7a14873 100644 --- a/examples/sunmatrix/ginkgo/CMakeLists.txt +++ b/examples/sunmatrix/ginkgo/CMakeLists.txt @@ -12,21 +12,21 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples - "test_sunmatrix_ginkgo.cpp\;100 100 0\;" - "test_sunmatrix_ginkgo.cpp\;100 10 0\;" - "test_sunmatrix_ginkgo.cpp\;10 100 0\;" - "test_sunmatrix_ginkgo.cpp\;100 100 1\;" - "test_sunmatrix_ginkgo.cpp\;100 10 1\;" - "test_sunmatrix_ginkgo.cpp\;10 100 1\;" -) + "test_sunmatrix_ginkgo.cpp\;100 100 0\;" + "test_sunmatrix_ginkgo.cpp\;100 10 0\;" + "test_sunmatrix_ginkgo.cpp\;10 100 0\;" + "test_sunmatrix_ginkgo.cpp\;100 100 1\;" + "test_sunmatrix_ginkgo.cpp\;100 10 1\;" + "test_sunmatrix_ginkgo.cpp\;10 100 1\;") # Add source directory to include directories include_directories(..) -sundials_add_examples_ginkgo(examples +sundials_add_examples_ginkgo( + examples TARGETS test_sunmatrix_obj sundials_sunmatrixdense BACKENDS REF OMP CUDA HIP SYCL UNIT_TEST) @@ -50,19 +50,13 @@ if(EXAMPLES_INSTALL) list(APPEND vectors nvecserial) endif() - sundials_install_examples_ginkgo(sunmatrix - CPU_GPU_EXAMPLES_VAR - examples - SUNDIALS_COMPONENTS - sunmatrixdense - ${vectors} - SUNDIALS_TARGETS - sunmatrixdense - DEPENDENCIES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - DESTINATION - sunmatrix/ginkgo - ) + sundials_install_examples_ginkgo( + sunmatrix + CPU_GPU_EXAMPLES_VAR examples + SUNDIALS_COMPONENTS sunmatrixdense ${vectors} + SUNDIALS_TARGETS sunmatrixdense + DEPENDENCIES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + DESTINATION sunmatrix/ginkgo) endif() diff --git a/examples/sunmatrix/kokkos/CMakeLists.txt b/examples/sunmatrix/kokkos/CMakeLists.txt index 7a0b0ad6b7..3a8a96b61b 100644 --- a/examples/sunmatrix/kokkos/CMakeLists.txt +++ b/examples/sunmatrix/kokkos/CMakeLists.txt @@ -12,16 +12,15 @@ # SUNDIALS Copyright End # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases set(examples_list - "test_sunmatrix_kokkosdense.cpp\;100 100 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;200 1000 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;2000 100 1 0\;" - "test_sunmatrix_kokkosdense.cpp\;10 10 100 0\;" - "test_sunmatrix_kokkosdense.cpp\;200 10 100 0\;" - "test_sunmatrix_kokkosdense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_kokkosdense.cpp\;100 100 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;200 1000 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;2000 100 1 0\;" + "test_sunmatrix_kokkosdense.cpp\;10 10 100 0\;" + "test_sunmatrix_kokkosdense.cpp\;200 10 100 0\;" + "test_sunmatrix_kokkosdense.cpp\;10 200 100 0\;") # Add source directory to include directories include_directories(..) @@ -39,10 +38,10 @@ foreach(example_tuple ${examples_list}) get_filename_component(example_target ${example} NAME_WE) set(example_target "${example_target}.${backend}") - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c ../test_sunmatrix.h) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../test_sunmatrix.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -51,13 +50,10 @@ foreach(example_tuple ${examples_list}) target_compile_definitions(${example_target} PRIVATE USE_${backend}) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_core - sundials_nveckokkos - sundials_sunmatrixkokkosdense - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE sundials_core sundials_nveckokkos sundials_sunmatrixkokkosdense + ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -68,7 +64,8 @@ foreach(example_tuple ${examples_list}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -78,24 +75,15 @@ endforeach() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_kokkosdense examples_list - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_COMPONENTS - nveckokkos - sunmatrixkokkosdense - SUNDIALS_TARGETS - generic - OTHER_TARGETS - Kokkos::kokkos - Kokkos::kokkoskernels - DESTINATION - sunmatrix/kokkos - ) + sundials_install_examples( + sunmatrix_kokkosdense examples_list + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_COMPONENTS nveckokkos sunmatrixkokkosdense + SUNDIALS_TARGETS generic + OTHER_TARGETS Kokkos::kokkos Kokkos::kokkoskernels + DESTINATION sunmatrix/kokkos) endif() diff --git a/examples/sunmatrix/magmadense/CMakeLists.txt b/examples/sunmatrix/magmadense/CMakeLists.txt index 5879aabb33..e860458d25 100644 --- a/examples/sunmatrix/magmadense/CMakeLists.txt +++ b/examples/sunmatrix/magmadense/CMakeLists.txt @@ -12,25 +12,26 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS MAGMA dense matrix set(sunmatrix_magmadense_examples - "test_sunmatrix_magmadense.cpp\;100 100 1 0\;" - "test_sunmatrix_magmadense.cpp\;200 1000 1 0\;" - "test_sunmatrix_magmadense.cpp\;2000 100 1 0\;" - "test_sunmatrix_magmadense.cpp\;10 10 100 0\;" - "test_sunmatrix_magmadense.cpp\;200 10 100 0\;" - "test_sunmatrix_magmadense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_magmadense.cpp\;100 100 1 0\;" + "test_sunmatrix_magmadense.cpp\;200 1000 1 0\;" + "test_sunmatrix_magmadense.cpp\;2000 100 1 0\;" + "test_sunmatrix_magmadense.cpp\;10 10 100 0\;" + "test_sunmatrix_magmadense.cpp\;200 10 100 0\;" + "test_sunmatrix_magmadense.cpp\;10 200 100 0\;") if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") - set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CUDA) + set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE + CUDA) set(vector nveccuda) set(cuda_or_hip CUDA) elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") - set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CXX) + set_source_files_properties(test_sunmatrix_magmadense.cpp PROPERTIES LANGUAGE + CXX) set(vector nvechip) set(cuda_or_hip HIP) endif() @@ -49,21 +50,18 @@ foreach(example_tuple ${sunmatrix_magmadense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} ../test_sunmatrix.c ../test_sunmatrix.h) + add_executable(${example_target} ${example} ../test_sunmatrix.c + ../test_sunmatrix.h) # folder for IDEs set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - sundials_${vector} - sundials_sunmatrixmagmadense - SUNDIALS::MAGMA - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} PRIVATE sundials_${vector} sundials_sunmatrixmagmadense + SUNDIALS::MAGMA ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -74,7 +72,8 @@ foreach(example_tuple ${sunmatrix_magmadense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -83,19 +82,13 @@ endforeach(example_tuple ${sunmatrix_magmadense_examples}) if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_magma sunmatrix_magmadense_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_${cuda_or_hip}_ex.in - SUNDIALS_TARGETS - ${vector} - sunmatrixmagmadense - DESTINATION - sunmatrix/magmadense - ) + sundials_install_examples( + sunmatrix_magma sunmatrix_magmadense_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_${cuda_or_hip}_ex.in + SUNDIALS_TARGETS ${vector} sunmatrixmagmadense + DESTINATION sunmatrix/magmadense) endif() diff --git a/examples/sunmatrix/onemkldense/CMakeLists.txt b/examples/sunmatrix/onemkldense/CMakeLists.txt index f893de6ec7..80f51a86ea 100644 --- a/examples/sunmatrix/onemkldense/CMakeLists.txt +++ b/examples/sunmatrix/onemkldense/CMakeLists.txt @@ -12,18 +12,17 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS ONEMKL dense matrix set(sunmatrix_onemkldense_examples - "test_sunmatrix_onemkldense.cpp\;100 100 1 0\;" - "test_sunmatrix_onemkldense.cpp\;200 1000 1 0\;" - "test_sunmatrix_onemkldense.cpp\;2000 100 1 0\;" - "test_sunmatrix_onemkldense.cpp\;10 10 100 0\;" - "test_sunmatrix_onemkldense.cpp\;200 10 100 0\;" - "test_sunmatrix_onemkldense.cpp\;10 200 100 0\;" - ) + "test_sunmatrix_onemkldense.cpp\;100 100 1 0\;" + "test_sunmatrix_onemkldense.cpp\;200 1000 1 0\;" + "test_sunmatrix_onemkldense.cpp\;2000 100 1 0\;" + "test_sunmatrix_onemkldense.cpp\;10 10 100 0\;" + "test_sunmatrix_onemkldense.cpp\;200 10 100 0\;" + "test_sunmatrix_onemkldense.cpp\;10 200 100 0\;") # Add source directory to include directories include_directories(. ..) @@ -39,7 +38,7 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - if (NOT TARGET ${example_target}) + if(NOT TARGET ${example_target}) # example source files add_executable(${example_target} ${example}) @@ -48,14 +47,11 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example_target} - PRIVATE - test_sunmatrix_obj - sundials_nvecsycl - sundials_sunmatrixonemkldense - MKL::MKL_DPCPP - ${EXE_EXTRA_LINK_LIBS} - ) + target_link_libraries( + ${example_target} + PRIVATE test_sunmatrix_obj sundials_nvecsycl + sundials_sunmatrixonemkldense MKL::MKL_DPCPP + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -67,31 +63,24 @@ foreach(example_tuple ${sunmatrix_onemkldense_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach() - if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_onemkl sunmatrix_onemkldense_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_CXX_ex.in - SUNDIALS_TARGETS - nvecsycl - sunmatrixonemkldense - OTHER_TARGETS - MKL::MKL_DPCPP - DESTINATION - sunmatrix/onemkldense - ) + sundials_install_examples( + sunmatrix_onemkl sunmatrix_onemkldense_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_CXX_ex.in + SUNDIALS_TARGETS nvecsycl sunmatrixonemkldense + OTHER_TARGETS MKL::MKL_DPCPP + DESTINATION sunmatrix/onemkldense) endif() diff --git a/examples/sunmatrix/slunrloc/CMakeLists.txt b/examples/sunmatrix/slunrloc/CMakeLists.txt index 94f96cf354..5e71ed0580 100644 --- a/examples/sunmatrix/slunrloc/CMakeLists.txt +++ b/examples/sunmatrix/slunrloc/CMakeLists.txt @@ -14,22 +14,19 @@ # CMakeLists.txt file for slunrloc_sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;nodes\;type" where the -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;nodes\;type" where the 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS SUNMatrix wrapper of the SuperLU SLU_NR_loc # SuperMatrix. set(sunmatrix_slunrloc_examples - "test_sunmatrix_slunrloc.cpp\;100 1 1 0 0\;1\;\;" - "test_sunmatrix_slunrloc.cpp\;400 2 1 0 0\;2\;\;" - "test_sunmatrix_slunrloc.cpp\;600 3 1 0 0\;3\;\;" - "test_sunmatrix_slunrloc.cpp\;1000 1 4 0 0\;4\;\;" -) + "test_sunmatrix_slunrloc.cpp\;100 1 1 0 0\;1\;\;" + "test_sunmatrix_slunrloc.cpp\;400 2 1 0 0\;2\;\;" + "test_sunmatrix_slunrloc.cpp\;600 3 1 0 0\;3\;\;" + "test_sunmatrix_slunrloc.cpp\;1000 1 4 0 0\;4\;\;") # Dependencies for sunmatrix examples -set(sunmatrix_slunrloc_dependencies - test_sunmatrix - ) +set(sunmatrix_slunrloc_dependencies test_sunmatrix) # Add the build and install targets for each example foreach(example_tuple ${sunmatrix_slunrloc_examples}) @@ -42,12 +39,11 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) # extract the file name without extension get_filename_component(example_target ${example} NAME_WE) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example_target}) # example source files - add_executable(${example_target} ${example} - ../test_sunmatrix.c) + add_executable(${example_target} ${example} ../test_sunmatrix.c) # folder to organize targets in an IDE set_target_properties(${example_target} PROPERTIES FOLDER "Examples") @@ -55,13 +51,10 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) target_include_directories(${example_target} PRIVATE . ..) # libraries to link against - target_link_libraries(${example_target} - PRIVATE - MPI::MPI_CXX - sundials_sunmatrixslunrloc - sundials_sunmatrixdense - sundials_nvecparallel - sundials_nvecserial) + target_link_libraries( + ${example_target} + PRIVATE MPI::MPI_CXX sundials_sunmatrixslunrloc sundials_sunmatrixdense + sundials_nvecparallel sundials_nvecserial) endif() # check if example args are provided and set the test name @@ -69,18 +62,21 @@ foreach(example_tuple ${sunmatrix_slunrloc_examples}) if("${number_of_nodes}" STREQUAL "") set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}) endif() else() if("${number_of_nodes}" STREQUAL "") string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) else() - string(REGEX REPLACE " " "_" test_name ${example_target}_${number_of_nodes}_${example_args}) + string(REGEX REPLACE " " "_" test_name + ${example_target}_${number_of_nodes}_${example_args}) endif() endif() # add example to regression tests - sundials_add_test(${test_name} ${example_target} + sundials_add_test( + ${test_name} ${example_target} TEST_ARGS ${example_args} MPI_NPROCS ${number_of_nodes} EXAMPLE_TYPE ${example_type} @@ -98,21 +94,13 @@ endif() if(EXAMPLES_INSTALL) - sundials_install_examples(sunmatrix_slunrloc sunmatrix_slunrloc_examples - EXAMPLES_DEPENDENCIES - test_sunmatrix.c - EXTRA_FILES - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c - ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h - CMAKE_TEMPLATE - cmakelists_${_ex_lang}_MPI_ex.in - SUNDIALS_TARGETS - nvecserial - nvecparallel - sunmatrixdense - sunmatrixslunrloc - DESTINATION - sunmatrix/slunrloc - ) + sundials_install_examples( + sunmatrix_slunrloc sunmatrix_slunrloc_examples + EXAMPLES_DEPENDENCIES test_sunmatrix.c + EXTRA_FILES ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.c + ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.h + CMAKE_TEMPLATE cmakelists_${_ex_lang}_MPI_ex.in + SUNDIALS_TARGETS nvecserial nvecparallel sunmatrixdense sunmatrixslunrloc + DESTINATION sunmatrix/slunrloc) endif() diff --git a/examples/sunmatrix/sparse/CMakeLists.txt b/examples/sunmatrix/sparse/CMakeLists.txt index ee04a96b8d..9e2ad0d9db 100644 --- a/examples/sunmatrix/sparse/CMakeLists.txt +++ b/examples/sunmatrix/sparse/CMakeLists.txt @@ -15,28 +15,24 @@ # CMakeLists.txt file for sparse sunmatrix examples # --------------------------------------------------------------- -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Examples using SUNDIALS sparse matrix set(sunmatrix_sparse_examples - "test_sunmatrix_sparse\;400 400 0 0\;" - "test_sunmatrix_sparse\;450 450 1 0\;" - "test_sunmatrix_sparse\;200 1000 0 0\;" - "test_sunmatrix_sparse\;6000 350 0 0\;" - "test_sunmatrix_sparse\;500 5000 1 0\;" - "test_sunmatrix_sparse\;4000 800 1 0\;" -) + "test_sunmatrix_sparse\;400 400 0 0\;" + "test_sunmatrix_sparse\;450 450 1 0\;" + "test_sunmatrix_sparse\;200 1000 0 0\;" + "test_sunmatrix_sparse\;6000 350 0 0\;" + "test_sunmatrix_sparse\;500 5000 1 0\;" + "test_sunmatrix_sparse\;4000 800 1 0\;") # Dependencies for sunmatrix examples -set(sunmatrix_sparse_dependencies - test_sunmatrix - ) +set(sunmatrix_sparse_dependencies test_sunmatrix) # If building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(sunmatrix_sparse_fortran_examples - "test_fsunmatrix_sparse_mod\;\;") +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(sunmatrix_sparse_fortran_examples "test_fsunmatrix_sparse_mod\;\;") endif() # Add source directory to include directories @@ -50,8 +46,8 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c ../test_sunmatrix.c) @@ -60,12 +56,9 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} - sundials_nvecserial - sundials_sunmatrixdense - sundials_sunmatrixband - sundials_sunmatrixsparse - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries( + ${example} sundials_nvecserial sundials_sunmatrixdense + sundials_sunmatrixband sundials_sunmatrixsparse ${EXE_EXTRA_LINK_LIBS}) endif() # check if example args are provided and set the test name @@ -76,17 +69,16 @@ foreach(example_tuple ${sunmatrix_sparse_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) # install example source files if(EXAMPLES_INSTALL) - install(FILES ${example}.c - ../test_sunmatrix.c - ../test_sunmatrix.h - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) + install(FILES ${example}.c ../test_sunmatrix.c ../test_sunmatrix.h + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) endif() endforeach(example_tuple ${sunmatrix_sparse_examples}) @@ -99,13 +91,16 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) - add_executable(${example} ${example}.f90 + add_executable( + ${example} + ${example}.f90 ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90 ${SUNDIALS_SOURCE_DIR}/examples/sunmatrix/test_sunmatrix.f90) @@ -113,7 +108,8 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) set_target_properties(${example} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} + target_link_libraries( + ${example} sundials_nvecserial sundials_fnvecserial_mod sundials_sunmatrixdense @@ -133,7 +129,8 @@ foreach(example_tuple ${sunmatrix_sparse_fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) @@ -149,47 +146,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunmatrixsparse") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunmatrixband") - # Set the link directory for the dense and band sunmatrix libraries - # The generated CMakeLists.txt does not use find_library() locate them + # Set the link directory for the dense and band sunmatrix libraries The + # generated CMakeLists.txt does not use find_library() locate them set(EXTRA_LIBS_DIR "${libdir}") examples2string(sunmatrix_sparse_examples EXAMPLES) examples2string(sunmatrix_sparse_dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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/sunmatrix/sparse/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt @ONLY) # install CMakelists.txt - install( - FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse - ) + install(FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/CMakeLists.txt + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse) # 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. + # 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/sunmatrix/sparse/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunmatrix/sparse/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunmatrix/sparse - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/CMakeLists.txt b/examples/sunnonlinsol/CMakeLists.txt index 1ddeaa93d9..e6e1866860 100644 --- a/examples/sunnonlinsol/CMakeLists.txt +++ b/examples/sunnonlinsol/CMakeLists.txt @@ -24,5 +24,5 @@ add_subdirectory(newton) add_subdirectory(fixedpoint) if(BUILD_SUNNONLINSOL_PETSCSNES) - add_subdirectory(petsc) -endif() \ No newline at end of file + add_subdirectory(petsc) +endif() diff --git a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt index 834af69c2e..240259040a 100644 --- a/examples/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -14,21 +14,17 @@ # CMakeLists.txt file for sunnonlinsol fixedpoint examples # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs set(examples - "test_sunnonlinsol_fixedpoint\;\;" - "test_sunnonlinsol_fixedpoint\;2\;" - "test_sunnonlinsol_fixedpoint\;2 0.5\;" -) + "test_sunnonlinsol_fixedpoint\;\;" "test_sunnonlinsol_fixedpoint\;2\;" + "test_sunnonlinsol_fixedpoint\;2 0.5\;") # if building F2003 tests -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(fortran_examples - "test_fsunnonlinsol_fixedpoint_mod\;\;" - ) +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(fortran_examples "test_fsunnonlinsol_fixedpoint_mod\;\;") endif() # Add source directory to include directories @@ -53,8 +49,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -74,14 +70,15 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) endif() endforeach(example_tuple ${examples}) @@ -94,15 +91,17 @@ foreach(example_tuple ${fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 - ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) + add_executable( + ${example} ${example}.f90 + ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -119,14 +118,14 @@ foreach(example_tuple ${fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -136,46 +135,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolfixedpoint") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunlinsoldense") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(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. + # 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/sunnonlinsol/fixedpoint/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint) # 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. + # 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/sunnonlinsol/fixedpoint/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/fixedpoint/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/fixedpoint - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/newton/CMakeLists.txt b/examples/sunnonlinsol/newton/CMakeLists.txt index 2f3413bd0b..d440789afb 100644 --- a/examples/sunnonlinsol/newton/CMakeLists.txt +++ b/examples/sunnonlinsol/newton/CMakeLists.txt @@ -14,18 +14,14 @@ # CMakeLists.txt file for sunnonlinsol Newton examples # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs -set(examples - "test_sunnonlinsol_newton\;\;" -) - -if (BUILD_FORTRAN_MODULE_INTERFACE) - set(fortran_examples - "test_fsunnonlinsol_newton_mod\;\;" - ) +set(examples "test_sunnonlinsol_newton\;\;") + +if(BUILD_FORTRAN_MODULE_INTERFACE) + set(fortran_examples "test_fsunnonlinsol_newton_mod\;\;") endif() # Add source directory to include directories @@ -54,8 +50,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -75,14 +71,15 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) endif() endforeach(example_tuple ${examples}) @@ -95,15 +92,17 @@ foreach(example_tuple ${fortran_examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # build fortran modules into a unique directory to avoid naming collisions - set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) + set(CMAKE_Fortran_MODULE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${example}.dir) # example source files - add_executable(${example} ${example}.f90 - ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) + add_executable( + ${example} ${example}.f90 + ${SUNDIALS_SOURCE_DIR}/examples/utilities/test_utilities.f90) # folder to organize targets in an IDE set_target_properties(${example} PROPERTIES FOLDER "Examples") @@ -120,14 +119,14 @@ foreach(example_tuple ${fortran_examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) endforeach(example_tuple ${fortran_examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -137,46 +136,40 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolnewton") set(LIBS "${LIBS} -lsundials_sunmatrixdense -lsundials_sunlinsoldense") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(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. + # 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/sunnonlinsol/newton/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton) # 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. + # 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/sunnonlinsol/newton/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/newton/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/newton - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/examples/sunnonlinsol/petsc/CMakeLists.txt b/examples/sunnonlinsol/petsc/CMakeLists.txt index 59a5dbd2c0..7146134ea8 100644 --- a/examples/sunnonlinsol/petsc/CMakeLists.txt +++ b/examples/sunnonlinsol/petsc/CMakeLists.txt @@ -14,13 +14,11 @@ # CMakeLists.txt file for sunnonlinsol PetscSNES tests # ------------------------------------------------------------------------------ -# Example lists are tuples "name\;args\;type" where the type is -# 'develop' for examples excluded from 'make test' in releases +# Example lists are tuples "name\;args\;type" where the type is 'develop' for +# examples excluded from 'make test' in releases # Example programs -set(examples - "test_sunnonlinsol_petscsnes\;\;" -) +set(examples "test_sunnonlinsol_petscsnes\;\;") if(MPI_C_COMPILER) # use MPI wrapper as the compiler @@ -45,8 +43,8 @@ foreach(example_tuple ${examples}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - # check if this example has already been added, only need to add - # example source files once for testing with different inputs + # check if this example has already been added, only need to add example + # source files once for testing with different inputs if(NOT TARGET ${example}) # example source files add_executable(${example} ${example}.c) @@ -66,19 +64,19 @@ foreach(example_tuple ${examples}) endif() # add example to regression tests - sundials_add_test(${test_name} ${example} + sundials_add_test( + ${test_name} ${example} TEST_ARGS ${example_args} EXAMPLE_TYPE ${example_type} NODIFF) if(EXAMPLES_INSTALL) install(FILES ${example}.c - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) endif() endforeach(example_tuple ${examples}) - if(EXAMPLES_INSTALL) # Install the README file @@ -88,47 +86,41 @@ if(EXAMPLES_INSTALL) set(SOLVER_LIB "sundials_sunnonlinsolpetscsnes") set(LIBS "${LIBS}") - # Set the link directory for the dense sunmatrix and linear solver library - # The generated CMakeLists.txt does not use find_library() locate it + # Set the link directory for the dense sunmatrix and linear solver library The + # generated CMakeLists.txt does not use find_library() locate it set(EXTRA_LIBS_DIR "${libdir}") examples2string(examples EXAMPLES) examples2string(dependencies EXAMPLES_DEPENDENCIES) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt @ONLY) # install CMakelists.txt install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/CMakeLists.txt - DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes - ) + DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes) # 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. + # 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_petsc_C_ex.in - ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex - @ONLY - ) + ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex @ONLY) # install the configured Makefile_ex as Makefile install( FILES ${PROJECT_BINARY_DIR}/examples/sunnonlinsol/petscsnes/Makefile_ex DESTINATION ${EXAMPLES_INSTALL_PATH}/sunnonlinsol/petscsnes - RENAME Makefile - ) + RENAME Makefile) endif() endif() diff --git a/scripts/format.sh b/scripts/format.sh index 38011b85c0..1c3c553e25 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -10,8 +10,8 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------------------------- -# This script will use clang-tidy and clang-format to format C/C++ code and -# fprettify for Fortran code. +# This script will use clang-format to format C/C++ code, fprettify for Fortran +# code, cmake-format for CMake files, and black for Python code. # # Usage: # ./format.sh @@ -27,9 +27,12 @@ fi paths=( "$@" ) find "${paths[@]}" -iname '*.h' -o -iname '*.hpp' -o \ - -iname '*.c' -o -iname '*.cpp' -o \ - -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i + -iname '*.c' -o -iname '*.cpp' -o \ + -iname '*.cuh' -o -iname '*.cu' | grep -v fmod | xargs clang-format -i find "${paths[@]}" -iname '*.f90' | grep -v fmod | xargs fprettify --indent 2 --enable-replacements --c-relations +find "${paths[@]}" \( -iname '*.cmake' -o -iname 'CMakeLists.txt' \) \ + -exec cmake-format -i {} ';' + find "${paths[@]}" -iname '*.py' -exec black {} ';' diff --git a/src/arkode/CMakeLists.txt b/src/arkode/CMakeLists.txt index 267bc89a33..f8a0f4be63 100644 --- a/src/arkode/CMakeLists.txt +++ b/src/arkode/CMakeLists.txt @@ -18,62 +18,57 @@ install(CODE "MESSAGE(\"\nInstall ARKODE\n\")") # Add variable arkode_SOURCES with the sources for the ARKODE library set(arkode_SOURCES - arkode_adapt.c - arkode_arkstep_io.c - arkode_arkstep_nls.c - arkode_arkstep.c - arkode_bandpre.c - arkode_bbdpre.c - arkode_butcher_dirk.c - arkode_butcher_erk.c - arkode_butcher.c - arkode_erkstep_io.c - arkode_erkstep.c - arkode_interp.c - arkode_io.c - arkode_ls.c - arkode_mri_tables.c - arkode_mristep_io.c - arkode_mristep_nls.c - arkode_mristep.c - arkode_relaxation.c - arkode_root.c - arkode_sprkstep_io.c - arkode_sprkstep.c - arkode_sprk.c - arkode_user_controller.c - arkode.c -) + arkode_adapt.c + arkode_arkstep_io.c + arkode_arkstep_nls.c + arkode_arkstep.c + arkode_bandpre.c + arkode_bbdpre.c + arkode_butcher_dirk.c + arkode_butcher_erk.c + arkode_butcher.c + arkode_erkstep_io.c + arkode_erkstep.c + arkode_interp.c + arkode_io.c + arkode_ls.c + arkode_mri_tables.c + arkode_mristep_io.c + arkode_mristep_nls.c + arkode_mristep.c + arkode_relaxation.c + arkode_root.c + arkode_sprkstep_io.c + arkode_sprkstep.c + arkode_sprk.c + arkode_user_controller.c + arkode.c) # Add variable arkode_HEADERS with the exported ARKODE header files set(arkode_HEADERS - arkode.h - arkode_arkstep.h - arkode_bandpre.h - arkode_bbdpre.h - arkode_butcher.h - arkode_butcher_dirk.h - arkode_butcher_erk.h - arkode_erkstep.h - arkode_ls.h - arkode_mristep.h - arkode_sprk.h - arkode_sprkstep.h -) + arkode.h + arkode_arkstep.h + arkode_bandpre.h + arkode_bbdpre.h + arkode_butcher.h + arkode_butcher_dirk.h + arkode_butcher_erk.h + arkode_erkstep.h + arkode_ls.h + arkode_mristep.h + arkode_sprk.h + arkode_sprkstep.h) # Add prefix with complete path to the ARKODE header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/arkode/ arkode_HEADERS) # Create the sundials_arkode library -sundials_add_library(sundials_arkode - SOURCES - ${arkode_SOURCES} - HEADERS - ${arkode_HEADERS} - INCLUDE_SUBDIR - arkode - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_arkode + SOURCES ${arkode_SOURCES} + HEADERS ${arkode_HEADERS} + INCLUDE_SUBDIR arkode + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -91,13 +86,9 @@ sundials_add_library(sundials_arkode sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_arkode - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_arkode + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) # Finished ARKODE message(STATUS "Added ARKODE module") diff --git a/src/arkode/fmod_int32/CMakeLists.txt b/src/arkode/fmod_int32/CMakeLists.txt index 32e5c935d7..4ae3e19a54 100644 --- a/src/arkode/fmod_int32/CMakeLists.txt +++ b/src/arkode/fmod_int32/CMakeLists.txt @@ -27,11 +27,10 @@ set(arkode_SOURCES farkode_mristep_mod.c) # Create the library -sundials_add_f2003_library(sundials_farkode_mod - SOURCES - ${arkode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_farkode_mod + SOURCES ${arkode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunadaptcontrollersoderlind_mod_obj @@ -48,12 +47,8 @@ sundials_add_f2003_library(sundials_farkode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_farkode_mod - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_farkode_mod + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) message(STATUS "Added ARKODE F2003 interface") diff --git a/src/arkode/fmod_int64/CMakeLists.txt b/src/arkode/fmod_int64/CMakeLists.txt index 32e5c935d7..4ae3e19a54 100644 --- a/src/arkode/fmod_int64/CMakeLists.txt +++ b/src/arkode/fmod_int64/CMakeLists.txt @@ -27,11 +27,10 @@ set(arkode_SOURCES farkode_mristep_mod.c) # Create the library -sundials_add_f2003_library(sundials_farkode_mod - SOURCES - ${arkode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_farkode_mod + SOURCES ${arkode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunadaptcontrollersoderlind_mod_obj @@ -48,12 +47,8 @@ sundials_add_f2003_library(sundials_farkode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_farkode_mod - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) + OUTPUT_NAME sundials_farkode_mod + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) message(STATUS "Added ARKODE F2003 interface") diff --git a/src/arkode/xbraid/CMakeLists.txt b/src/arkode/xbraid/CMakeLists.txt index 8d700848c1..e9e469ae82 100644 --- a/src/arkode/xbraid/CMakeLists.txt +++ b/src/arkode/xbraid/CMakeLists.txt @@ -18,25 +18,16 @@ install(CODE "MESSAGE(\"\nInstall ARKODE XBraid interface\n\")") # Create the sundials_arkode_xbraid library -sundials_add_library(sundials_arkode_xbraid - SOURCES - arkode_xbraid.c - ${SUNDIALS_SOURCE_DIR}/src/sundials/sundials_xbraid.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/arkode/arkode_xbraid.h - INCLUDE_SUBDIR - arkode - LINK_LIBRARIES - PUBLIC sundials_arkode SUNDIALS::XBRAID MPI::MPI_C - INCLUDE_DIRECTORIES - PRIVATE ../ - OUTPUT_NAME - sundials_arkode_xbraid - VERSION - ${arkodelib_VERSION} - SOVERSION - ${arkodelib_SOVERSION} -) +sundials_add_library( + sundials_arkode_xbraid + SOURCES arkode_xbraid.c ${SUNDIALS_SOURCE_DIR}/src/sundials/sundials_xbraid.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/arkode/arkode_xbraid.h + INCLUDE_SUBDIR arkode + LINK_LIBRARIES PUBLIC sundials_arkode SUNDIALS::XBRAID MPI::MPI_C + INCLUDE_DIRECTORIES PRIVATE ../ + OUTPUT_NAME sundials_arkode_xbraid + VERSION ${arkodelib_VERSION} + SOVERSION ${arkodelib_SOVERSION}) # Finished message(STATUS "Added ARKODE Xbraid interface") diff --git a/src/cvode/CMakeLists.txt b/src/cvode/CMakeLists.txt index 7a3e01613a..7301a5bb11 100644 --- a/src/cvode/CMakeLists.txt +++ b/src/cvode/CMakeLists.txt @@ -19,25 +19,18 @@ install(CODE "MESSAGE(\"\nInstall CVODE\n\")") # Add variable cvode_SOURCES with the sources for the CVODE library set(cvode_SOURCES - cvode.c - cvode_bandpre.c - cvode_bbdpre.c - cvode_diag.c - cvode_io.c - cvode_ls.c - cvode_nls.c - cvode_proj.c - ) + cvode.c + cvode_bandpre.c + cvode_bbdpre.c + cvode_diag.c + cvode_io.c + cvode_ls.c + cvode_nls.c + cvode_proj.c) # Add variable cvode_HEADERS with the exported CVODE header files -set(cvode_HEADERS - cvode.h - cvode_bandpre.h - cvode_bbdpre.h - cvode_diag.h - cvode_ls.h - cvode_proj.h - ) +set(cvode_HEADERS cvode.h cvode_bandpre.h cvode_bbdpre.h cvode_diag.h + cvode_ls.h cvode_proj.h) # Add prefix with complete path to the CVODE header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/cvode/ cvode_HEADERS) @@ -47,70 +40,47 @@ if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) if(BUILD_NVECTOR_CUDA) - set_source_files_properties(cvode_fused_gpu.cpp PROPERTIES - LANGUAGE CUDA) + set_source_files_properties(cvode_fused_gpu.cpp PROPERTIES LANGUAGE CUDA) - sundials_add_library(sundials_cvode_fused_cuda - SOURCES - cvode_fused_gpu.cpp - COMPILE_DEFINITIONS - PRIVATE USE_CUDA - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE sundials_nveccuda - OUTPUT_NAME - sundials_cvode_fused_cuda - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_cuda + SOURCES cvode_fused_gpu.cpp + COMPILE_DEFINITIONS PRIVATE USE_CUDA + LINK_LIBRARIES PUBLIC sundials_core PRIVATE sundials_nveccuda + OUTPUT_NAME sundials_cvode_fused_cuda + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) endif() if(BUILD_NVECTOR_HIP) - sundials_add_library(sundials_cvode_fused_hip - SOURCES - cvode_fused_gpu.cpp - COMPILE_DEFINITIONS - PRIVATE USE_HIP - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE sundials_nvechip - OUTPUT_NAME - sundials_cvode_fused_hip - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_hip + SOURCES cvode_fused_gpu.cpp + COMPILE_DEFINITIONS PRIVATE USE_HIP + LINK_LIBRARIES PUBLIC sundials_core PRIVATE sundials_nvechip + OUTPUT_NAME sundials_cvode_fused_hip + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) endif() - sundials_add_library(sundials_cvode_fused_stubs - SOURCES - cvode_fused_stubs.c - LINK_LIBRARIES - PUBLIC sundials_core - OUTPUT_NAME - sundials_cvode_fused_stubs - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} - ) + sundials_add_library( + sundials_cvode_fused_stubs + SOURCES cvode_fused_stubs.c + LINK_LIBRARIES PUBLIC sundials_core + OUTPUT_NAME sundials_cvode_fused_stubs + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) set(_fused_link_lib sundials_cvode_fused_stubs) endif() # Create the library -sundials_add_library(sundials_cvode - SOURCES - ${cvode_SOURCES} - HEADERS - ${cvode_HEADERS} - INCLUDE_SUBDIR - cvode - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_cvode + SOURCES ${cvode_SOURCES} + HEADERS ${cvode_HEADERS} + INCLUDE_SUBDIR cvode + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -126,16 +96,11 @@ sundials_add_library(sundials_cvode sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - LINK_LIBRARIES - # Link to stubs so examples work. - PRIVATE ${_fused_link_lib} - OUTPUT_NAME - sundials_cvode - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + LINK_LIBRARIES # Link to stubs so examples work. + PRIVATE ${_fused_link_lib} + OUTPUT_NAME sundials_cvode + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) # Finished CVODE message(STATUS "Added CVODE module") diff --git a/src/cvode/fmod_int32/CMakeLists.txt b/src/cvode/fmod_int32/CMakeLists.txt index e27c43ae02..38581e558f 100644 --- a/src/cvode/fmod_int32/CMakeLists.txt +++ b/src/cvode/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(cvode_SOURCES fcvode_mod.f90 fcvode_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvode_mod - SOURCES - ${cvode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvode_mod + SOURCES ${cvode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fcvode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvode_mod - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + OUTPUT_NAME sundials_fcvode_mod + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) message(STATUS "Added CVODE F2003 interface") diff --git a/src/cvode/fmod_int64/CMakeLists.txt b/src/cvode/fmod_int64/CMakeLists.txt index e27c43ae02..38581e558f 100644 --- a/src/cvode/fmod_int64/CMakeLists.txt +++ b/src/cvode/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(cvode_SOURCES fcvode_mod.f90 fcvode_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvode_mod - SOURCES - ${cvode_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvode_mod + SOURCES ${cvode_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fcvode_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvode_mod - VERSION - ${cvodelib_VERSION} - SOVERSION - ${cvodelib_SOVERSION} -) + OUTPUT_NAME sundials_fcvode_mod + VERSION ${cvodelib_VERSION} + SOVERSION ${cvodelib_SOVERSION}) message(STATUS "Added CVODE F2003 interface") diff --git a/src/cvodes/CMakeLists.txt b/src/cvodes/CMakeLists.txt index 1879c49614..388ed2f57d 100644 --- a/src/cvodes/CMakeLists.txt +++ b/src/cvodes/CMakeLists.txt @@ -19,44 +19,34 @@ install(CODE "MESSAGE(\"\nInstall CVODES\n\")") # Add variable cvodes_SOURCES with the sources for the CVODES library set(cvodes_SOURCES - cvodea.c - cvodea_io.c - cvodes.c - cvodes_bandpre.c - cvodes_bbdpre.c - cvodes_diag.c - cvodes_io.c - cvodes_ls.c - cvodes_nls.c - cvodes_nls_sim.c - cvodes_nls_stg.c - cvodes_nls_stg1.c - cvodes_proj.c - ) + cvodea.c + cvodea_io.c + cvodes.c + cvodes_bandpre.c + cvodes_bbdpre.c + cvodes_diag.c + cvodes_io.c + cvodes_ls.c + cvodes_nls.c + cvodes_nls_sim.c + cvodes_nls_stg.c + cvodes_nls_stg1.c + cvodes_proj.c) # Add variable cvodes_HEADERS with the exported CVODES header files -set(cvodes_HEADERS - cvodes.h - cvodes_bandpre.h - cvodes_bbdpre.h - cvodes_diag.h - cvodes_ls.h - cvodes_proj.h - ) +set(cvodes_HEADERS cvodes.h cvodes_bandpre.h cvodes_bbdpre.h cvodes_diag.h + cvodes_ls.h cvodes_proj.h) # Add prefix with complete path to the CVODES header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/cvodes/ cvodes_HEADERS) # Create the library -sundials_add_library(sundials_cvodes - SOURCES - ${cvodes_SOURCES} - HEADERS - ${cvodes_HEADERS} - INCLUDE_SUBDIR - cvodes - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_cvodes + SOURCES ${cvodes_SOURCES} + HEADERS ${cvodes_HEADERS} + INCLUDE_SUBDIR cvodes + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -72,13 +62,9 @@ sundials_add_library(sundials_cvodes sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_cvodes - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_cvodes + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) # Finished CVODES message(STATUS "Added CVODES module") diff --git a/src/cvodes/fmod_int32/CMakeLists.txt b/src/cvodes/fmod_int32/CMakeLists.txt index 031ac9c6f9..100a28feed 100644 --- a/src/cvodes/fmod_int32/CMakeLists.txt +++ b/src/cvodes/fmod_int32/CMakeLists.txt @@ -16,11 +16,10 @@ set(cvodes_SOURCES fcvodes_mod.f90 fcvodes_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvodes_mod - SOURCES - ${cvodes_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvodes_mod + SOURCES ${cvodes_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,12 +34,8 @@ sundials_add_f2003_library(sundials_fcvodes_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvodes_mod - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_fcvodes_mod + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) message(STATUS "Added CVODES F2003 interface") diff --git a/src/cvodes/fmod_int64/CMakeLists.txt b/src/cvodes/fmod_int64/CMakeLists.txt index 031ac9c6f9..100a28feed 100644 --- a/src/cvodes/fmod_int64/CMakeLists.txt +++ b/src/cvodes/fmod_int64/CMakeLists.txt @@ -16,11 +16,10 @@ set(cvodes_SOURCES fcvodes_mod.f90 fcvodes_mod.c) # Create the library -sundials_add_f2003_library(sundials_fcvodes_mod - SOURCES - ${cvodes_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fcvodes_mod + SOURCES ${cvodes_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,12 +34,8 @@ sundials_add_f2003_library(sundials_fcvodes_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fcvodes_mod - VERSION - ${cvodeslib_VERSION} - SOVERSION - ${cvodeslib_SOVERSION} -) + OUTPUT_NAME sundials_fcvodes_mod + VERSION ${cvodeslib_VERSION} + SOVERSION ${cvodeslib_SOVERSION}) message(STATUS "Added CVODES F2003 interface") diff --git a/src/ida/CMakeLists.txt b/src/ida/CMakeLists.txt index 8a7e5ae25e..d8985eef26 100644 --- a/src/ida/CMakeLists.txt +++ b/src/ida/CMakeLists.txt @@ -18,35 +18,21 @@ install(CODE "MESSAGE(\"\nInstall IDA\n\")") # Add variable ida_SOURCES with the sources for the IDA library -set(ida_SOURCES - ida.c - ida_bbdpre.c - ida_ic.c - ida_io.c - ida_ls.c - ida_nls.c - ) +set(ida_SOURCES ida.c ida_bbdpre.c ida_ic.c ida_io.c ida_ls.c ida_nls.c) # Add variable ida_HEADERS with the exported IDA header files -set(ida_HEADERS - ida.h - ida_bbdpre.h - ida_ls.h - ) +set(ida_HEADERS ida.h ida_bbdpre.h ida_ls.h) # Add prefix with complete path to the IDA header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/ida/ ida_HEADERS) # Create the library -sundials_add_library(sundials_ida - SOURCES - ${ida_SOURCES} - HEADERS - ${ida_HEADERS} - INCLUDE_SUBDIR - ida - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_ida + SOURCES ${ida_SOURCES} + HEADERS ${ida_HEADERS} + INCLUDE_SUBDIR ida + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -62,13 +48,9 @@ sundials_add_library(sundials_ida sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_ida - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_ida + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) # Finished IDA message(STATUS "Added IDA module") diff --git a/src/ida/fmod_int32/CMakeLists.txt b/src/ida/fmod_int32/CMakeLists.txt index e305f237d0..928acaa4a5 100644 --- a/src/ida/fmod_int32/CMakeLists.txt +++ b/src/ida/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(ida_SOURCES fida_mod.f90 fida_mod.c) # Create the library -sundials_add_f2003_library(sundials_fida_mod - SOURCES - ${ida_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fida_mod + SOURCES ${ida_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fida_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fida_mod - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_fida_mod + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) message(STATUS "Added IDA F2003 interface") diff --git a/src/ida/fmod_int64/CMakeLists.txt b/src/ida/fmod_int64/CMakeLists.txt index e305f237d0..928acaa4a5 100644 --- a/src/ida/fmod_int64/CMakeLists.txt +++ b/src/ida/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(ida_SOURCES fida_mod.f90 fida_mod.c) # Create the library -sundials_add_f2003_library(sundials_fida_mod - SOURCES - ${ida_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fida_mod + SOURCES ${ida_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -36,12 +35,8 @@ sundials_add_f2003_library(sundials_fida_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fida_mod - VERSION - ${idalib_VERSION} - SOVERSION - ${idalib_SOVERSION} -) + OUTPUT_NAME sundials_fida_mod + VERSION ${idalib_VERSION} + SOVERSION ${idalib_SOVERSION}) message(STATUS "Added IDA F2003 interface") diff --git a/src/idas/CMakeLists.txt b/src/idas/CMakeLists.txt index a5ed8b4739..21ebab4869 100644 --- a/src/idas/CMakeLists.txt +++ b/src/idas/CMakeLists.txt @@ -19,38 +19,30 @@ install(CODE "MESSAGE(\"\nInstall IDAS\n\")") # Add variable idas_SOURCES with the sources for the IDAS library set(idas_SOURCES - idas.c - idaa.c - idas_io.c - idas_ic.c - idaa_io.c - idas_ls.c - idas_bbdpre.c - idas_nls.c - idas_nls_sim.c - idas_nls_stg.c - ) + idas.c + idaa.c + idas_io.c + idas_ic.c + idaa_io.c + idas_ls.c + idas_bbdpre.c + idas_nls.c + idas_nls_sim.c + idas_nls_stg.c) # Add variable idas_HEADERS with the exported IDAS header files -set(idas_HEADERS - idas.h - idas_bbdpre.h - idas_ls.h - ) +set(idas_HEADERS idas.h idas_bbdpre.h idas_ls.h) # Add prefix with complete path to the IDAS header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/idas/ idas_HEADERS) # Create the library -sundials_add_library(sundials_idas - SOURCES - ${idas_SOURCES} - HEADERS - ${idas_HEADERS} - INCLUDE_SUBDIR - idas - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_idas + SOURCES ${idas_SOURCES} + HEADERS ${idas_HEADERS} + INCLUDE_SUBDIR idas + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -66,13 +58,9 @@ sundials_add_library(sundials_idas sundials_sunlinsolpcg_obj sundials_sunnonlinsolnewton_obj sundials_sunnonlinsolfixedpoint_obj - OUTPUT_NAME - sundials_idas - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_idas + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) # Finished IDAS message(STATUS "Added IDAS module") diff --git a/src/idas/fmod_int32/CMakeLists.txt b/src/idas/fmod_int32/CMakeLists.txt index a6abe6516b..5db3a92327 100644 --- a/src/idas/fmod_int32/CMakeLists.txt +++ b/src/idas/fmod_int32/CMakeLists.txt @@ -16,11 +16,10 @@ set(idas_SOURCES fidas_mod.f90 fidas_mod.c) # Create the library -sundials_add_f2003_library(sundials_fidas_mod - SOURCES - ${idas_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fidas_mod + SOURCES ${idas_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,11 +34,7 @@ sundials_add_f2003_library(sundials_fidas_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fidas_mod - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_fidas_mod + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) message(STATUS "Added IDAS F2003 interface") diff --git a/src/idas/fmod_int64/CMakeLists.txt b/src/idas/fmod_int64/CMakeLists.txt index a6abe6516b..5db3a92327 100644 --- a/src/idas/fmod_int64/CMakeLists.txt +++ b/src/idas/fmod_int64/CMakeLists.txt @@ -16,11 +16,10 @@ set(idas_SOURCES fidas_mod.f90 fidas_mod.c) # Create the library -sundials_add_f2003_library(sundials_fidas_mod - SOURCES - ${idas_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fidas_mod + SOURCES ${idas_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -35,11 +34,7 @@ sundials_add_f2003_library(sundials_fidas_mod sundials_fsunlinsolpcg_mod_obj sundials_fsunnonlinsolnewton_mod_obj sundials_fsunnonlinsolfixedpoint_mod_obj - OUTPUT_NAME - sundials_fidas_mod - VERSION - ${idaslib_VERSION} - SOVERSION - ${idaslib_SOVERSION} -) + OUTPUT_NAME sundials_fidas_mod + VERSION ${idaslib_VERSION} + SOVERSION ${idaslib_SOVERSION}) message(STATUS "Added IDAS F2003 interface") diff --git a/src/kinsol/CMakeLists.txt b/src/kinsol/CMakeLists.txt index 7306c3f449..cc03b1511d 100644 --- a/src/kinsol/CMakeLists.txt +++ b/src/kinsol/CMakeLists.txt @@ -18,33 +18,21 @@ install(CODE "MESSAGE(\"\nInstall KINSOL\n\")") # Add variable kinsol_SOURCES with the sources for the KINSOL library -set(kinsol_SOURCES - kinsol.c - kinsol_bbdpre.c - kinsol_io.c - kinsol_ls.c - ) +set(kinsol_SOURCES kinsol.c kinsol_bbdpre.c kinsol_io.c kinsol_ls.c) # Add variable kinsol_HEADERS with the exported KINSOL header files -set(kinsol_HEADERS - kinsol.h - kinsol_bbdpre.h - kinsol_ls.h - ) +set(kinsol_HEADERS kinsol.h kinsol_bbdpre.h kinsol_ls.h) # Add prefix with complete path to the KINSOL header files add_prefix(${SUNDIALS_SOURCE_DIR}/include/kinsol/ kinsol_HEADERS) # Create the library -sundials_add_library(sundials_kinsol - SOURCES - ${kinsol_SOURCES} - HEADERS - ${kinsol_HEADERS} - INCLUDE_SUBDIR - kinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_kinsol + SOURCES ${kinsol_SOURCES} + HEADERS ${kinsol_HEADERS} + INCLUDE_SUBDIR kinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES sundials_sunmemsys_obj sundials_nvecserial_obj @@ -58,13 +46,9 @@ sundials_add_library(sundials_kinsol sundials_sunlinsolspgmr_obj sundials_sunlinsolsptfqmr_obj sundials_sunlinsolpcg_obj - OUTPUT_NAME - sundials_kinsol - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_kinsol + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) # Finished KINSOL message(STATUS "Added KINSOL module") diff --git a/src/kinsol/fmod_int32/CMakeLists.txt b/src/kinsol/fmod_int32/CMakeLists.txt index a154a8b865..8f127375de 100644 --- a/src/kinsol/fmod_int32/CMakeLists.txt +++ b/src/kinsol/fmod_int32/CMakeLists.txt @@ -17,11 +17,10 @@ set(kinsol_SOURCES fkinsol_mod.f90 fkinsol_mod.c) # Create the library -sundials_add_f2003_library(sundials_fkinsol_mod - SOURCES - ${kinsol_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fkinsol_mod + SOURCES ${kinsol_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -34,12 +33,8 @@ sundials_add_f2003_library(sundials_fkinsol_mod sundials_fsunlinsolspgmr_mod_obj sundials_fsunlinsolsptfqmr_mod_obj sundials_fsunlinsolpcg_mod_obj - OUTPUT_NAME - sundials_fkinsol_mod - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fkinsol_mod + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) message(STATUS "Added KINSOL F2003 interface") diff --git a/src/kinsol/fmod_int64/CMakeLists.txt b/src/kinsol/fmod_int64/CMakeLists.txt index a154a8b865..8f127375de 100644 --- a/src/kinsol/fmod_int64/CMakeLists.txt +++ b/src/kinsol/fmod_int64/CMakeLists.txt @@ -17,11 +17,10 @@ set(kinsol_SOURCES fkinsol_mod.f90 fkinsol_mod.c) # Create the library -sundials_add_f2003_library(sundials_fkinsol_mod - SOURCES - ${kinsol_SOURCES} - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fkinsol_mod + SOURCES ${kinsol_SOURCES} + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES sundials_fnvecserial_mod_obj sundials_fsunmatrixband_mod_obj @@ -34,12 +33,8 @@ sundials_add_f2003_library(sundials_fkinsol_mod sundials_fsunlinsolspgmr_mod_obj sundials_fsunlinsolsptfqmr_mod_obj sundials_fsunlinsolpcg_mod_obj - OUTPUT_NAME - sundials_fkinsol_mod - VERSION - ${kinsollib_VERSION} - SOVERSION - ${kinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fkinsol_mod + VERSION ${kinsollib_VERSION} + SOVERSION ${kinsollib_SOVERSION}) message(STATUS "Added KINSOL F2003 interface") diff --git a/src/nvector/CMakeLists.txt b/src/nvector/CMakeLists.txt index 182a2bc3c8..5c9c1307ef 100644 --- a/src/nvector/CMakeLists.txt +++ b/src/nvector/CMakeLists.txt @@ -75,18 +75,20 @@ if(BUILD_NVECTOR_KOKKOS) add_library(sundials_nveckokkos INTERFACE) target_link_libraries(sundials_nveckokkos INTERFACE sundials_core) if(ENABLE_HIP) - target_link_libraries(sundials_nveckokkos INTERFACE - Kokkos::kokkos hip::device) + target_link_libraries(sundials_nveckokkos INTERFACE Kokkos::kokkos + hip::device) else() - target_link_libraries(sundials_nveckokkos INTERFACE - Kokkos::kokkos) + target_link_libraries(sundials_nveckokkos INTERFACE Kokkos::kokkos) endif() - target_include_directories(sundials_nveckokkos INTERFACE - $ - $ - $ - $) + target_include_directories( + sundials_nveckokkos + INTERFACE $ + $ + $ + $) install(FILES ${PROJECT_SOURCE_DIR}/include/nvector/nvector_kokkos.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector") - set(_SUNDIALS_INSTALLED_COMPONENTS "nveckokkos;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector") + set(_SUNDIALS_INSTALLED_COMPONENTS + "nveckokkos;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() diff --git a/src/nvector/cuda/CMakeLists.txt b/src/nvector/cuda/CMakeLists.txt index 8452b9eef2..117373035c 100644 --- a/src/nvector/cuda/CMakeLists.txt +++ b/src/nvector/cuda/CMakeLists.txt @@ -17,23 +17,15 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_CUDA\n\")") # Create the library -sundials_add_library(sundials_nveccuda - SOURCES - nvector_cuda.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_cuda.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemcuda_obj - OUTPUT_NAME - sundials_nveccuda - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nveccuda + SOURCES nvector_cuda.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_cuda.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemcuda_obj + OUTPUT_NAME sundials_nveccuda + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_CUDA module") diff --git a/src/nvector/hip/CMakeLists.txt b/src/nvector/hip/CMakeLists.txt index 71736301ee..71ef53f40f 100644 --- a/src/nvector/hip/CMakeLists.txt +++ b/src/nvector/hip/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_HIP\n\")") # Create the library -sundials_add_library(sundials_nvechip - SOURCES - nvector_hip.hip.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_hip.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemhip_obj - LINK_LIBRARIES - PUBLIC hip::device - OUTPUT_NAME - sundials_nvechip - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvechip + SOURCES nvector_hip.hip.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_hip.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemhip_obj + LINK_LIBRARIES PUBLIC hip::device + OUTPUT_NAME sundials_nvechip + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_HIP module") diff --git a/src/nvector/manyvector/CMakeLists.txt b/src/nvector/manyvector/CMakeLists.txt index 4080f60ffc..e5bd67c722 100644 --- a/src/nvector/manyvector/CMakeLists.txt +++ b/src/nvector/manyvector/CMakeLists.txt @@ -19,22 +19,15 @@ if(BUILD_NVECTOR_MANYVECTOR) install(CODE "MESSAGE(\"\nInstall NVECTOR_MANYVECTOR\n\")") - sundials_add_library(sundials_nvecmanyvector - SOURCES - nvector_manyvector.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_manyvector.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OUTPUT_NAME - sundials_nvecmanyvector - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_library( + sundials_nvecmanyvector + SOURCES nvector_manyvector.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_manyvector.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OUTPUT_NAME sundials_nvecmanyvector + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR module") endif() @@ -52,24 +45,16 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) endif() # Create the sundials_nvecmpimanyvector library - sundials_add_library(sundials_nvecmpimanyvector - SOURCES - nvector_manyvector.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpimanyvector.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - COMPILE_DEFINITIONS - PRIVATE MANYVECTOR_BUILD_WITH_MPI - OUTPUT_NAME - sundials_nvecmpimanyvector - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_library( + sundials_nvecmpimanyvector + SOURCES nvector_manyvector.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpimanyvector.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + COMPILE_DEFINITIONS PRIVATE MANYVECTOR_BUILD_WITH_MPI + OUTPUT_NAME sundials_nvecmpimanyvector + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR module") endif() diff --git a/src/nvector/manyvector/fmod_int32/CMakeLists.txt b/src/nvector/manyvector/fmod_int32/CMakeLists.txt index 8033da01f7..2908e42e37 100644 --- a/src/nvector/manyvector/fmod_int32/CMakeLists.txt +++ b/src/nvector/manyvector/fmod_int32/CMakeLists.txt @@ -15,18 +15,13 @@ # --------------------------------------------------------------- if(BUILD_NVECTOR_MANYVECTOR) - sundials_add_f2003_library(sundials_fnvecmanyvector_mod - SOURCES - fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmanyvector_mod + SOURCES fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR F2003 Interface") endif() @@ -44,18 +39,13 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() - sundials_add_f2003_library(sundials_fnvecmpimanyvector_mod - SOURCES - fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmpimanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmpimanyvector_mod + SOURCES fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmpimanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR F2003 Interface") endif() diff --git a/src/nvector/manyvector/fmod_int64/CMakeLists.txt b/src/nvector/manyvector/fmod_int64/CMakeLists.txt index 8033da01f7..2908e42e37 100644 --- a/src/nvector/manyvector/fmod_int64/CMakeLists.txt +++ b/src/nvector/manyvector/fmod_int64/CMakeLists.txt @@ -15,18 +15,13 @@ # --------------------------------------------------------------- if(BUILD_NVECTOR_MANYVECTOR) - sundials_add_f2003_library(sundials_fnvecmanyvector_mod - SOURCES - fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmanyvector_mod + SOURCES fnvector_manyvector_mod.f90 fnvector_manyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MANYVECTOR F2003 Interface") endif() @@ -44,18 +39,13 @@ if(BUILD_NVECTOR_MPIMANYVECTOR) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() - sundials_add_f2003_library(sundials_fnvecmpimanyvector_mod - SOURCES - fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecmpimanyvector_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} - ) + sundials_add_f2003_library( + sundials_fnvecmpimanyvector_mod + SOURCES fnvector_mpimanyvector_mod.f90 fnvector_mpimanyvector_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecmpimanyvector_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIMANYVECTOR F2003 Interface") endif() diff --git a/src/nvector/mpiplusx/CMakeLists.txt b/src/nvector/mpiplusx/CMakeLists.txt index 1be179696d..98f3fa36dc 100644 --- a/src/nvector/mpiplusx/CMakeLists.txt +++ b/src/nvector/mpiplusx/CMakeLists.txt @@ -25,24 +25,16 @@ elseif(MPI_C_FOUND) endif() # Create the library -sundials_add_library(sundials_nvecmpiplusx - SOURCES - nvector_mpiplusx.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpiplusx.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_nvecmpimanyvector_obj - OUTPUT_NAME - sundials_nvecmpiplusx - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecmpiplusx + SOURCES nvector_mpiplusx.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_mpiplusx.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_nvecmpimanyvector_obj + OUTPUT_NAME sundials_nvecmpiplusx + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX module") diff --git a/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt index d068b3609f..aaa836eba9 100644 --- a/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt +++ b/src/nvector/mpiplusx/fmod_int32/CMakeLists.txt @@ -26,18 +26,13 @@ if(MPI_Fortran_COMPILER) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() -sundials_add_f2003_library(sundials_fnvecmpiplusx_mod - SOURCES - fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecmpiplusx_mod + SOURCES fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecmpiplusx_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecmpiplusx_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX F2003 interface") diff --git a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt index d068b3609f..aaa836eba9 100644 --- a/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt +++ b/src/nvector/mpiplusx/fmod_int64/CMakeLists.txt @@ -26,18 +26,13 @@ if(MPI_Fortran_COMPILER) set(CMAKE_Fortran_COMPILER ${MPI_Fortran_COMPILER}) endif() -sundials_add_f2003_library(sundials_fnvecmpiplusx_mod - SOURCES - fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecmpiplusx_mod + SOURCES fnvector_mpiplusx_mod.f90 fnvector_mpiplusx_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecmpiplusx_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecmpiplusx_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_MPIPLUSX F2003 interface") diff --git a/src/nvector/openmp/CMakeLists.txt b/src/nvector/openmp/CMakeLists.txt index 9cbc2f35fe..bb3387b8f1 100644 --- a/src/nvector/openmp/CMakeLists.txt +++ b/src/nvector/openmp/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_OPENMP\n\")") # Create the library -sundials_add_library(sundials_nvecopenmp - SOURCES - nvector_openmp.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmp.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecopenmp + SOURCES nvector_openmp.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmp.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC OpenMP::OpenMP_C - OUTPUT_NAME - sundials_nvecopenmp - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC OpenMP::OpenMP_C + OUTPUT_NAME sundials_nvecopenmp + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP module") diff --git a/src/nvector/openmp/fmod_int32/CMakeLists.txt b/src/nvector/openmp/fmod_int32/CMakeLists.txt index 31f4363b84..6510270db2 100644 --- a/src/nvector/openmp/fmod_int32/CMakeLists.txt +++ b/src/nvector/openmp/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 openmp NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecopenmp_mod - SOURCES - fnvector_openmp_mod.f90 fnvector_openmp_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecopenmp_mod + SOURCES fnvector_openmp_mod.f90 fnvector_openmp_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecopenmp_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecopenmp_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP F2003 interface") diff --git a/src/nvector/openmp/fmod_int64/CMakeLists.txt b/src/nvector/openmp/fmod_int64/CMakeLists.txt index 31f4363b84..6510270db2 100644 --- a/src/nvector/openmp/fmod_int64/CMakeLists.txt +++ b/src/nvector/openmp/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 openmp NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecopenmp_mod - SOURCES - fnvector_openmp_mod.f90 fnvector_openmp_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecopenmp_mod + SOURCES fnvector_openmp_mod.f90 fnvector_openmp_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecopenmp_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecopenmp_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMP F2003 interface") diff --git a/src/nvector/openmpdev/CMakeLists.txt b/src/nvector/openmpdev/CMakeLists.txt index 015a3ecbcf..fb3d7f988b 100644 --- a/src/nvector/openmpdev/CMakeLists.txt +++ b/src/nvector/openmpdev/CMakeLists.txt @@ -17,24 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_OPENMPDEV\n\")") # Create the library -sundials_add_library(sundials_nvecopenmpdev - SOURCES - nvector_openmpdev.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmpdev.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecopenmpdev + SOURCES nvector_openmpdev.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_openmpdev.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC OpenMP::OpenMP_C - OUTPUT_NAME - sundials_nvecopenmpdev - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC OpenMP::OpenMP_C + OUTPUT_NAME sundials_nvecopenmpdev + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_OPENMPDEV module") diff --git a/src/nvector/parallel/CMakeLists.txt b/src/nvector/parallel/CMakeLists.txt index 55effd6b9a..df960a9a77 100644 --- a/src/nvector/parallel/CMakeLists.txt +++ b/src/nvector/parallel/CMakeLists.txt @@ -25,23 +25,16 @@ else() endif() # Create the library -sundials_add_library(sundials_nvecparallel - SOURCES - nvector_parallel.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parallel.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecparallel + SOURCES nvector_parallel.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parallel.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_nvecparallel - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_nvecparallel + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL module") diff --git a/src/nvector/parallel/fmod_int32/CMakeLists.txt b/src/nvector/parallel/fmod_int32/CMakeLists.txt index 3b4031b8c9..98c301b871 100644 --- a/src/nvector/parallel/fmod_int32/CMakeLists.txt +++ b/src/nvector/parallel/fmod_int32/CMakeLists.txt @@ -32,18 +32,13 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -sundials_add_f2003_library(sundials_fnvecparallel_mod - SOURCES - fnvector_parallel_mod.f90 fnvector_parallel_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecparallel_mod + SOURCES fnvector_parallel_mod.f90 fnvector_parallel_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecparallel_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecparallel_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL F2003 interface") diff --git a/src/nvector/parallel/fmod_int64/CMakeLists.txt b/src/nvector/parallel/fmod_int64/CMakeLists.txt index 3b4031b8c9..98c301b871 100644 --- a/src/nvector/parallel/fmod_int64/CMakeLists.txt +++ b/src/nvector/parallel/fmod_int64/CMakeLists.txt @@ -32,18 +32,13 @@ else() include_directories(${MPI_INCLUDE_PATH}) endif() -sundials_add_f2003_library(sundials_fnvecparallel_mod - SOURCES - fnvector_parallel_mod.f90 fnvector_parallel_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecparallel_mod + SOURCES fnvector_parallel_mod.f90 fnvector_parallel_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecparallel_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecparallel_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARALLEL F2003 interface") diff --git a/src/nvector/parhyp/CMakeLists.txt b/src/nvector/parhyp/CMakeLists.txt index f4ef295681..56724e1c9d 100644 --- a/src/nvector/parhyp/CMakeLists.txt +++ b/src/nvector/parhyp/CMakeLists.txt @@ -17,26 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_PARHYP\n\")") # Create the library -sundials_add_library(sundials_nvecparhyp - SOURCES - nvector_parhyp.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parhyp.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecparhyp + SOURCES nvector_parhyp.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_parhyp.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC - SUNDIALS::HYPRE - MPI::MPI_C - OUTPUT_NAME - sundials_nvecparhyp - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::HYPRE MPI::MPI_C + OUTPUT_NAME sundials_nvecparhyp + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PARHYP module") diff --git a/src/nvector/petsc/CMakeLists.txt b/src/nvector/petsc/CMakeLists.txt index 34fe418818..ed3dcab60e 100644 --- a/src/nvector/petsc/CMakeLists.txt +++ b/src/nvector/petsc/CMakeLists.txt @@ -25,24 +25,16 @@ else() endif() # Create the library -sundials_add_library(sundials_nvecpetsc - SOURCES - nvector_petsc.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_petsc.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecpetsc + SOURCES nvector_petsc.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_petsc.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::PETSC - OUTPUT_NAME - sundials_nvecpetsc - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::PETSC + OUTPUT_NAME sundials_nvecpetsc + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PETSC module") diff --git a/src/nvector/pthreads/CMakeLists.txt b/src/nvector/pthreads/CMakeLists.txt index 2aafa31e4a..447f1c91e5 100644 --- a/src/nvector/pthreads/CMakeLists.txt +++ b/src/nvector/pthreads/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_PTHREADS\n\")") # Create the library -sundials_add_library(sundials_nvecpthreads - SOURCES - nvector_pthreads.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_pthreads.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecpthreads + SOURCES nvector_pthreads.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_pthreads.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PRIVATE Threads::Threads - OUTPUT_NAME - sundials_nvecpthreads - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PRIVATE Threads::Threads + OUTPUT_NAME sundials_nvecpthreads + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS module") diff --git a/src/nvector/pthreads/fmod_int32/CMakeLists.txt b/src/nvector/pthreads/fmod_int32/CMakeLists.txt index e43ebc9c08..5fcf786118 100644 --- a/src/nvector/pthreads/fmod_int32/CMakeLists.txt +++ b/src/nvector/pthreads/fmod_int32/CMakeLists.txt @@ -16,18 +16,13 @@ set(nvecpthreads_SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c) -sundials_add_f2003_library(sundials_fnvecpthreads_mod - SOURCES - fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecpthreads_mod + SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecpthreads_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecpthreads_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS F2003 interface") diff --git a/src/nvector/pthreads/fmod_int64/CMakeLists.txt b/src/nvector/pthreads/fmod_int64/CMakeLists.txt index e43ebc9c08..5fcf786118 100644 --- a/src/nvector/pthreads/fmod_int64/CMakeLists.txt +++ b/src/nvector/pthreads/fmod_int64/CMakeLists.txt @@ -16,18 +16,13 @@ set(nvecpthreads_SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c) -sundials_add_f2003_library(sundials_fnvecpthreads_mod - SOURCES - fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecpthreads_mod + SOURCES fnvector_pthreads_mod.f90 fnvector_pthreads_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecpthreads_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecpthreads_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_PTHREADS F2003 interface") diff --git a/src/nvector/raja/CMakeLists.txt b/src/nvector/raja/CMakeLists.txt index 1dbfd8197a..247f8bf424 100644 --- a/src/nvector/raja/CMakeLists.txt +++ b/src/nvector/raja/CMakeLists.txt @@ -14,7 +14,9 @@ # CMakeLists.txt file for the RAJA NVECTOR library # --------------------------------------------------------------- -install(CODE "MESSAGE(\"\nInstall NVECTOR_RAJA with ${SUNDIALS_RAJA_BACKENDS} backend(s)\n\")") +install( + CODE "MESSAGE(\"\nInstall NVECTOR_RAJA with ${SUNDIALS_RAJA_BACKENDS} backend(s)\n\")" +) if(SUNDIALS_RAJA_BACKENDS MATCHES "CUDA") set(_sunmemlib sundials_sunmemcuda_obj) @@ -33,31 +35,20 @@ elseif(SUNDIALS_RAJA_BACKENDS MATCHES "SYCL") endif() # Create the library -sundials_add_library(sundials_nvecraja - SOURCES - nvector_raja.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_raja.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - ${_sunmemlib} - LINK_LIBRARIES - PUBLIC ${_hip_lib_or_not} RAJA - COMPILE_OPTIONS - PUBLIC $<$:--expt-extended-lambda> - COMPILE_DEFINITIONS - PRIVATE ${_compile_defs} - COMPILE_FEATURES - PUBLIC ${_cxx_std} - OUTPUT_NAME - ${_lib_output_name} - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecraja + SOURCES nvector_raja.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_raja.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES ${_sunmemlib} + LINK_LIBRARIES PUBLIC ${_hip_lib_or_not} RAJA + COMPILE_OPTIONS PUBLIC $<$:--expt-extended-lambda> + COMPILE_DEFINITIONS PRIVATE ${_compile_defs} + COMPILE_FEATURES PUBLIC ${_cxx_std} + OUTPUT_NAME ${_lib_output_name} + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) -message(STATUS "Added NVECTOR_RAJA module with ${SUNDIALS_RAJA_BACKENDS} backend") +message( + STATUS "Added NVECTOR_RAJA module with ${SUNDIALS_RAJA_BACKENDS} backend") diff --git a/src/nvector/serial/CMakeLists.txt b/src/nvector/serial/CMakeLists.txt index c8e867daa8..976b8440f2 100644 --- a/src/nvector/serial/CMakeLists.txt +++ b/src/nvector/serial/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_SERIAL\n\")") # Create the sundials_nvecserial library -sundials_add_library(sundials_nvecserial - SOURCES - nvector_serial.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_serial.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvecserial + SOURCES nvector_serial.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_serial.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_nvecserial - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_nvecserial + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL module") diff --git a/src/nvector/serial/fmod_int32/CMakeLists.txt b/src/nvector/serial/fmod_int32/CMakeLists.txt index ebf2ec0182..fbfc2e3344 100644 --- a/src/nvector/serial/fmod_int32/CMakeLists.txt +++ b/src/nvector/serial/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 serial NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecserial_mod - SOURCES - fnvector_serial_mod.f90 fnvector_serial_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fnvecserial_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fnvecserial_mod + SOURCES fnvector_serial_mod.f90 fnvector_serial_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fnvecserial_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL F2003 interface") diff --git a/src/nvector/serial/fmod_int64/CMakeLists.txt b/src/nvector/serial/fmod_int64/CMakeLists.txt index 293239b9fb..e52f2ae867 100644 --- a/src/nvector/serial/fmod_int64/CMakeLists.txt +++ b/src/nvector/serial/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 serial NVECTOR object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fnvecserial_mod - SOURCES - fnvector_serial_mod.f90 fnvector_serial_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fnvecserial_mod + SOURCES fnvector_serial_mod.f90 fnvector_serial_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fnvecserial_mod - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + OUTPUT_NAME sundials_fnvecserial_mod + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SERIAL F2003 interface") diff --git a/src/nvector/sycl/CMakeLists.txt b/src/nvector/sycl/CMakeLists.txt index 47fac19d77..51dc3ddc8c 100644 --- a/src/nvector/sycl/CMakeLists.txt +++ b/src/nvector/sycl/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_SYCL\n\")") # Create the library -sundials_add_library(sundials_nvecsycl - SOURCES - nvector_sycl.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_sycl.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemsycl_obj - COMPILE_FEATURES - PUBLIC cxx_std_17 - OUTPUT_NAME - sundials_nvecsycl - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_nvecsycl + SOURCES nvector_sycl.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_sycl.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemsycl_obj + COMPILE_FEATURES PUBLIC cxx_std_17 + OUTPUT_NAME sundials_nvecsycl + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added NVECTOR_SYCL module") diff --git a/src/nvector/trilinos/CMakeLists.txt b/src/nvector/trilinos/CMakeLists.txt index 8b98960d0c..d2d119cb3e 100644 --- a/src/nvector/trilinos/CMakeLists.txt +++ b/src/nvector/trilinos/CMakeLists.txt @@ -18,35 +18,29 @@ install(CODE "MESSAGE(\"\nInstall NVECTOR_Trilinos\n\")") # Set Trilinos compilers/flags set(CMAKE_CXX_COMPILER ${Trilinos_INTERFACE_CXX_COMPILER}) -set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") +set(CMAKE_C_COMPILER ${Trilinos_INTERFACE_C_COMPILER}) +set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} ${Trilinos_INTERFACE_CXX_COMPILER_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${Trilinos_INTERFACE_C_COMPILER_FLAGS}") # Create the library -sundials_add_library(sundials_nvectrilinos - SOURCES - nvector_trilinos.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_trilinos.h - INCLUDE_SUBDIR - nvector - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_nvectrilinos + SOURCES nvector_trilinos.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/nvector/nvector_trilinos.h + INCLUDE_SUBDIR nvector + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::TRILINOS - OUTPUT_NAME - sundials_nvectrilinos - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::TRILINOS + OUTPUT_NAME sundials_nvectrilinos + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) # Install the exported NVECTRILINOS CXX header files in a separate subdirectory -install(FILES - ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp - ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector/trilinos") +install( + FILES + ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorInterface.hpp + ${SUNDIALS_SOURCE_DIR}/include/nvector/trilinos/SundialsTpetraVectorKernels.hpp + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/nvector/trilinos") message(STATUS "Added NVECTOR_Trilinos module") diff --git a/src/sunadaptcontroller/imexgus/CMakeLists.txt b/src/sunadaptcontroller/imexgus/CMakeLists.txt index 8bbef68cdf..91367cf3ba 100644 --- a/src/sunadaptcontroller/imexgus/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/CMakeLists.txt @@ -13,17 +13,14 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunadaptcontrollerimexgus - SOURCES - sunadaptcontroller_imexgus.c +sundials_add_library( + sundials_sunadaptcontrollerimexgus + SOURCES sunadaptcontroller_imexgus.c HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_imexgus.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunadaptcontroller - OBJECT_LIB_ONLY -) + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunadaptcontroller + OBJECT_LIB_ONLY) # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt index 0c4142417c..8fe6e45f40 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int32/CMakeLists.txt @@ -12,14 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod - SOURCES - fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollerimexgus_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollerimexgus_mod + SOURCES fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt index 0c4142417c..8fe6e45f40 100644 --- a/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/imexgus/fmod_int64/CMakeLists.txt @@ -12,14 +12,10 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollerimexgus_mod - SOURCES - fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollerimexgus_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollerimexgus_mod + SOURCES fsunadaptcontroller_imexgus_mod.f90 fsunadaptcontroller_imexgus_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollerimexgus_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_ImExGus F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/CMakeLists.txt b/src/sunadaptcontroller/soderlind/CMakeLists.txt index 50cf7330bc..9c2613703c 100644 --- a/src/sunadaptcontroller/soderlind/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/CMakeLists.txt @@ -13,17 +13,14 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunadaptcontrollersoderlind - SOURCES - sunadaptcontroller_soderlind.c +sundials_add_library( + sundials_sunadaptcontrollersoderlind + SOURCES sunadaptcontroller_soderlind.c HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunadaptcontroller/sunadaptcontroller_soderlind.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunadaptcontroller - OBJECT_LIB_ONLY -) + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunadaptcontroller + OBJECT_LIB_ONLY) # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt index cdf9d3825e..81863c3a8c 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int32/CMakeLists.txt @@ -12,14 +12,11 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod - SOURCES - fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollersoderlind_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollersoderlind_mod + SOURCES fsunadaptcontroller_soderlind_mod.f90 + fsunadaptcontroller_soderlind_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt index cdf9d3825e..81863c3a8c 100644 --- a/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt +++ b/src/sunadaptcontroller/soderlind/fmod_int64/CMakeLists.txt @@ -12,14 +12,11 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunadaptcontrollersoderlind_mod - SOURCES - fsunadaptcontroller_soderlind_mod.f90 fsunadaptcontroller_soderlind_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunadaptcontrollersoderlind_mod - OBJECT_LIB_ONLY -) +sundials_add_f2003_library( + sundials_fsunadaptcontrollersoderlind_mod + SOURCES fsunadaptcontroller_soderlind_mod.f90 + fsunadaptcontroller_soderlind_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunadaptcontrollersoderlind_mod OBJECT_LIB_ONLY) message(STATUS "Added SUNAdaptController_Soderlind F2003 interface") diff --git a/src/sundials/CMakeLists.txt b/src/sundials/CMakeLists.txt index b8a19e2ff2..cf31cb497e 100644 --- a/src/sundials/CMakeLists.txt +++ b/src/sundials/CMakeLists.txt @@ -14,45 +14,44 @@ # CMakeLists.txt file for the generic SUNDIALS modules # --------------------------------------------------------------- -# From here we only install the generic SUNDIALS headers. -# The implementations themselves are incorporated in the individual SUNDIALS solver libraries. +# From here we only install the generic SUNDIALS headers. The implementations +# themselves are incorporated in the individual SUNDIALS solver libraries. install(CODE "MESSAGE(\"\nInstall shared components\n\")") # Add variable sundials_HEADERS with the exported SUNDIALS header files set(sundials_HEADERS - sundials_adaptcontroller.h - sundials_band.h - sundials_base.hpp - sundials_context.h - sundials_context.hpp - sundials_convertibleto.hpp - sundials_core.h - sundials_core.hpp - sundials_dense.h - sundials_direct.h - sundials_errors.h - sundials_futils.h - sundials_iterative.h - sundials_linearsolver.h - sundials_linearsolver.hpp - sundials_logger.h - sundials_math.h - sundials_matrix.h - sundials_matrix.hpp - sundials_memory.h - sundials_memory.hpp - sundials_mpi_types.h - sundials_nonlinearsolver.h - sundials_nonlinearsolver.hpp - sundials_nvector.h - sundials_nvector.hpp - sundials_profiler.h - sundials_profiler.hpp - sundials_types_deprecated.h - sundials_types.h - sundials_version.h - ) + sundials_adaptcontroller.h + sundials_band.h + sundials_base.hpp + sundials_context.h + sundials_context.hpp + sundials_convertibleto.hpp + sundials_core.h + sundials_core.hpp + sundials_dense.h + sundials_direct.h + sundials_errors.h + sundials_futils.h + sundials_iterative.h + sundials_linearsolver.h + sundials_linearsolver.hpp + sundials_logger.h + sundials_math.h + sundials_matrix.h + sundials_matrix.hpp + sundials_memory.h + sundials_memory.hpp + sundials_mpi_types.h + sundials_nonlinearsolver.h + sundials_nonlinearsolver.hpp + sundials_nvector.h + sundials_nvector.hpp + sundials_profiler.h + sundials_profiler.hpp + sundials_types_deprecated.h + sundials_types.h + sundials_version.h) if(ENABLE_MPI) list(APPEND sundials_HEADERS sundials_mpi_errors.h) @@ -79,26 +78,25 @@ endif() add_prefix(${SUNDIALS_SOURCE_DIR}/include/sundials/ sundials_HEADERS) set(sundials_SOURCES - sundials_adaptcontroller.c - sundials_band.c - sundials_context.c - sundials_dense.c - sundials_direct.c - sundials_errors.c - sundials_futils.c - sundials_hashmap.c - sundials_iterative.c - sundials_linearsolver.c - sundials_logger.c - sundials_math.c - sundials_matrix.c - sundials_memory.c - sundials_nonlinearsolver.c - sundials_nvector_senswrapper.c - sundials_nvector.c - sundials_profiler.c - sundials_version.c - ) + sundials_adaptcontroller.c + sundials_band.c + sundials_context.c + sundials_dense.c + sundials_direct.c + sundials_errors.c + sundials_futils.c + sundials_hashmap.c + sundials_iterative.c + sundials_linearsolver.c + sundials_logger.c + sundials_math.c + sundials_matrix.c + sundials_memory.c + sundials_nonlinearsolver.c + sundials_nvector_senswrapper.c + sundials_nvector.c + sundials_profiler.c + sundials_version.c) if(ENABLE_MPI) list(APPEND sundials_SOURCES sundials_mpi_errors.c) @@ -108,12 +106,10 @@ endif() add_prefix(${SUNDIALS_SOURCE_DIR}/src/sundials/ sundials_SOURCES) if(ENABLE_MPI) - set(_link_mpi_if_needed PUBLIC - MPI::MPI_C - $<$:MPI::MPI_CXX>) + set(_link_mpi_if_needed PUBLIC MPI::MPI_C + $<$:MPI::MPI_CXX>) endif() - if(SUNDIALS_BUILD_WITH_PROFILING) if(ENABLE_CALIPER) set(_link_caliper_if_needed PUBLIC caliper) @@ -124,42 +120,34 @@ if(SUNDIALS_BUILD_WITH_PROFILING) endif() # Create a library out of the generic sundials modules -sundials_add_library(sundials_core - SOURCES - ${sundials_SOURCES} - HEADERS - ${sundials_HEADERS} - INCLUDE_SUBDIR - sundials - LINK_LIBRARIES - ${_link_mpi_if_needed} - OUTPUT_NAME - sundials_core - VERSION - ${sundialslib_VERSION} - SOVERSION - ${sundialslib_SOVERSION} -) +sundials_add_library( + sundials_core + SOURCES ${sundials_SOURCES} + HEADERS ${sundials_HEADERS} + INCLUDE_SUBDIR sundials + LINK_LIBRARIES ${_link_mpi_if_needed} + OUTPUT_NAME sundials_core + VERSION ${sundialslib_VERSION} + SOVERSION ${sundialslib_SOVERSION}) # Install private headers -install(FILES - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_context_impl.h - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_errors_impl.h +install( + FILES ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_context_impl.h + ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_errors_impl.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials/priv") if(ENABLE_MPI) - install(FILES - ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_mpi_errors_impl.h + install( + FILES + ${SUNDIALS_SOURCE_DIR}/include/sundials/priv/sundials_mpi_errors_impl.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials/priv") endif() # SUNDIALS_EXPORT macro include(GenerateExportHeader) generate_export_header( - sundials_core BASE_NAME SUNDIALS - EXPORT_FILE_NAME - "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h" -) + sundials_core BASE_NAME SUNDIALS EXPORT_FILE_NAME + "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h") # Add F2003 module if the interface is enabled if(BUILD_FORTRAN_MODULE_INTERFACE) diff --git a/src/sundials/fmod_int32/CMakeLists.txt b/src/sundials/fmod_int32/CMakeLists.txt index 957328e8ff..b9a43aeded 100644 --- a/src/sundials/fmod_int32/CMakeLists.txt +++ b/src/sundials/fmod_int32/CMakeLists.txt @@ -14,12 +14,6 @@ # CMakeLists.txt file for the F2003 SUNDIALS object library # --------------------------------------------------------------- -set(sundials_SOURCES - fsundials_core_mod.c - fsundials_core_mod.f90 - ) +set(sundials_SOURCES fsundials_core_mod.c fsundials_core_mod.f90) -sundials_add_f2003_library(sundials_fcore_mod - SOURCES - ${sundials_SOURCES} -) +sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES}) diff --git a/src/sundials/fmod_int64/CMakeLists.txt b/src/sundials/fmod_int64/CMakeLists.txt index 957328e8ff..b9a43aeded 100644 --- a/src/sundials/fmod_int64/CMakeLists.txt +++ b/src/sundials/fmod_int64/CMakeLists.txt @@ -14,12 +14,6 @@ # CMakeLists.txt file for the F2003 SUNDIALS object library # --------------------------------------------------------------- -set(sundials_SOURCES - fsundials_core_mod.c - fsundials_core_mod.f90 - ) +set(sundials_SOURCES fsundials_core_mod.c fsundials_core_mod.f90) -sundials_add_f2003_library(sundials_fcore_mod - SOURCES - ${sundials_SOURCES} -) +sundials_add_f2003_library(sundials_fcore_mod SOURCES ${sundials_SOURCES}) diff --git a/src/sunlinsol/CMakeLists.txt b/src/sunlinsol/CMakeLists.txt index a39352ec6a..976a77a2a5 100644 --- a/src/sunlinsol/CMakeLists.txt +++ b/src/sunlinsol/CMakeLists.txt @@ -33,14 +33,17 @@ if(BUILD_SUNLINSOL_GINKGO) message(STATUS "Added BUILD_SUNLINSOL_GINKGO module") add_library(sundials_sunlinsolginkgo INTERFACE) target_link_libraries(sundials_sunlinsolginkgo INTERFACE sundials_core) - target_include_directories(sundials_sunlinsolginkgo INTERFACE - $ - $ - $ - $) + target_include_directories( + sundials_sunlinsolginkgo + INTERFACE $ + $ + $ + $) install(FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_ginkgo.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunlinsolginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunlinsolginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNLINSOL_KLU) @@ -51,16 +54,21 @@ if(BUILD_SUNLINSOL_KOKKOSDENSE) install(CODE "MESSAGE(\"\nInstall SUNLINSOL_KOKKOSDENSE\n\")") message(STATUS "Added BUILD_SUNLINSOL_KOKKOSDENSE module") add_library(sundials_sunlinsolkokkosdense INTERFACE) - target_link_libraries(sundials_sunlinsolkokkosdense INTERFACE - sundials_core Kokkos::kokkos Kokkos::kokkoskernels) - target_include_directories(sundials_sunlinsolkokkosdense INTERFACE - $ - $ - $ - $) - install(FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_kokkosdense.hpp + target_link_libraries( + sundials_sunlinsolkokkosdense INTERFACE sundials_core Kokkos::kokkos + Kokkos::kokkoskernels) + target_include_directories( + sundials_sunlinsolkokkosdense + INTERFACE $ + $ + $ + $) + install( + FILES ${PROJECT_SOURCE_DIR}/include/sunlinsol/sunlinsol_kokkosdense.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunlinsol") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunlinsolkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunlinsolkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNLINSOL_LAPACKBAND) diff --git a/src/sunlinsol/band/CMakeLists.txt b/src/sunlinsol/band/CMakeLists.txt index 0b2035e0ef..2fd2ffadf3 100644 --- a/src/sunlinsol/band/CMakeLists.txt +++ b/src/sunlinsol/band/CMakeLists.txt @@ -18,25 +18,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_BAND\n\")") # Add the library -sundials_add_library(sundials_sunlinsolband - SOURCES - sunlinsol_band.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_band.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolband + SOURCES sunlinsol_band.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_band.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixband - OUTPUT_NAME - sundials_sunlinsolband - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixband + OUTPUT_NAME sundials_sunlinsolband + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND module") diff --git a/src/sunlinsol/band/fmod_int32/CMakeLists.txt b/src/sunlinsol/band/fmod_int32/CMakeLists.txt index 8b6e38724e..4a348ffb70 100644 --- a/src/sunlinsol/band/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/band/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 band SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolband_mod - SOURCES - fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixband_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolband_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolband_mod + SOURCES fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixband_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolband_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND F2003 interface") diff --git a/src/sunlinsol/band/fmod_int64/CMakeLists.txt b/src/sunlinsol/band/fmod_int64/CMakeLists.txt index 250f17c914..759321d170 100644 --- a/src/sunlinsol/band/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/band/fmod_int64/CMakeLists.txt @@ -14,20 +14,14 @@ # CMakeLists.txt file for the F2003 band SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolband_mod - SOURCES - fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolband_mod + SOURCES fsunlinsol_band_mod.f90 fsunlinsol_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixband_mod - OUTPUT_NAME - sundials_fsunlinsolband_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixband_mod + OUTPUT_NAME sundials_fsunlinsolband_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_BAND F2003 interface") diff --git a/src/sunlinsol/cusolversp/CMakeLists.txt b/src/sunlinsol/cusolversp/CMakeLists.txt index 830ddb0ab9..2663fc77dc 100644 --- a/src/sunlinsol/cusolversp/CMakeLists.txt +++ b/src/sunlinsol/cusolversp/CMakeLists.txt @@ -16,25 +16,18 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_CUSOLVERSP\n\")") -sundials_add_library(sundials_sunlinsolcusolversp - SOURCES - sunlinsol_cusolversp_batchqr.cu +sundials_add_library( + sundials_sunlinsolcusolversp + SOURCES sunlinsol_cusolversp_batchqr.cu HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_cusolversp_batchqr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixcusparse CUDA::cusolver - PRIVATE CUDA::cusparse - OUTPUT_NAME - sundials_sunlinsolcusolversp - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixcusparse CUDA::cusolver PRIVATE + CUDA::cusparse + OUTPUT_NAME sundials_sunlinsolcusolversp + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_CUSOLVERSP module") diff --git a/src/sunlinsol/dense/CMakeLists.txt b/src/sunlinsol/dense/CMakeLists.txt index 1661deca42..27eb05e6f8 100644 --- a/src/sunlinsol/dense/CMakeLists.txt +++ b/src/sunlinsol/dense/CMakeLists.txt @@ -18,25 +18,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_DENSE\n\")") # Add the sunlinsol_dense library -sundials_add_library(sundials_sunlinsoldense - SOURCES - sunlinsol_dense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_dense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsoldense + SOURCES sunlinsol_dense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_dense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixdense - OUTPUT_NAME - sundials_sunlinsoldense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixdense + OUTPUT_NAME sundials_sunlinsoldense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE module") diff --git a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt index 3a1329e120..eb904dc764 100644 --- a/src/sunlinsol/dense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/dense/fmod_int32/CMakeLists.txt @@ -14,16 +14,11 @@ # CMakeLists.txt file for the F2003 dense SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsoldense_mod - SOURCES - fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsoldense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsoldense_mod + SOURCES fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsoldense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE F2003 interface") diff --git a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt index 61bdf87108..8a6401a143 100644 --- a/src/sunlinsol/dense/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/dense/fmod_int64/CMakeLists.txt @@ -14,19 +14,13 @@ # CMakeLists.txt file for the F2003 dense SUNLinearSolver object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsoldense_mod - SOURCES - fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsoldense_mod + SOURCES fsunlinsol_dense_mod.f90 fsunlinsol_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod - OUTPUT_NAME - sundials_fsunlinsoldense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME sundials_fsunlinsoldense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_DENSE F2003 interface") diff --git a/src/sunlinsol/klu/CMakeLists.txt b/src/sunlinsol/klu/CMakeLists.txt index c78a547deb..781a60819d 100644 --- a/src/sunlinsol/klu/CMakeLists.txt +++ b/src/sunlinsol/klu/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_KLU\n\")") # Add the library -sundials_add_library(sundials_sunlinsolklu - SOURCES - sunlinsol_klu.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_klu.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolklu + SOURCES sunlinsol_klu.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_klu.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixsparse SUNDIALS::KLU - OUTPUT_NAME - sundials_sunlinsolklu - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixsparse SUNDIALS::KLU + OUTPUT_NAME sundials_sunlinsolklu + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU module") diff --git a/src/sunlinsol/klu/fmod_int32/CMakeLists.txt b/src/sunlinsol/klu/fmod_int32/CMakeLists.txt index 4a0323d921..04a6624e77 100644 --- a/src/sunlinsol/klu/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/klu/fmod_int32/CMakeLists.txt @@ -14,20 +14,14 @@ # CMakeLists.txt file for the F2003 KLU SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolklu_mod - SOURCES - fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolklu_mod + SOURCES fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixsparse_mod - OUTPUT_NAME - sundials_fsunlinsolklu_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixsparse_mod + OUTPUT_NAME sundials_fsunlinsolklu_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU F2003 interface") diff --git a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt index 683f76cc3b..c24c56f863 100644 --- a/src/sunlinsol/klu/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/klu/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 KLU SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolklu_mod - SOURCES - fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixsparse_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolklu_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolklu_mod + SOURCES fsunlinsol_klu_mod.f90 fsunlinsol_klu_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixsparse_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolklu_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_KLU F2003 interface") diff --git a/src/sunlinsol/lapackband/CMakeLists.txt b/src/sunlinsol/lapackband/CMakeLists.txt index 8cba988623..4da37454dd 100644 --- a/src/sunlinsol/lapackband/CMakeLists.txt +++ b/src/sunlinsol/lapackband/CMakeLists.txt @@ -17,24 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKBAND\n\")") # Add the library -sundials_add_library(sundials_sunlinsollapackband - SOURCES - sunlinsol_lapackband.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackband.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsollapackband + SOURCES sunlinsol_lapackband.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackband.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixband "${LAPACK_LIBRARIES}" - OUTPUT_NAME - sundials_sunlinsollapackband - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixband "${LAPACK_LIBRARIES}" + OUTPUT_NAME sundials_sunlinsollapackband + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKBAND module") diff --git a/src/sunlinsol/lapackdense/CMakeLists.txt b/src/sunlinsol/lapackdense/CMakeLists.txt index 41ab2a5fa7..f8161667f3 100644 --- a/src/sunlinsol/lapackdense/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/CMakeLists.txt @@ -17,25 +17,17 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_LAPACKDENSE\n\")") # Add the library -sundials_add_library(sundials_sunlinsollapackdense - SOURCES - sunlinsol_lapackdense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackdense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsollapackdense + SOURCES sunlinsol_lapackdense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_lapackdense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_sunmatrixdense "${LAPACK_LIBRARIES}" - OUTPUT_NAME - sundials_sunlinsollapackdense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixdense "${LAPACK_LIBRARIES}" + OUTPUT_NAME sundials_sunlinsollapackdense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE module") diff --git a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt index 72b9d5acda..ed20a78200 100644 --- a/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/fmod_int32/CMakeLists.txt @@ -15,16 +15,11 @@ # object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod - SOURCES - fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsollapackdense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsollapackdense_mod + SOURCES fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsollapackdense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt index 12bcb2fae2..b2eb2b329b 100644 --- a/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/lapackdense/fmod_int64/CMakeLists.txt @@ -15,19 +15,13 @@ # object library # ---------------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsollapackdense_mod - SOURCES - fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsollapackdense_mod + SOURCES fsunlinsol_lapackdense_mod.f90 fsunlinsol_lapackdense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_fsunmatrixdense_mod - OUTPUT_NAME - sundials_fsunlinsollapackdense_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_fsunmatrixdense_mod + OUTPUT_NAME sundials_fsunlinsollapackdense_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_LAPACKDENSE F2003 interface") diff --git a/src/sunlinsol/magmadense/CMakeLists.txt b/src/sunlinsol/magmadense/CMakeLists.txt index 4fbaaaf49f..2928669307 100644 --- a/src/sunlinsol/magmadense/CMakeLists.txt +++ b/src/sunlinsol/magmadense/CMakeLists.txt @@ -23,24 +23,16 @@ elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") endif() # Add the sunlinsol_magmadense library -sundials_add_library(sundials_sunlinsolmagmadense - SOURCES - sunlinsol_magmadense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_magmadense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolmagmadense + SOURCES sunlinsol_magmadense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_magmadense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::MAGMA ${_libs_needed} - OUTPUT_NAME - sundials_sunlinsolmagmadense - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::MAGMA ${_libs_needed} + OUTPUT_NAME sundials_sunlinsolmagmadense + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_MAGMADENSE module") diff --git a/src/sunlinsol/onemkldense/CMakeLists.txt b/src/sunlinsol/onemkldense/CMakeLists.txt index ccf16f5740..9fbecb5886 100644 --- a/src/sunlinsol/onemkldense/CMakeLists.txt +++ b/src/sunlinsol/onemkldense/CMakeLists.txt @@ -15,28 +15,19 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_ONEMKLDENSE\n\")") # Add the sunlinsol_onemkldense library -sundials_add_library(sundials_sunlinsolonemkldense - SOURCES - sunlinsol_onemkldense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_onemkldense.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolonemkldense + SOURCES sunlinsol_onemkldense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_onemkldense.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - COMPILE_FEATURES - PUBLIC cxx_std_17 - INCLUDE_DIRECTORIES - PUBLIC ${MKL_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC MKL::MKL_DPCPP sundials_sunmatrixonemkldense sundials_nvecsycl - OUTPUT_NAME - sundials_sunlinsolonemkldense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + COMPILE_FEATURES PUBLIC cxx_std_17 + INCLUDE_DIRECTORIES PUBLIC ${MKL_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC MKL::MKL_DPCPP sundials_sunmatrixonemkldense + sundials_nvecsycl + OUTPUT_NAME sundials_sunlinsolonemkldense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNLINSOL_ONEMKLDENSE module") diff --git a/src/sunlinsol/pcg/CMakeLists.txt b/src/sunlinsol/pcg/CMakeLists.txt index e8e37003f2..9a872e3e73 100644 --- a/src/sunlinsol/pcg/CMakeLists.txt +++ b/src/sunlinsol/pcg/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_PCG\n\")") # Add the sunlinsol_pcg library -sundials_add_library(sundials_sunlinsolpcg - SOURCES - sunlinsol_pcg.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_pcg.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolpcg + SOURCES sunlinsol_pcg.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_pcg.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolpcg - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolpcg + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG module") diff --git a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt index e863f286ee..b89dc76f74 100644 --- a/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/pcg/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 PCG SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolpcg_mod - SOURCES - fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolpcg_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolpcg_mod + SOURCES fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolpcg_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG F2003 interface") diff --git a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt index 535741e7d6..ad5985e0b8 100644 --- a/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/pcg/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 PCG SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolpcg_mod - SOURCES - fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolpcg_mod + SOURCES fsunlinsol_pcg_mod.f90 fsunlinsol_pcg_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolpcg_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolpcg_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_PCG F2003 interface") diff --git a/src/sunlinsol/spbcgs/CMakeLists.txt b/src/sunlinsol/spbcgs/CMakeLists.txt index 331c788606..71f4118a63 100644 --- a/src/sunlinsol/spbcgs/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPBCGS\n\")") # Add the sunlinsol_spbcgs library -sundials_add_library(sundials_sunlinsolspbcgs - SOURCES - sunlinsol_spbcgs.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spbcgs.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspbcgs + SOURCES sunlinsol_spbcgs.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spbcgs.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspbcgs - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspbcgs + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS module") diff --git a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt index d05fdd7d0c..23db9490eb 100644 --- a/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPBCGS SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod - SOURCES - fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspbcgs_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspbcgs_mod + SOURCES fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspbcgs_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS F2003 interface") diff --git a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt index d1b588396f..903402f4de 100644 --- a/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spbcgs/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPBCGS SUNLinearSolver object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunlinsolspbcgs_mod - SOURCES - fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspbcgs_mod + SOURCES fsunlinsol_spbcgs_mod.f90 fsunlinsol_spbcgs_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspbcgs_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspbcgs_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPBCGS F2003 interface") diff --git a/src/sunlinsol/spfgmr/CMakeLists.txt b/src/sunlinsol/spfgmr/CMakeLists.txt index 38b9d784e9..fc2765c584 100644 --- a/src/sunlinsol/spfgmr/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPFGMR\n\")") # Add the sunlinsol_spfgmr library -sundials_add_library(sundials_sunlinsolspfgmr - SOURCES - sunlinsol_spfgmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spfgmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspfgmr + SOURCES sunlinsol_spfgmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spfgmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspfgmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspfgmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR module") diff --git a/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt index c2cbd50123..4d52831daa 100644 --- a/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPFGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod - SOURCES - fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspfgmr_mod + SOURCES fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspfgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspfgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt index 4a236368f8..335cb9a895 100644 --- a/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spfgmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPFGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspfgmr_mod - SOURCES - fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspfgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspfgmr_mod + SOURCES fsunlinsol_spfgmr_mod.f90 fsunlinsol_spfgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspfgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPFGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/CMakeLists.txt b/src/sunlinsol/spgmr/CMakeLists.txt index 712f07731a..d6a36526b0 100644 --- a/src/sunlinsol/spgmr/CMakeLists.txt +++ b/src/sunlinsol/spgmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPGMR\n\")") # Add the sunlinsol_spgmr library -sundials_add_library(sundials_sunlinsolspgmr - SOURCES - sunlinsol_spgmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spgmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolspgmr + SOURCES sunlinsol_spgmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_spgmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolspgmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolspgmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR module") diff --git a/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt index 9ea74e0e45..b359729811 100644 --- a/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/spgmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod - SOURCES - fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolspgmr_mod + SOURCES fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolspgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolspgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt index 005f891f6c..bfbb2e11ad 100644 --- a/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/spgmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPGMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolspgmr_mod - SOURCES - fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolspgmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolspgmr_mod + SOURCES fsunlinsol_spgmr_mod.f90 fsunlinsol_spgmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolspgmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPGMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/CMakeLists.txt b/src/sunlinsol/sptfqmr/CMakeLists.txt index 60bb70ef1f..8eb8a9795f 100644 --- a/src/sunlinsol/sptfqmr/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SPTFQMR\n\")") # Add the sunlinsol_sptfqmr library -sundials_add_library(sundials_sunlinsolsptfqmr - SOURCES - sunlinsol_sptfqmr.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_sptfqmr.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsptfqmr + SOURCES sunlinsol_sptfqmr.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_sptfqmr.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunlinsolsptfqmr - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunlinsolsptfqmr + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR module") diff --git a/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt index ff3dc41956..f38d135a57 100644 --- a/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 SPTFQMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod - SOURCES - fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunlinsolsptfqmr_mod + SOURCES fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunlinsolsptfqmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunlinsolsptfqmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt index 2aa92f9022..00ac061002 100644 --- a/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt +++ b/src/sunlinsol/sptfqmr/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 SPTFQMR SUNLinearSolver object library # ------------------------------------------------------------------------ -sundials_add_f2003_library(sundials_fsunlinsolsptfqmr_mod - SOURCES - fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunlinsolsptfqmr_mod - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunlinsolsptfqmr_mod + SOURCES fsunlinsol_sptfqmr_mod.f90 fsunlinsol_sptfqmr_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunlinsolsptfqmr_mod + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SPTFQMR F2003 interface") diff --git a/src/sunlinsol/superludist/CMakeLists.txt b/src/sunlinsol/superludist/CMakeLists.txt index ecff5b1e52..acd34e103e 100644 --- a/src/sunlinsol/superludist/CMakeLists.txt +++ b/src/sunlinsol/superludist/CMakeLists.txt @@ -17,30 +17,19 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SUPERLUDIST\n\")") # Add the library -sundials_add_library(sundials_sunlinsolsuperludist - SOURCES - sunlinsol_superludist.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superludist.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsuperludist + SOURCES sunlinsol_superludist.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superludist.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES LINK_LIBRARIES - PUBLIC - sundials_sunmatrixslunrloc - SUNDIALS::SUPERLUDIST - $,OpenMP::OpenMP_C,> - MPI::MPI_C - COMPILE_OPTIONS - PRIVATE ${_compile_options} - OUTPUT_NAME - sundials_sunlinsolsuperludist - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + PUBLIC sundials_sunmatrixslunrloc SUNDIALS::SUPERLUDIST + $,OpenMP::OpenMP_C,> MPI::MPI_C + COMPILE_OPTIONS PRIVATE ${_compile_options} + OUTPUT_NAME sundials_sunlinsolsuperludist + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SUPERLUDIST module") diff --git a/src/sunlinsol/superlumt/CMakeLists.txt b/src/sunlinsol/superlumt/CMakeLists.txt index c4b665bb47..745fde598a 100644 --- a/src/sunlinsol/superlumt/CMakeLists.txt +++ b/src/sunlinsol/superlumt/CMakeLists.txt @@ -16,8 +16,7 @@ install(CODE "MESSAGE(\"\nInstall SUNLINSOL_SUPERLUMT\n\")") -# Include OpenMP flags if SuperLU_MT is using OpenMP, -# otherwise we use threads. +# Include OpenMP flags if SuperLU_MT is using OpenMP, otherwise we use threads. if(SUPERLUMT_THREAD_TYPE STREQUAL "OPENMP") set(_threads OpenMP::OpenMP_C) else() @@ -25,26 +24,16 @@ else() endif() # Add the library -sundials_add_library(sundials_sunlinsolsuperlumt - SOURCES - sunlinsol_superlumt.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superlumt.h - INCLUDE_SUBDIR - sunlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunlinsolsuperlumt + SOURCES sunlinsol_superlumt.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunlinsol/sunlinsol_superlumt.h + INCLUDE_SUBDIR sunlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC - sundials_sunmatrixsparse - SUNDIALS::SUPERLUMT ${_threads} - OUTPUT_NAME - sundials_sunlinsolsuperlumt - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_sunmatrixsparse SUNDIALS::SUPERLUMT ${_threads} + OUTPUT_NAME sundials_sunlinsolsuperlumt + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_SOVERSION}) message(STATUS "Added SUNLINSOL_SUPERLUMT module") diff --git a/src/sunmatrix/CMakeLists.txt b/src/sunmatrix/CMakeLists.txt index eec6be4f72..f9f9ce95da 100644 --- a/src/sunmatrix/CMakeLists.txt +++ b/src/sunmatrix/CMakeLists.txt @@ -29,30 +29,38 @@ if(BUILD_SUNMATRIX_GINKGO) message(STATUS "Added BUILD_SUNMATRIX_GINKGO module") add_library(sundials_sunmatrixginkgo INTERFACE) target_link_libraries(sundials_sunmatrixginkgo INTERFACE sundials_core) - target_include_directories(sundials_sunmatrixginkgo INTERFACE - $ - $ - $ - $) + target_include_directories( + sundials_sunmatrixginkgo + INTERFACE $ + $ + $ + $) install(FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_ginkgo.hpp - DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunmatrixginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunmatrixginkgo;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNMATRIX_KOKKOSDENSE) install(CODE "MESSAGE(\"\nInstall SUNMATRIX_KOKKOSDENSE\n\")") message(STATUS "Added BUILD_SUNMATRIX_KOKKOSDENSE module") add_library(sundials_sunmatrixkokkosdense INTERFACE) - target_link_libraries(sundials_sunmatrixkokkosdense INTERFACE - sundials_core Kokkos::kokkos Kokkos::kokkoskernels) - target_include_directories(sundials_sunmatrixkokkosdense INTERFACE - $ - $ - $ - $) - install(FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_kokkosdense.hpp + target_link_libraries( + sundials_sunmatrixkokkosdense INTERFACE sundials_core Kokkos::kokkos + Kokkos::kokkoskernels) + target_include_directories( + sundials_sunmatrixkokkosdense + INTERFACE $ + $ + $ + $) + install( + FILES ${PROJECT_SOURCE_DIR}/include/sunmatrix/sunmatrix_kokkosdense.hpp DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sunmatrix") - set(_SUNDIALS_INSTALLED_COMPONENTS "sunmatrixkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" CACHE INTERNAL "" FORCE) + set(_SUNDIALS_INSTALLED_COMPONENTS + "sunmatrixkokkosdense;${_SUNDIALS_INSTALLED_COMPONENTS}" + CACHE INTERNAL "" FORCE) endif() if(BUILD_SUNMATRIX_MAGMADENSE) diff --git a/src/sunmatrix/band/CMakeLists.txt b/src/sunmatrix/band/CMakeLists.txt index 240fcf7ed4..3cbb540a45 100644 --- a/src/sunmatrix/band/CMakeLists.txt +++ b/src/sunmatrix/band/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_BAND\n\")") # Add the sunmatrix_band library -sundials_add_library(sundials_sunmatrixband - SOURCES - sunmatrix_band.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_band.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixband + SOURCES sunmatrix_band.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_band.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixband - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixband + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND module") diff --git a/src/sunmatrix/band/fmod_int32/CMakeLists.txt b/src/sunmatrix/band/fmod_int32/CMakeLists.txt index 6026568af8..44e9fc667a 100644 --- a/src/sunmatrix/band/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/band/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 band SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixband_mod - SOURCES - fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixband_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixband_mod + SOURCES fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixband_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND F2003 interface") diff --git a/src/sunmatrix/band/fmod_int64/CMakeLists.txt b/src/sunmatrix/band/fmod_int64/CMakeLists.txt index 465260d783..2c4bac0524 100644 --- a/src/sunmatrix/band/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/band/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 band SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixband_mod - SOURCES - fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixband_mod + SOURCES fsunmatrix_band_mod.f90 fsunmatrix_band_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixband_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixband_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_BAND F2003 interface") diff --git a/src/sunmatrix/cusparse/CMakeLists.txt b/src/sunmatrix/cusparse/CMakeLists.txt index b1bf8a069a..d56ebf3566 100644 --- a/src/sunmatrix/cusparse/CMakeLists.txt +++ b/src/sunmatrix/cusparse/CMakeLists.txt @@ -17,25 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_CUSPARSE\n\")") # Add the library -sundials_add_library(sundials_sunmatrixcusparse - SOURCES - sunmatrix_cusparse.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_cusparse.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemcuda_obj - LINK_LIBRARIES - PUBLIC CUDA::cusparse CUDA::cusolver - OUTPUT_NAME - sundials_sunmatrixcusparse - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_library( + sundials_sunmatrixcusparse + SOURCES sunmatrix_cusparse.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_cusparse.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemcuda_obj + LINK_LIBRARIES PUBLIC CUDA::cusparse CUDA::cusolver + OUTPUT_NAME sundials_sunmatrixcusparse + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_CUSPARSE module") diff --git a/src/sunmatrix/dense/CMakeLists.txt b/src/sunmatrix/dense/CMakeLists.txt index e9e1b9ad85..83b3e993b1 100644 --- a/src/sunmatrix/dense/CMakeLists.txt +++ b/src/sunmatrix/dense/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_DENSE\n\")") # Add the sunmatrix_dense library -sundials_add_library(sundials_sunmatrixdense - SOURCES - sunmatrix_dense.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_dense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixdense + SOURCES sunmatrix_dense.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_dense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixdense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixdense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE module") diff --git a/src/sunmatrix/dense/fmod_int32/CMakeLists.txt b/src/sunmatrix/dense/fmod_int32/CMakeLists.txt index 987102b9f6..1bd612002e 100644 --- a/src/sunmatrix/dense/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/dense/fmod_int32/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 dense SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixdense_mod - SOURCES - fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixdense_mod + SOURCES fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixdense_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixdense_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt index 6b11defa31..a4baea3b35 100644 --- a/src/sunmatrix/dense/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/dense/fmod_int64/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 dense SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixdense_mod - SOURCES - fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixdense_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixdense_mod + SOURCES fsunmatrix_dense_mod.f90 fsunmatrix_dense_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixdense_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_DENSE F2003 interface") diff --git a/src/sunmatrix/magmadense/CMakeLists.txt b/src/sunmatrix/magmadense/CMakeLists.txt index 07eb539943..256cb6b3ab 100644 --- a/src/sunmatrix/magmadense/CMakeLists.txt +++ b/src/sunmatrix/magmadense/CMakeLists.txt @@ -12,7 +12,9 @@ # SUNDIALS Copyright End # --------------------------------------------------------------- -install(CODE "MESSAGE(\"\nInstall SUNMATRIX_MAGMADENSE with ${SUNDIALS_MAGMA_BACKENDS} backend(s)\n\")") +install( + CODE "MESSAGE(\"\nInstall SUNMATRIX_MAGMADENSE with ${SUNDIALS_MAGMA_BACKENDS} backend(s)\n\")" +) if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") set_source_files_properties(sunmatrix_magmadense.cpp PROPERTIES LANGUAGE CUDA) @@ -23,26 +25,20 @@ elseif(SUNDIALS_MAGMA_BACKENDS MATCHES "HIP") endif() # Add the sunmatrix_magmadense library -sundials_add_library(sundials_sunmatrixmagmadense - SOURCES - sunmatrix_magmadense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_magmadense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixmagmadense + SOURCES sunmatrix_magmadense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_magmadense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - INCLUDE_DIRECTORIES - PUBLIC ${MAGMA_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC SUNDIALS::MAGMA ${_libs_needed} - OUTPUT_NAME - sundials_sunmatrixmagmadense - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + INCLUDE_DIRECTORIES PUBLIC ${MAGMA_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC SUNDIALS::MAGMA ${_libs_needed} + OUTPUT_NAME sundials_sunmatrixmagmadense + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) -message(STATUS "Added SUNMATRIX_MAGMADENSE module with ${SUNDIALS_MAGMA_BACKENDS} backend(s)") +message( + STATUS + "Added SUNMATRIX_MAGMADENSE module with ${SUNDIALS_MAGMA_BACKENDS} backend(s)" +) diff --git a/src/sunmatrix/onemkldense/CMakeLists.txt b/src/sunmatrix/onemkldense/CMakeLists.txt index c9547a8cf6..b6ab57855a 100644 --- a/src/sunmatrix/onemkldense/CMakeLists.txt +++ b/src/sunmatrix/onemkldense/CMakeLists.txt @@ -15,29 +15,18 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_ONEMKLDENSE\n\")") # Create the library -sundials_add_library(sundials_sunmatrixonemkldense - SOURCES - sunmatrix_onemkldense.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_onemkldense.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIBRARIES - sundials_sunmemsycl_obj - COMPILE_FEATURES - PUBLIC cxx_std_17 - INCLUDE_DIRECTORIES - PUBLIC ${MKL_INCLUDE_DIR} - LINK_LIBRARIES - PUBLIC MKL::MKL_DPCPP - OUTPUT_NAME - sundials_sunmatrixonemkldense - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) +sundials_add_library( + sundials_sunmatrixonemkldense + SOURCES sunmatrix_onemkldense.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_onemkldense.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIBRARIES sundials_sunmemsycl_obj + COMPILE_FEATURES PUBLIC cxx_std_17 + INCLUDE_DIRECTORIES PUBLIC ${MKL_INCLUDE_DIR} + LINK_LIBRARIES PUBLIC MKL::MKL_DPCPP + OUTPUT_NAME sundials_sunmatrixonemkldense + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added SUNMATRIX_ONEMKLDENSE module") diff --git a/src/sunmatrix/slunrloc/CMakeLists.txt b/src/sunmatrix/slunrloc/CMakeLists.txt index 73f9857870..7d49a136c8 100644 --- a/src/sunmatrix/slunrloc/CMakeLists.txt +++ b/src/sunmatrix/slunrloc/CMakeLists.txt @@ -21,27 +21,18 @@ set(CMAKE_C_COMPILER ${MPI_C_COMPILER}) set(CMAKE_CXX_COMPILER ${MPI_CXX_COMPILER}) # Add the library -sundials_add_library(sundials_sunmatrixslunrloc - SOURCES - sunmatrix_slunrloc.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_slunrloc.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixslunrloc + SOURCES sunmatrix_slunrloc.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_slunrloc.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC SUNDIALS::SUPERLUDIST - $,OpenMP::OpenMP_C,> - COMPILE_OPTIONS - PRIVATE ${_compile_options} - OUTPUT_NAME - sundials_sunmatrixslunrloc - VERSION - ${sunlinsollib_VERSION} - SOVERSION - ${sunlinsollib_VERSION} -) + LINK_LIBRARIES PUBLIC SUNDIALS::SUPERLUDIST + $,OpenMP::OpenMP_C,> + COMPILE_OPTIONS PRIVATE ${_compile_options} + OUTPUT_NAME sundials_sunmatrixslunrloc + VERSION ${sunlinsollib_VERSION} + SOVERSION ${sunlinsollib_VERSION}) message(STATUS "Added SUNMATRIX_SLUNRLOC module") diff --git a/src/sunmatrix/sparse/CMakeLists.txt b/src/sunmatrix/sparse/CMakeLists.txt index 3ca9363150..8795ae3cdf 100644 --- a/src/sunmatrix/sparse/CMakeLists.txt +++ b/src/sunmatrix/sparse/CMakeLists.txt @@ -18,23 +18,16 @@ install(CODE "MESSAGE(\"\nInstall SUNMATRIX_SPARSE\n\")") # Add the sunmatrix_sparse library -sundials_add_library(sundials_sunmatrixsparse - SOURCES - sunmatrix_sparse.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_sparse.h - INCLUDE_SUBDIR - sunmatrix - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunmatrixsparse + SOURCES sunmatrix_sparse.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmatrix/sunmatrix_sparse.h + INCLUDE_SUBDIR sunmatrix + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunmatrixsparse - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_sunmatrixsparse + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE module") diff --git a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt index 407bddff70..e9792d9e35 100644 --- a/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt +++ b/src/sunmatrix/sparse/fmod_int32/CMakeLists.txt @@ -14,17 +14,12 @@ # CMakeLists.txt file for the F2003 sparse SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixsparse_mod - SOURCES - fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunmatrixsparse_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunmatrixsparse_mod + SOURCES fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunmatrixsparse_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE F2003 interface") diff --git a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt index fb0ed79b4c..e7d02abf11 100644 --- a/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt +++ b/src/sunmatrix/sparse/fmod_int64/CMakeLists.txt @@ -14,18 +14,13 @@ # CMakeLists.txt file for the F2003 sparse SUNMatrix object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunmatrixsparse_mod - SOURCES - fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunmatrixsparse_mod + SOURCES fsunmatrix_sparse_mod.f90 fsunmatrix_sparse_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunmatrixsparse_mod - VERSION - ${sunmatrixlib_VERSION} - SOVERSION - ${sunmatrixlib_SOVERSION} -) + OUTPUT_NAME sundials_fsunmatrixsparse_mod + VERSION ${sunmatrixlib_VERSION} + SOVERSION ${sunmatrixlib_SOVERSION}) message(STATUS "Added SUNMATRIX_SPARSE F2003 interface") diff --git a/src/sunmemory/cuda/CMakeLists.txt b/src/sunmemory/cuda/CMakeLists.txt index bd20b95824..6dadcc8e4b 100644 --- a/src/sunmemory/cuda/CMakeLists.txt +++ b/src/sunmemory/cuda/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemcuda - SOURCES - sundials_cuda_memory.cu - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_cuda.h - LINK_LIBRARIES - PUBLIC sundials_core - INCLUDE_SUBDIR - sunmemory - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemcuda + SOURCES sundials_cuda_memory.cu + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_cuda.h + LINK_LIBRARIES PUBLIC sundials_core + INCLUDE_SUBDIR sunmemory + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/hip/CMakeLists.txt b/src/sunmemory/hip/CMakeLists.txt index 64c650dae3..eda739ebc6 100644 --- a/src/sunmemory/hip/CMakeLists.txt +++ b/src/sunmemory/hip/CMakeLists.txt @@ -13,15 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemhip - SOURCES - sundials_hip_memory.hip.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_hip.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - PRIVATE hip::device - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemhip + SOURCES sundials_hip_memory.hip.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_hip.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core PRIVATE hip::device + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/sycl/CMakeLists.txt b/src/sunmemory/sycl/CMakeLists.txt index b425e09745..46dd11eb4d 100644 --- a/src/sunmemory/sycl/CMakeLists.txt +++ b/src/sunmemory/sycl/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create library -sundials_add_library(sundials_sunmemsycl - SOURCES - sundials_sycl_memory.cpp - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_sycl.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemsycl + SOURCES sundials_sycl_memory.cpp + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_sycl.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIB_ONLY) diff --git a/src/sunmemory/system/CMakeLists.txt b/src/sunmemory/system/CMakeLists.txt index 70157d78d8..d3368974a1 100644 --- a/src/sunmemory/system/CMakeLists.txt +++ b/src/sunmemory/system/CMakeLists.txt @@ -13,14 +13,10 @@ # --------------------------------------------------------------- # Create a library out of the generic sundials modules -sundials_add_library(sundials_sunmemsys - SOURCES - sundials_system_memory.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_system.h - INCLUDE_SUBDIR - sunmemory - LINK_LIBRARIES - PUBLIC sundials_core - OBJECT_LIB_ONLY -) +sundials_add_library( + sundials_sunmemsys + SOURCES sundials_system_memory.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunmemory/sunmemory_system.h + INCLUDE_SUBDIR sunmemory + LINK_LIBRARIES PUBLIC sundials_core + OBJECT_LIB_ONLY) diff --git a/src/sunnonlinsol/fixedpoint/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/CMakeLists.txt index 257fe8f97b..82821d35ce 100644 --- a/src/sunnonlinsol/fixedpoint/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNNONLINSOL_FIXEDPOINT\n\")") # Add the library -sundials_add_library(sundials_sunnonlinsolfixedpoint - SOURCES - sunnonlinsol_fixedpoint.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_fixedpoint.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolfixedpoint + SOURCES sunnonlinsol_fixedpoint.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_fixedpoint.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunnonlinsolfixedpoint - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunnonlinsolfixedpoint + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT module") diff --git a/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt index bb2f0097b6..2b695d6ba3 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/fmod_int32/CMakeLists.txt @@ -15,18 +15,13 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod - SOURCES - fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunnonlinsolfixedpoint_mod + SOURCES fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunnonlinsolfixedpoint_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunnonlinsolfixedpoint_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT F2003 interface") diff --git a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt index 6e24d5269c..4b064101b2 100644 --- a/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt +++ b/src/sunnonlinsol/fixedpoint/fmod_int64/CMakeLists.txt @@ -15,17 +15,12 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolfixedpoint_mod - SOURCES - fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunnonlinsolfixedpoint_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunnonlinsolfixedpoint_mod + SOURCES fsunnonlinsol_fixedpoint_mod.f90 fsunnonlinsol_fixedpoint_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunnonlinsolfixedpoint_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_FIXEDPOINT F2003 interface") diff --git a/src/sunnonlinsol/newton/CMakeLists.txt b/src/sunnonlinsol/newton/CMakeLists.txt index 718b026d3f..2664fe18e2 100644 --- a/src/sunnonlinsol/newton/CMakeLists.txt +++ b/src/sunnonlinsol/newton/CMakeLists.txt @@ -17,23 +17,16 @@ install(CODE "MESSAGE(\"\nInstall SUNNONLINSOL_NEWTON\n\")") # Add the library -sundials_add_library(sundials_sunnonlinsolnewton - SOURCES - sunnonlinsol_newton.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_newton.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolnewton + SOURCES sunnonlinsol_newton.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_newton.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - OUTPUT_NAME - sundials_sunnonlinsolnewton - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_sunnonlinsolnewton + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON module") diff --git a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt index 883fac35ed..6851b86153 100644 --- a/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt +++ b/src/sunnonlinsol/newton/fmod_int32/CMakeLists.txt @@ -15,17 +15,12 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod - SOURCES - fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod - OUTPUT_NAME - sundials_fsunnonlinsolnewton_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) +sundials_add_f2003_library( + sundials_fsunnonlinsolnewton_mod + SOURCES fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod + OUTPUT_NAME sundials_fsunnonlinsolnewton_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON F2003 interface") diff --git a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt index 46be1ab585..25108f7457 100644 --- a/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt +++ b/src/sunnonlinsol/newton/fmod_int64/CMakeLists.txt @@ -15,18 +15,13 @@ # object library # --------------------------------------------------------------- -sundials_add_f2003_library(sundials_fsunnonlinsolnewton_mod - SOURCES - fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c - LINK_LIBRARIES - PUBLIC sundials_fcore_mod +sundials_add_f2003_library( + sundials_fsunnonlinsolnewton_mod + SOURCES fsunnonlinsol_newton_mod.f90 fsunnonlinsol_newton_mod.c + LINK_LIBRARIES PUBLIC sundials_fcore_mod OBJECT_LIBRARIES - OUTPUT_NAME - sundials_fsunnonlinsolnewton_mod - VERSION - ${sunnonlinsollib_VERSION} - SOVERSION - ${sunnonlinsollib_SOVERSION} -) + OUTPUT_NAME sundials_fsunnonlinsolnewton_mod + VERSION ${sunnonlinsollib_VERSION} + SOVERSION ${sunnonlinsollib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_NEWTON F2003 interface") diff --git a/src/sunnonlinsol/petscsnes/CMakeLists.txt b/src/sunnonlinsol/petscsnes/CMakeLists.txt index 4334d0a654..909dbecad5 100644 --- a/src/sunnonlinsol/petscsnes/CMakeLists.txt +++ b/src/sunnonlinsol/petscsnes/CMakeLists.txt @@ -24,24 +24,16 @@ else() endif() # Create the library -sundials_add_library(sundials_sunnonlinsolpetscsnes - SOURCES - sunnonlinsol_petscsnes.c - HEADERS - ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_petscsnes.h - INCLUDE_SUBDIR - sunnonlinsol - LINK_LIBRARIES - PUBLIC sundials_core +sundials_add_library( + sundials_sunnonlinsolpetscsnes + SOURCES sunnonlinsol_petscsnes.c + HEADERS ${SUNDIALS_SOURCE_DIR}/include/sunnonlinsol/sunnonlinsol_petscsnes.h + INCLUDE_SUBDIR sunnonlinsol + LINK_LIBRARIES PUBLIC sundials_core OBJECT_LIBRARIES - LINK_LIBRARIES - PUBLIC sundials_nvecpetsc SUNDIALS::PETSC - OUTPUT_NAME - sundials_sunnonlinsolpetscsnes - VERSION - ${nveclib_VERSION} - SOVERSION - ${nveclib_SOVERSION} -) + LINK_LIBRARIES PUBLIC sundials_nvecpetsc SUNDIALS::PETSC + OUTPUT_NAME sundials_sunnonlinsolpetscsnes + VERSION ${nveclib_VERSION} + SOVERSION ${nveclib_SOVERSION}) message(STATUS "Added SUNNONLINSOL_PETSCSNES module") diff --git a/test/unit_tests/arkode/CMakeLists.txt b/test/unit_tests/arkode/CMakeLists.txt index 7c06a015f5..a758ab3131 100644 --- a/test/unit_tests/arkode/CMakeLists.txt +++ b/test/unit_tests/arkode/CMakeLists.txt @@ -32,4 +32,3 @@ endif() if(BUILD_FORTRAN_MODULE_INTERFACE) add_subdirectory(F2003_serial) endif() - diff --git a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt index 90661c5a22..825141646a 100644 --- a/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_parallel/CMakeLists.txt @@ -15,11 +15,9 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;tasks\;args" -if (NOT SUNDIALS_PRECISION MATCHES "SINGLE") - set(unit_tests - "ark_test_heat2D_mri.cpp\;2\;0" - "ark_test_heat2D_mri.cpp\;4\;1" - ) +if(NOT SUNDIALS_PRECISION MATCHES "SINGLE") + set(unit_tests "ark_test_heat2D_mri.cpp\;2\;0" + "ark_test_heat2D_mri.cpp\;4\;1") endif() # Add the build and install targets for each test @@ -33,8 +31,8 @@ foreach(test_tuple ${unit_tests}) # Extract the file name without extension get_filename_component(test_target ${test} NAME_WE) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test_target}) # test source files @@ -43,17 +41,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test_target} - MPI::MPI_CXX - sundials_arkode - sundials_nvecparallel - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} MPI::MPI_CXX sundials_arkode + sundials_nvecparallel ${EXE_EXTRA_LINK_LIBS}) endif() @@ -71,12 +66,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - MPI_NPROCS ${number_of_tasks} - ${diff_output}) + MPI_NPROCS ${number_of_tasks} ${diff_output}) endforeach() diff --git a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt index 0d2bc15460..c1f22fc6bc 100644 --- a/test/unit_tests/arkode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/CXX_serial/CMakeLists.txt @@ -16,33 +16,32 @@ # List of test tuples of the form "name\;args" set(unit_tests - "ark_test_analytic_sys_mri.cpp\;0" - "ark_test_analytic_sys_mri.cpp\;1" - "ark_test_dahlquist_ark.cpp\;0 -1 0" - "ark_test_dahlquist_ark.cpp\;0 0 0" - "ark_test_dahlquist_ark.cpp\;0 0 1" - "ark_test_dahlquist_ark.cpp\;0 1 0" - "ark_test_dahlquist_ark.cpp\;0 1 1" - "ark_test_dahlquist_ark.cpp\;1 -1 0" - "ark_test_dahlquist_ark.cpp\;1 0 0" - "ark_test_dahlquist_ark.cpp\;1 0 1" - "ark_test_dahlquist_ark.cpp\;1 1 0" - "ark_test_dahlquist_ark.cpp\;1 1 1" - "ark_test_dahlquist_ark.cpp\;2 -1 0" - "ark_test_dahlquist_ark.cpp\;2 0 0" - "ark_test_dahlquist_ark.cpp\;2 0 1" - "ark_test_dahlquist_ark.cpp\;2 1 0" - "ark_test_dahlquist_ark.cpp\;2 1 1" - "ark_test_dahlquist_erk.cpp\;-1" - "ark_test_dahlquist_erk.cpp\;0" - "ark_test_dahlquist_erk.cpp\;1" - "ark_test_dahlquist_mri.cpp\;-1" - "ark_test_dahlquist_mri.cpp\;0" - "ark_test_dahlquist_mri.cpp\;1" - "ark_test_butcher.cpp\;" - "ark_test_getjac.cpp\;" - "ark_test_getjac_mri.cpp\;" -) + "ark_test_analytic_sys_mri.cpp\;0" + "ark_test_analytic_sys_mri.cpp\;1" + "ark_test_dahlquist_ark.cpp\;0 -1 0" + "ark_test_dahlquist_ark.cpp\;0 0 0" + "ark_test_dahlquist_ark.cpp\;0 0 1" + "ark_test_dahlquist_ark.cpp\;0 1 0" + "ark_test_dahlquist_ark.cpp\;0 1 1" + "ark_test_dahlquist_ark.cpp\;1 -1 0" + "ark_test_dahlquist_ark.cpp\;1 0 0" + "ark_test_dahlquist_ark.cpp\;1 0 1" + "ark_test_dahlquist_ark.cpp\;1 1 0" + "ark_test_dahlquist_ark.cpp\;1 1 1" + "ark_test_dahlquist_ark.cpp\;2 -1 0" + "ark_test_dahlquist_ark.cpp\;2 0 0" + "ark_test_dahlquist_ark.cpp\;2 0 1" + "ark_test_dahlquist_ark.cpp\;2 1 0" + "ark_test_dahlquist_ark.cpp\;2 1 1" + "ark_test_dahlquist_erk.cpp\;-1" + "ark_test_dahlquist_erk.cpp\;0" + "ark_test_dahlquist_erk.cpp\;1" + "ark_test_dahlquist_mri.cpp\;-1" + "ark_test_dahlquist_mri.cpp\;0" + "ark_test_dahlquist_mri.cpp\;1" + "ark_test_butcher.cpp\;" + "ark_test_getjac.cpp\;" + "ark_test_getjac_mri.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -65,15 +64,16 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # We explicitly choose which object libraries to link to and link in the # arkode objects so that we have access to private functions w/o changing # their visibility in the installed libraries. - target_link_libraries(${test_target} + target_link_libraries( + ${test_target} $ sundials_sunmemsys_obj sundials_nvecserial_obj @@ -105,13 +105,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/arkode/C_serial/CMakeLists.txt b/test/unit_tests/arkode/C_serial/CMakeLists.txt index 720e4e6019..6794a213b4 100644 --- a/test/unit_tests/arkode/C_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/C_serial/CMakeLists.txt @@ -16,24 +16,23 @@ # List of test tuples of the form "name\;args" set(ARKODE_unit_tests - "ark_test_arkstepsetforcing\;1 0" - "ark_test_arkstepsetforcing\;1 1" - "ark_test_arkstepsetforcing\;1 2" - "ark_test_arkstepsetforcing\;1 3" - "ark_test_arkstepsetforcing\;1 4" - "ark_test_arkstepsetforcing\;1 5" - "ark_test_arkstepsetforcing\;1 3 2.0 10.0" - "ark_test_arkstepsetforcing\;1 3 2.0 10.0 2.0 8.0" - "ark_test_arkstepsetforcing\;1 3 2.0 10.0 1.0 5.0" - "ark_test_getuserdata\;" - "ark_test_innerstepper\;" - "ark_test_interp\;-100" - "ark_test_interp\;-10000" - "ark_test_interp\;-1000000" - "ark_test_mass\;" - "ark_test_reset\;" - "ark_test_tstop\;" - ) + "ark_test_arkstepsetforcing\;1 0" + "ark_test_arkstepsetforcing\;1 1" + "ark_test_arkstepsetforcing\;1 2" + "ark_test_arkstepsetforcing\;1 3" + "ark_test_arkstepsetforcing\;1 4" + "ark_test_arkstepsetforcing\;1 5" + "ark_test_arkstepsetforcing\;1 3 2.0 10.0" + "ark_test_arkstepsetforcing\;1 3 2.0 10.0 2.0 8.0" + "ark_test_arkstepsetforcing\;1 3 2.0 10.0 1.0 5.0" + "ark_test_getuserdata\;" + "ark_test_innerstepper\;" + "ark_test_interp\;-100" + "ark_test_interp\;-10000" + "ark_test_interp\;-1000000" + "ark_test_mass\;" + "ark_test_reset\;" + "ark_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${ARKODE_unit_tests}) @@ -42,8 +41,8 @@ foreach(test_tuple ${ARKODE_unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -52,15 +51,15 @@ foreach(test_tuple ${ARKODE_unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # We explicitly choose which object libraries to link to and link in the # arkode objects so that we have access to private functions w/o changing # their visibility in the installed libraries. - target_link_libraries(${test} + target_link_libraries( + ${test} $ sundials_sunmemsys_obj sundials_nvecserial_obj diff --git a/test/unit_tests/arkode/F2003_serial/CMakeLists.txt b/test/unit_tests/arkode/F2003_serial/CMakeLists.txt index 1125ac771d..ab48e3a4c3 100644 --- a/test/unit_tests/arkode/F2003_serial/CMakeLists.txt +++ b/test/unit_tests/arkode/F2003_serial/CMakeLists.txt @@ -15,19 +15,16 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(ARKODE_unit_tests - "ark_test_table_f2003\;" - ) +set(ARKODE_unit_tests "ark_test_table_f2003\;") foreach(test_tuple ${ARKODE_unit_tests}) - # parse the test tuple list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -36,9 +33,7 @@ foreach(test_tuple ${ARKODE_unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # libraries to link against - target_link_libraries(${test} - sundials_farkode_mod - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_farkode_mod ${EXE_EXTRA_LINK_LIBS}) endif() @@ -56,4 +51,3 @@ foreach(test_tuple ${ARKODE_unit_tests}) endforeach() message(STATUS "Added ARKODE F2003 serial unit tests") - diff --git a/test/unit_tests/arkode/gtest/CMakeLists.txt b/test/unit_tests/arkode/gtest/CMakeLists.txt index 0d6871f63b..071faee5c0 100644 --- a/test/unit_tests/arkode/gtest/CMakeLists.txt +++ b/test/unit_tests/arkode/gtest/CMakeLists.txt @@ -13,37 +13,31 @@ # include location of public and private header files add_executable(test_arkode_error_handling test_arkode_error_handling.cpp) -target_include_directories(test_arkode_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_arkode_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# ARKODE objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_arkode_error_handling - PRIVATE - $ - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - sundials_sunadaptcontrollerimexgus_obj - sundials_sunadaptcontrollersoderlind_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the ARKODE +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_arkode_error_handling + PRIVATE $ + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + sundials_sunadaptcontrollerimexgus_obj + sundials_sunadaptcontrollersoderlind_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the ARKODE library since it does not pick -# that up from $. +# Tell CMake that we depend on the ARKODE library since it does not pick that up +# from $. add_dependencies(test_arkode_error_handling sundials_arkode_obj) -target_link_libraries(test_arkode_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_arkode_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_arkode_error_handling) diff --git a/test/unit_tests/cvode/CMakeLists.txt b/test/unit_tests/cvode/CMakeLists.txt index b0ac9c4ad9..13c49d32f1 100644 --- a/test/unit_tests/cvode/CMakeLists.txt +++ b/test/unit_tests/cvode/CMakeLists.txt @@ -20,7 +20,7 @@ add_subdirectory(C_serial) # C++ unit tests if(CXX_FOUND) add_subdirectory(CXX_serial) - if (SUNDIALS_TEST_ENABLE_GTEST) + if(SUNDIALS_TEST_ENABLE_GTEST) add_subdirectory(gtest) endif() endif() diff --git a/test/unit_tests/cvode/CXX_serial/CMakeLists.txt b/test/unit_tests/cvode/CXX_serial/CMakeLists.txt index 30a48464c5..9c5cec05b6 100644 --- a/test/unit_tests/cvode/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/cvode/CXX_serial/CMakeLists.txt @@ -16,19 +16,18 @@ # List of test tuples of the form "name\;args" set(unit_tests - "cv_test_kpr.cpp\;" - "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "cv_test_kpr.cpp\;--eta_max_fs 2" - "cv_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" - "cv_test_kpr.cpp\;--eta_min_gs 2" - "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "cv_test_kpr.cpp\;--eta_min_ef 0.5" - "cv_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" - "cv_test_kpr.cpp\;--eta_cf 0.5" - "cv_test_kpr.cpp\;--dgmax_lsetup 0.0" - "cv_test_kpr.cpp\;--dgmax_jbad 1.0" - "cv_test_getjac.cpp\;" -) + "cv_test_kpr.cpp\;" + "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "cv_test_kpr.cpp\;--eta_max_fs 2" + "cv_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" + "cv_test_kpr.cpp\;--eta_min_gs 2" + "cv_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "cv_test_kpr.cpp\;--eta_min_ef 0.5" + "cv_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" + "cv_test_kpr.cpp\;--eta_cf 0.5" + "cv_test_kpr.cpp\;--dgmax_lsetup 0.0" + "cv_test_kpr.cpp\;--dgmax_jbad 1.0" + "cv_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -51,16 +50,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -78,13 +75,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/cvode/C_serial/CMakeLists.txt b/test/unit_tests/cvode/C_serial/CMakeLists.txt index 2c9708d32c..cf406d87b7 100644 --- a/test/unit_tests/cvode/C_serial/CMakeLists.txt +++ b/test/unit_tests/cvode/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "cv_test_getuserdata\;" - "cv_test_tstop\;" - ) +set(unit_tests "cv_test_getuserdata\;" "cv_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_cvode - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_cvode sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/cvode/gtest/CMakeLists.txt b/test/unit_tests/cvode/gtest/CMakeLists.txt index df16114295..43574de435 100644 --- a/test/unit_tests/cvode/gtest/CMakeLists.txt +++ b/test/unit_tests/cvode/gtest/CMakeLists.txt @@ -13,40 +13,34 @@ # include location of public and private header files add_executable(test_cvode_error_handling test_cvode_error_handling.cpp) -target_include_directories(test_cvode_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_cvode_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) if(SUNDIALS_BUILD_PACKAGE_FUSED_KERNELS) set(_fused_link_lib sundials_cvode_fused_stubs_obj) endif() -# We explicitly choose which object libraries to link to and link in the -# cvode objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_cvode_error_handling - PRIVATE - $ - ${_fused_link_lib} - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the cvode +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_cvode_error_handling + PRIVATE $ + ${_fused_link_lib} + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the CVODE library since it does not pick -# that up from $. +# Tell CMake that we depend on the CVODE library since it does not pick that up +# from $. add_dependencies(test_cvode_error_handling sundials_cvode_obj) -target_link_libraries(test_cvode_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_cvode_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_cvode_error_handling) diff --git a/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt b/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt index b6988e1e54..5c635050ef 100644 --- a/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/cvodes/CXX_serial/CMakeLists.txt @@ -16,19 +16,18 @@ # List of test tuples of the form "name\;args" set(unit_tests - "cvs_test_kpr.cpp\;" - "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "cvs_test_kpr.cpp\;--eta_max_fs 2" - "cvs_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" - "cvs_test_kpr.cpp\;--eta_min_gs 2" - "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "cvs_test_kpr.cpp\;--eta_min_ef 0.5" - "cvs_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" - "cvs_test_kpr.cpp\;--eta_cf 0.5" - "cvs_test_kpr.cpp\;--dgmax_lsetup 0.0" - "cvs_test_kpr.cpp\;--dgmax_jbad 1.0" - "cvs_test_getjac.cpp\;" -) + "cvs_test_kpr.cpp\;" + "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "cvs_test_kpr.cpp\;--eta_max_fs 2" + "cvs_test_kpr.cpp\;--eta_min_es 2 --small_nst 5" + "cvs_test_kpr.cpp\;--eta_min_gs 2" + "cvs_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "cvs_test_kpr.cpp\;--eta_min_ef 0.5" + "cvs_test_kpr.cpp\;--eta_max_ef 0.1 --small_nef 1" + "cvs_test_kpr.cpp\;--eta_cf 0.5" + "cvs_test_kpr.cpp\;--dgmax_lsetup 0.0" + "cvs_test_kpr.cpp\;--dgmax_jbad 1.0" + "cvs_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -51,16 +50,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_cvodes - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_cvodes sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -78,13 +75,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/cvodes/C_serial/CMakeLists.txt b/test/unit_tests/cvodes/C_serial/CMakeLists.txt index 1b0c39e951..cebc506bed 100644 --- a/test/unit_tests/cvodes/C_serial/CMakeLists.txt +++ b/test/unit_tests/cvodes/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "cvs_test_getuserdata\;" - "cvs_test_tstop\;" - ) +set(unit_tests "cvs_test_getuserdata\;" "cvs_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_cvodes - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_cvodes sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/cvodes/gtest/CMakeLists.txt b/test/unit_tests/cvodes/gtest/CMakeLists.txt index c3ccf0b7b4..92739e4f19 100644 --- a/test/unit_tests/cvodes/gtest/CMakeLists.txt +++ b/test/unit_tests/cvodes/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_cvodes_error_handling test_cvodes_error_handling.cpp) -target_include_directories(test_cvodes_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_cvodes_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# cvode objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_cvodes_error_handling - PRIVATE - $ - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the cvode +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_cvodes_error_handling + PRIVATE $ + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the CVODE library since it does not pick -# that up from $. +# Tell CMake that we depend on the CVODE library since it does not pick that up +# from $. add_dependencies(test_cvodes_error_handling sundials_cvodes_obj) -target_link_libraries(test_cvodes_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_cvodes_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_cvodes_error_handling) diff --git a/test/unit_tests/ida/CXX_serial/CMakeLists.txt b/test/unit_tests/ida/CXX_serial/CMakeLists.txt index f97d03edf3..503f525543 100644 --- a/test/unit_tests/ida/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/ida/CXX_serial/CMakeLists.txt @@ -16,16 +16,15 @@ # List of test tuples of the form "name\;args" set(unit_tests - "ida_test_kpr.cpp\;" - "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "ida_test_kpr.cpp\;--eta_max_fs 2" - "ida_test_kpr.cpp\;--eta_min 2" - "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "ida_test_kpr.cpp\;--eta_min_ef 0.5" - "ida_test_kpr.cpp\;--eta_cf 0.5" - "ida_test_kpr.cpp\;--dcj 0.9" - "ida_test_getjac.cpp\;" -) + "ida_test_kpr.cpp\;" + "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "ida_test_kpr.cpp\;--eta_max_fs 2" + "ida_test_kpr.cpp\;--eta_min 2" + "ida_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "ida_test_kpr.cpp\;--eta_min_ef 0.5" + "ida_test_kpr.cpp\;--eta_cf 0.5" + "ida_test_kpr.cpp\;--dcj 0.9" + "ida_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -48,16 +47,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_ida - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_ida sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -75,13 +72,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/ida/C_serial/CMakeLists.txt b/test/unit_tests/ida/C_serial/CMakeLists.txt index a6bcb567c2..202a88fe58 100644 --- a/test/unit_tests/ida/C_serial/CMakeLists.txt +++ b/test/unit_tests/ida/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "ida_test_getuserdata\;" - "ida_test_tstop\;" - ) +set(unit_tests "ida_test_getuserdata\;" "ida_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_ida - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_ida sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/ida/gtest/CMakeLists.txt b/test/unit_tests/ida/gtest/CMakeLists.txt index cb57cde05f..38c5a3e92b 100644 --- a/test/unit_tests/ida/gtest/CMakeLists.txt +++ b/test/unit_tests/ida/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_ida_error_handling test_ida_error_handling.cpp) -target_include_directories(test_ida_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_ida_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# ida objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_ida_error_handling - PRIVATE - $ - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the ida +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_ida_error_handling + PRIVATE $ + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the IDA library since it does not pick -# that up from $. +# Tell CMake that we depend on the IDA library since it does not pick that up +# from $. add_dependencies(test_ida_error_handling sundials_ida_obj) -target_link_libraries(test_ida_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_ida_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_ida_error_handling) diff --git a/test/unit_tests/idas/CXX_serial/CMakeLists.txt b/test/unit_tests/idas/CXX_serial/CMakeLists.txt index 6aa818b999..6f1e59c892 100644 --- a/test/unit_tests/idas/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/idas/CXX_serial/CMakeLists.txt @@ -16,15 +16,14 @@ # List of test tuples of the form "name\;args" set(unit_tests - "idas_test_kpr.cpp\;" - "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" - "idas_test_kpr.cpp\;--eta_min 2" - "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" - "idas_test_kpr.cpp\;--eta_min_ef 0.5" - "idas_test_kpr.cpp\;--eta_cf 0.5" - "idas_test_kpr.cpp\;--dcj 0.9" - "idas_test_getjac.cpp\;" -) + "idas_test_kpr.cpp\;" + "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_max_fx 2.0" + "idas_test_kpr.cpp\;--eta_min 2" + "idas_test_kpr.cpp\;--eta_min_fx 1.0 --eta_min 0.5" + "idas_test_kpr.cpp\;--eta_min_ef 0.5" + "idas_test_kpr.cpp\;--eta_cf 0.5" + "idas_test_kpr.cpp\;--dcj 0.9" + "idas_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -47,16 +46,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_idas - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_idas sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -74,13 +71,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/idas/C_serial/CMakeLists.txt b/test/unit_tests/idas/C_serial/CMakeLists.txt index 1cef7d6e72..16f9384ee6 100644 --- a/test/unit_tests/idas/C_serial/CMakeLists.txt +++ b/test/unit_tests/idas/C_serial/CMakeLists.txt @@ -15,10 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "idas_test_getuserdata\;" - "idas_test_tstop\;" - ) +set(unit_tests "idas_test_getuserdata\;" "idas_test_tstop\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -27,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -37,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_idas - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_idas sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/idas/gtest/CMakeLists.txt b/test/unit_tests/idas/gtest/CMakeLists.txt index ac85d86b9b..8f6c0b292e 100644 --- a/test/unit_tests/idas/gtest/CMakeLists.txt +++ b/test/unit_tests/idas/gtest/CMakeLists.txt @@ -13,36 +13,29 @@ # include location of public and private header files add_executable(test_idas_error_handling test_idas_error_handling.cpp) -target_include_directories(test_idas_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_idas_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# ida objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_idas_error_handling - PRIVATE - $ - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the ida +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_idas_error_handling + PRIVATE $ + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the IDA library since it does not pick -# that up from $. +# Tell CMake that we depend on the IDA library since it does not pick that up +# from $. add_dependencies(test_idas_error_handling sundials_idas_obj) -target_link_libraries(test_idas_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_idas_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_idas_error_handling) - diff --git a/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt b/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt index 2ab550476c..f83ef171b7 100644 --- a/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt +++ b/test/unit_tests/kinsol/CXX_serial/CMakeLists.txt @@ -15,9 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "kin_test_getjac.cpp\;" -) +set(unit_tests "kin_test_getjac.cpp\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -40,16 +38,14 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test_target} PROPERTIES FOLDER "unit_tests") # Include location of public and private header files - target_include_directories(${test_target} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test_target} + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # Libraries to link against - target_link_libraries(${test_target} - sundials_kinsol - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test_target} sundials_kinsol sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -67,13 +63,12 @@ foreach(test_tuple ${unit_tests}) endif() # add test to regression tests - sundials_add_test(${test_name} ${test_target} + sundials_add_test( + ${test_name} ${test_target} TEST_ARGS ${test_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} ANSWER_FILE ${test_name}.out - EXAMPLE_TYPE "develop" - ${diff_output} - ) + EXAMPLE_TYPE "develop" ${diff_output}) endforeach() diff --git a/test/unit_tests/kinsol/C_serial/CMakeLists.txt b/test/unit_tests/kinsol/C_serial/CMakeLists.txt index 9715b8e3e6..a3db85d254 100644 --- a/test/unit_tests/kinsol/C_serial/CMakeLists.txt +++ b/test/unit_tests/kinsol/C_serial/CMakeLists.txt @@ -15,9 +15,7 @@ # --------------------------------------------------------------- # List of test tuples of the form "name\;args" -set(unit_tests - "kin_test_getuserdata\;" - ) +set(unit_tests "kin_test_getuserdata\;") # Add the build and install targets for each test foreach(test_tuple ${unit_tests}) @@ -26,8 +24,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -36,16 +34,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_kinsol - sundials_nvecserial - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_kinsol sundials_nvecserial + ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/kinsol/gtest/CMakeLists.txt b/test/unit_tests/kinsol/gtest/CMakeLists.txt index d620c6d05f..5b6d650402 100644 --- a/test/unit_tests/kinsol/gtest/CMakeLists.txt +++ b/test/unit_tests/kinsol/gtest/CMakeLists.txt @@ -13,35 +13,29 @@ # include location of public and private header files add_executable(test_kinsol_error_handling test_kinsol_error_handling.cpp) -target_include_directories(test_kinsol_error_handling - PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src -) +target_include_directories( + test_kinsol_error_handling + PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) -# We explicitly choose which object libraries to link to and link in the -# KINSOL objects so that we have access to private functions w/o changing -# their visibility in the installed libraries. -target_link_libraries(test_kinsol_error_handling - PRIVATE - $ - sundials_sunmemsys_obj - sundials_nvecserial_obj - sundials_sunlinsolband_obj - sundials_sunlinsoldense_obj - sundials_sunnonlinsolnewton_obj - ${EXE_EXTRA_LINK_LIBS} -) +# We explicitly choose which object libraries to link to and link in the KINSOL +# objects so that we have access to private functions w/o changing their +# visibility in the installed libraries. +target_link_libraries( + test_kinsol_error_handling + PRIVATE $ + sundials_sunmemsys_obj + sundials_nvecserial_obj + sundials_sunlinsolband_obj + sundials_sunlinsoldense_obj + sundials_sunnonlinsolnewton_obj + ${EXE_EXTRA_LINK_LIBS}) -# Tell CMake that we depend on the KINSOL library since it does not pick -# that up from $. +# Tell CMake that we depend on the KINSOL library since it does not pick that up +# from $. add_dependencies(test_kinsol_error_handling sundials_kinsol_obj) -target_link_libraries(test_kinsol_error_handling - PRIVATE - GTest::gtest_main - GTest::gmock -) +target_link_libraries(test_kinsol_error_handling PRIVATE GTest::gtest_main + GTest::gmock) gtest_discover_tests(test_kinsol_error_handling) diff --git a/test/unit_tests/profiling/CMakeLists.txt b/test/unit_tests/profiling/CMakeLists.txt index d3023f7f22..1403bbbefc 100644 --- a/test/unit_tests/profiling/CMakeLists.txt +++ b/test/unit_tests/profiling/CMakeLists.txt @@ -22,8 +22,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -32,15 +32,12 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} - sundials_core - ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} sundials_core ${EXE_EXTRA_LINK_LIBS}) endif() diff --git a/test/unit_tests/sundials/CMakeLists.txt b/test/unit_tests/sundials/CMakeLists.txt index d48c707f07..1883aa072b 100644 --- a/test/unit_tests/sundials/CMakeLists.txt +++ b/test/unit_tests/sundials/CMakeLists.txt @@ -13,8 +13,9 @@ if(SUNDIALS_ENABLE_ERROR_CHECKS) if(TARGET GTest::gtest_main AND TARGET GTest::gmock) add_executable(test_sundials_errors test_sundials_errors.cpp) - target_link_libraries(test_sundials_errors - PRIVATE sundials_core sundials_nvecserial GTest::gtest_main GTest::gmock) + target_link_libraries( + test_sundials_errors PRIVATE sundials_core sundials_nvecserial + GTest::gtest_main GTest::gmock) gtest_discover_tests(test_sundials_errors) endif() endif() diff --git a/test/unit_tests/sundials/reductions/CMakeLists.txt b/test/unit_tests/sundials/reductions/CMakeLists.txt index 70ca8a15a0..bee7ed7707 100644 --- a/test/unit_tests/sundials/reductions/CMakeLists.txt +++ b/test/unit_tests/sundials/reductions/CMakeLists.txt @@ -22,8 +22,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -32,10 +32,9 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against target_link_libraries(${test} ${EXE_EXTRA_LINK_LIBS}) diff --git a/test/unit_tests/sunmemory/CMakeLists.txt b/test/unit_tests/sunmemory/CMakeLists.txt index 2a399b5bce..aba5a544d7 100644 --- a/test/unit_tests/sunmemory/CMakeLists.txt +++ b/test/unit_tests/sunmemory/CMakeLists.txt @@ -23,4 +23,3 @@ endif() if(ENABLE_SYCL) add_subdirectory(sycl) endif() - diff --git a/test/unit_tests/sunmemory/cuda/CMakeLists.txt b/test/unit_tests/sunmemory/cuda/CMakeLists.txt index c66b570bf7..f8fc7f3643 100644 --- a/test/unit_tests/sunmemory/cuda/CMakeLists.txt +++ b/test/unit_tests/sunmemory/cuda/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemcuda_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemcuda_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Cuda units tests") - diff --git a/test/unit_tests/sunmemory/hip/CMakeLists.txt b/test/unit_tests/sunmemory/hip/CMakeLists.txt index 509a02d038..383417561c 100644 --- a/test/unit_tests/sunmemory/hip/CMakeLists.txt +++ b/test/unit_tests/sunmemory/hip/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemhip_obj hip::device ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemhip_obj + hip::device ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Hip units tests") - diff --git a/test/unit_tests/sunmemory/sycl/CMakeLists.txt b/test/unit_tests/sunmemory/sycl/CMakeLists.txt index 744bb95b7a..de3abc84e7 100644 --- a/test/unit_tests/sunmemory/sycl/CMakeLists.txt +++ b/test/unit_tests/sunmemory/sycl/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsycl_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsycl_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Sycl units tests") - diff --git a/test/unit_tests/sunmemory/sys/CMakeLists.txt b/test/unit_tests/sunmemory/sys/CMakeLists.txt index 8f11528123..3dc597c941 100644 --- a/test/unit_tests/sunmemory/sys/CMakeLists.txt +++ b/test/unit_tests/sunmemory/sys/CMakeLists.txt @@ -20,8 +20,8 @@ foreach(test_tuple ${unit_tests}) list(GET test_tuple 0 test) list(GET test_tuple 1 test_args) - # check if this test has already been added, only need to add - # test source files once for testing with different inputs + # check if this test has already been added, only need to add test source + # files once for testing with different inputs if(NOT TARGET ${test}) # test source files @@ -30,13 +30,13 @@ foreach(test_tuple ${unit_tests}) set_target_properties(${test} PROPERTIES FOLDER "unit_tests") # include location of public and private header files - target_include_directories(${test} PRIVATE - $ - ${CMAKE_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/src) + target_include_directories( + ${test} PRIVATE $ + ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src) # libraries to link against - target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsys_obj ${EXE_EXTRA_LINK_LIBS}) + target_link_libraries(${test} PRIVATE sundials_core sundials_sunmemsys_obj + ${EXE_EXTRA_LINK_LIBS}) endif() @@ -54,4 +54,3 @@ foreach(test_tuple ${unit_tests}) endforeach() message(STATUS "Added SUNMemoryHelper_Sys units tests") - From fe230801bdbe0a64813999713e0dfdf1bc8a345a Mon Sep 17 00:00:00 2001 From: David Gardner Date: Tue, 9 Jul 2024 09:40:56 -0700 Subject: [PATCH 3/6] Maintenance: update ignore revs (#540) Ignore recent revisions for Python and CMake formatting in git blame --- .git-blame-ignore-revs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 51ab03ac92..870b004be9 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -4,3 +4,7 @@ fab1cecb7d91cff53b31730af5d00ff154c3b6ce cc6960349aa92e2bcad9168a6dacff99b21c329c # Apply formatting to Fortran files 23581e8454955283139e551a7bcd1b85d8b7c77b +# Apply formatting to Python files +b578eabccd77b7642b04ddda9d8530f05890d1b4 +# Apply formatting to CMake files +c6b9a02f24a27081c471d63dfc524684a9f5a9e3 From eb010a0c087502cf7582f0af03f1218ecacad711 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:41:26 -0700 Subject: [PATCH 4/6] Build(deps): Bump docker/build-push-action from 6.0.2 to 6.3.0 (#539) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 6.0.2 to 6.3.0.
Release notes

Sourced from docker/build-push-action's releases.

v6.3.0

Full Changelog: https://github.com/docker/build-push-action/compare/v6.2.0...v6.3.0

v6.2.0

Full Changelog: https://github.com/docker/build-push-action/compare/v6.1.0...v6.2.0

v6.1.0

Full Changelog: https://github.com/docker/build-push-action/compare/v6.0.2...v6.1.0

Commits
  • 1a16264 Merge pull request #1172 from crazy-max/build-export-disable
  • 9eea548 chore: update generated content
  • 11c2faa rename DOCKER_BUILD_EXPORT_RETENTION_DAYS to DOCKER_BUILD_RECORD_RETENTION_DAYS
  • de2365a opt to disable build record upload
  • bca5082 Merge pull request #1173 from crazy-max/build-summary-env-change
  • e7aab40 chore: update generated content
  • 63eb759 switch DOCKER_BUILD_SUMMARY_DISABLE to DOCKER_BUILD_SUMMARY
  • 53ec486 Merge pull request #1171 from docker/dependabot/npm_and_yarn/docker/actions-t...
  • fe9d9f1 chore: update generated content
  • ad37ba1 chore(deps): Bump @​docker/actions-toolkit from 0.30.0 to 0.31.0
  • Additional commits viewable in compare view

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=docker/build-push-action&package-manager=github_actions&previous-version=6.0.2&new-version=6.3.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Cody Balos --- .github/workflows/build-ci-containers-e4s.yml | 4 ++-- .github/workflows/build-ci-containers-nightly.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ci-containers-e4s.yml b/.github/workflows/build-ci-containers-e4s.yml index fe76443ae2..53a629aa3a 100644 --- a/.github/workflows/build-ci-containers-e4s.yml +++ b/.github/workflows/build-ci-containers-e4s.yml @@ -26,7 +26,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/e4s-base" build-args: e4s_version=22.05 @@ -56,7 +56,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/e4s-quarterly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml diff --git a/.github/workflows/build-ci-containers-nightly.yml b/.github/workflows/build-ci-containers-nightly.yml index 7f9fdd9e3e..a40af5b1b4 100644 --- a/.github/workflows/build-ci-containers-nightly.yml +++ b/.github/workflows/build-ci-containers-nightly.yml @@ -32,7 +32,7 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker images - uses: docker/build-push-action@v6.0.2 + uses: docker/build-push-action@v6.3.0 with: context: "./docker/sundials-ci/spack-nightly" build-args: spack_yaml=./int${{ matrix.indexsize }}-${{ matrix.precision }}/spack.yaml From e9a6d86a8b30c50c330e8836631dd1de7ccd5061 Mon Sep 17 00:00:00 2001 From: David Gardner Date: Wed, 17 Jul 2024 07:48:02 +0800 Subject: [PATCH 5/6] Maintenance: Add codespell to check spelling (#544) Add codespell workflow to CI to check for common spelling errors --------- Co-authored-by: Daniel R. Reynolds --- .github/workflows/check-spelling.yml | 44 +++++++++++++++++++ CHANGELOG.md | 8 ++-- CMakeLists.txt | 2 +- CODEOWNERS | 2 +- CONTRIBUTING.md | 2 +- .../kokkos/ParallelGrid.hpp | 4 +- .../kokkos/arkode_driver.cpp | 2 +- .../kokkos/check_retval.h | 2 +- .../advection_reaction_3D/kokkos/rhs3D.hpp | 2 +- .../raja/ParallelGrid.hpp | 4 +- .../raja/advection_reaction_3D.hpp | 2 +- .../raja/arkode_driver.cpp | 2 +- .../advection_reaction_3D/raja/check_retval.h | 2 +- benchmarks/diffusion_2D/diffusion_2D.cpp | 2 +- benchmarks/diffusion_2D/diffusion_2D.hpp | 4 +- benchmarks/diffusion_2D/main_arkode.cpp | 4 +- benchmarks/diffusion_2D/main_cvode.cpp | 4 +- benchmarks/diffusion_2D/main_ida.cpp | 4 +- .../plot_nvector_performance_results.py | 2 +- .../plot_nvector_performance_speedup.py | 2 +- .../sycl/test_nvector_performance_sycl.cpp | 2 +- benchmarks/nvector/test_nvector_performance.h | 2 +- cmake/SundialsBuildOptionsPost.cmake | 2 +- cmake/SundialsBuildOptionsPre.cmake | 2 +- cmake/SundialsSetupCXX.cmake | 2 +- cmake/SundialsSetupCompilers.cmake | 4 +- cmake/SundialsSetupCuda.cmake | 2 +- cmake/tpl/FindMAGMA.cmake | 2 +- cmake/tpl/SundialsHypre.cmake | 4 +- cmake/tpl/SundialsLapack.cmake | 6 +-- doc/arkode/examples/source/c_serial.rst | 4 +- doc/arkode/examples/source/conf.py | 2 +- doc/arkode/guide/source/Mathematics.rst | 2 +- .../source/Usage/ARKStep/User_callable.rst | 4 +- .../guide/source/Usage/ARKStep/XBraid.rst | 10 ++--- .../source/Usage/ERKStep/User_callable.rst | 4 +- .../source/Usage/MRIStep/MRIStepCoupling.rst | 2 +- .../source/Usage/MRIStep/User_callable.rst | 6 +-- .../source/Usage/SPRKStep/User_callable.rst | 6 +-- .../guide/source/Usage/User_callable.rst | 4 +- doc/arkode/guide/source/conf.py | 2 +- .../source/sunlinsol/ARKODE_interface.rst | 2 +- .../source/sunnonlinsol/ARKODE_interface.rst | 12 ++--- doc/cvode/cv_ex_cuda.tex | 2 +- doc/cvode/cv_ex_intro.tex | 2 +- doc/cvode/cv_ex_parallel.tex | 2 +- doc/cvode/cv_ex_serial.tex | 6 +-- doc/cvode/cv_ex_tests.tex | 2 +- doc/cvode/guide/source/Constants.rst | 2 +- doc/cvode/guide/source/Introduction.rst | 2 +- doc/cvode/guide/source/Usage/index.rst | 24 +++++----- doc/cvode/guide/source/conf.py | 2 +- .../source/sunnonlinsol/CVODE_interface.rst | 2 +- doc/cvodes/cvs_ex_adj.tex | 4 +- doc/cvodes/cvs_ex_fwd.tex | 4 +- doc/cvodes/cvs_ex_intro.tex | 2 +- doc/cvodes/guide/source/Constants.rst | 8 ++-- doc/cvodes/guide/source/Introduction.rst | 6 +-- doc/cvodes/guide/source/Mathematics.rst | 4 +- doc/cvodes/guide/source/Usage/ADJ.rst | 24 +++++----- doc/cvodes/guide/source/Usage/FSA.rst | 6 +-- doc/cvodes/guide/source/Usage/SIM.rst | 24 +++++----- doc/cvodes/guide/source/conf.py | 2 +- .../source/sunnonlinsol/CVODES_interface.rst | 10 ++--- doc/ida/guide/source/Introduction.rst | 2 +- doc/ida/guide/source/Usage/index.rst | 22 +++++----- doc/ida/guide/source/conf.py | 2 +- .../source/sunnonlinsol/IDA_interface.rst | 4 +- doc/ida/ida_ex_fortran.tex | 2 +- doc/ida/ida_ex_serial.tex | 4 +- doc/ida/ida_ex_trilinos.tex | 2 +- doc/idas/guide/source/Introduction.rst | 4 +- doc/idas/guide/source/Usage/ADJ.rst | 8 ++-- doc/idas/guide/source/Usage/FSA.rst | 2 +- doc/idas/guide/source/Usage/SIM.rst | 24 +++++----- doc/idas/guide/source/conf.py | 2 +- .../source/sunnonlinsol/IDAS_interface.rst | 10 ++--- doc/idas/idas_ex_intro.tex | 2 +- doc/kinsol/guide/source/Usage/index.rst | 10 ++--- doc/kinsol/guide/source/conf.py | 2 +- doc/kinsol/kin_ex_c.tex | 6 +-- doc/kinsol/kin_ex_fortran.tex | 2 +- doc/shared/Changelog.rst | 8 ++-- doc/shared/nvectors/NVector_CUDA.rst | 10 ++--- doc/shared/nvectors/NVector_HIP.rst | 10 ++--- doc/shared/nvectors/NVector_MPIManyVector.rst | 2 +- doc/shared/nvectors/NVector_MPIPlusX.rst | 2 +- doc/shared/nvectors/NVector_ManyVector.rst | 2 +- doc/shared/nvectors/NVector_OpenMP.rst | 2 +- doc/shared/nvectors/NVector_Operations.rst | 2 +- doc/shared/nvectors/NVector_PETSc.rst | 2 +- doc/shared/nvectors/NVector_Trilinos.rst | 2 +- .../SUNAdaptController_Soderlind.rst | 4 +- doc/shared/sundials/Errors.rst | 36 +++++++-------- doc/shared/sundials/GPU.rst | 6 +-- doc/shared/sundials/Install.rst | 20 ++++----- doc/shared/sunlinsol/SUNLinSol_API.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst | 8 ++-- .../sunlinsol/SUNLinSol_SuperLUDIST.rst | 4 +- doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst | 2 +- .../sunmatrix/SUNMatrix_Description.rst | 2 +- .../sunmatrix/SUNMatrix_KokkosDense.rst | 4 +- .../sunmemory/SUNMemory_Description.rst | 2 +- doc/shared/sunnonlinsol/SUNNonlinSol_API.rst | 8 ++-- .../sunnonlinsol/SUNNonlinSol_PetscSNES.rst | 4 +- doc/sundials/ug.tex | 4 +- doc/superbuild/source/contributing/index.rst | 2 +- .../developers/appendix/GitCheatSheet.rst | 2 +- .../developers/getting_started/Workflow.rst | 6 +-- .../developers/style_guide/SourceCode.rst | 2 +- .../source/developers/testing/Answers.rst | 2 +- .../source/developers/testing/CI.rst | 4 +- .../arkode/CXX_parallel/ark_brusselator1D.h | 4 +- .../ark_brusselator1D_task_local_nls.cpp | 4 +- .../CXX_parallel/ark_diffusion_reaction_p.cpp | 18 ++++---- examples/arkode/CXX_parallel/ark_heat2D_p.cpp | 8 ++-- examples/arkode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/arkode/CXX_parhyp/CMakeLists.txt | 2 +- .../arkode/CXX_parhyp/ark_heat2D_hypre_ls.cpp | 14 +++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg.cpp | 12 ++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg_imex.cpp | 12 ++--- .../CXX_parhyp/ark_heat2D_hypre_pfmg_mri.cpp | 12 ++--- examples/arkode/CXX_parhyp/plot_heat2D_p.py | 2 +- .../ark_advection_diffusion_reaction.cpp | 2 +- .../ark_advection_diffusion_reaction.hpp | 2 +- .../arkode/CXX_serial/ark_analytic_sys.cpp | 12 ++--- .../arkode/CXX_serial/ark_analytic_sys.out | 2 +- examples/arkode/CXX_serial/ark_heat2D.cpp | 6 +-- examples/arkode/CXX_serial/ark_kpr_Mt.cpp | 2 +- examples/arkode/CXX_serial/plot_heat2D.py | 2 +- .../arkode/CXX_superludist/CMakeLists.txt | 2 +- .../ark_brusselator1D_FEM_sludist.cpp | 4 +- examples/arkode/CXX_xbraid/CMakeLists.txt | 2 +- .../ark_heat2D_hypre_pfmg_xbraid.cpp | 14 +++--- .../arkode/CXX_xbraid/ark_heat2D_p_xbraid.cpp | 10 ++--- .../arkode/CXX_xbraid/ark_heat2D_xbraid.cpp | 8 ++-- examples/arkode/CXX_xbraid/plot_heat2D.py | 2 +- examples/arkode/C_manyvector/CMakeLists.txt | 2 +- .../C_manyvector/ark_brusselator1D_manyvec.c | 2 +- examples/arkode/C_openmp/CMakeLists.txt | 2 +- .../arkode/C_openmp/ark_brusselator1D_omp.c | 2 +- examples/arkode/C_openmpdev/CMakeLists.txt | 2 +- .../arkode/C_openmpdev/ark_heat1D_ompdev.c | 2 +- examples/arkode/C_parallel/CMakeLists.txt | 2 +- .../ark_brusselator1D_task_local_nls.c | 8 ++-- .../arkode/C_parallel/ark_diurnal_kry_bbd_p.c | 2 +- .../arkode/C_parallel/ark_diurnal_kry_p.c | 2 +- examples/arkode/C_parhyp/ark_diurnal_kry_ph.c | 2 +- examples/arkode/C_petsc/ark_petsc_ex25.c | 2 +- examples/arkode/C_serial/CMakeLists.txt | 2 +- .../arkode/C_serial/ark_KrylovDemo_prec.c | 18 ++++---- examples/arkode/C_serial/ark_analytic.c | 24 +++++----- examples/arkode/C_serial/ark_analytic.out | 2 +- examples/arkode/C_serial/ark_analytic_mels.c | 30 ++++++------- .../arkode/C_serial/ark_analytic_mels.out | 2 +- .../arkode/C_serial/ark_analytic_nonlin.c | 2 +- examples/arkode/C_serial/ark_brusselator.c | 2 +- examples/arkode/C_serial/ark_brusselator1D.c | 2 +- .../C_serial/ark_brusselator1D_FEM_slu.c | 4 +- .../C_serial/ark_brusselator1D_imexmri.c | 4 +- .../arkode/C_serial/ark_brusselator1D_klu.c | 2 +- .../arkode/C_serial/ark_brusselator_1D_mri.c | 6 +-- examples/arkode/C_serial/ark_brusselator_fp.c | 2 +- .../arkode/C_serial/ark_brusselator_mri.c | 4 +- .../arkode/C_serial/ark_harmonic_symplectic.c | 2 +- examples/arkode/C_serial/ark_heat1D.c | 2 +- examples/arkode/C_serial/ark_kpr_mri.c | 4 +- .../arkode/C_serial/ark_onewaycouple_mri.c | 8 ++-- .../C_serial/ark_reaction_diffusion_mri.c | 4 +- examples/arkode/C_serial/ark_robertson.c | 4 +- .../C_serial/ark_robertson_constraints.c | 4 +- examples/arkode/C_serial/ark_robertson_root.c | 2 +- .../arkode/C_serial/ark_twowaycouple_mri.c | 6 +-- examples/arkode/F2003_custom/CMakeLists.txt | 2 +- .../ark_analytic_complex_f2003.f90 | 8 ++-- examples/arkode/F2003_parallel/CMakeLists.txt | 4 +- ...ark_brusselator1D_task_local_nls_f2003.f90 | 18 ++++---- .../F2003_parallel/ark_heat2D_f2003.f90 | 2 +- examples/arkode/F2003_serial/CMakeLists.txt | 2 +- .../F2003_serial/ark_analytic_f2003.f90 | 8 ++-- .../F2003_serial/ark_diurnal_kry_bp_f2003.f90 | 2 +- .../arkode/F2003_serial/ark_kpr_mri_f2003.f90 | 4 +- .../CXX_onemkl/cvRoberts_blockdiag_onemkl.cpp | 2 +- examples/cvode/CXX_parallel/CMakeLists.txt | 2 +- examples/cvode/CXX_parallel/cv_heat2D_p.cpp | 8 ++-- examples/cvode/CXX_parallel/plot_heat2D_p.py | 2 +- examples/cvode/CXX_parhyp/CMakeLists.txt | 2 +- .../cvode/CXX_parhyp/cv_heat2D_hypre_ls.cpp | 14 +++--- .../cvode/CXX_parhyp/cv_heat2D_hypre_pfmg.cpp | 12 ++--- examples/cvode/CXX_parhyp/plot_heat2D_p.py | 2 +- examples/cvode/CXX_serial/CMakeLists.txt | 2 +- examples/cvode/CXX_serial/cv_heat2D.cpp | 2 +- examples/cvode/CXX_serial/cv_heat2D.hpp | 4 +- examples/cvode/CXX_serial/plot_heat2D.py | 2 +- .../cvode/CXX_sycl/cvAdvDiff_kry_sycl.cpp | 2 +- examples/cvode/C_mpimanyvector/CMakeLists.txt | 2 +- .../cvDiurnal_kry_mpimanyvec.c | 2 +- examples/cvode/C_openmp/CMakeLists.txt | 2 +- examples/cvode/C_openmp/cvAdvDiff_bnd_omp.c | 2 +- examples/cvode/C_openmpdev/CMakeLists.txt | 2 +- examples/cvode/F2003_parallel/CMakeLists.txt | 4 +- .../F2003_serial/cv_analytic_fp_f2003.f90 | 10 ++--- .../cv_analytic_sys_dns_f2003.f90 | 22 +++++----- .../cv_analytic_sys_dns_jac_f2003.f90 | 32 +++++++------- .../cv_analytic_sys_klu_f2003.f90 | 32 +++++++------- .../F2003_serial/cv_diurnal_kry_bp_f2003.f90 | 2 +- .../F2003_serial/cv_diurnal_kry_f2003.f90 | 2 +- examples/cvode/cuda/CMakeLists.txt | 2 +- examples/cvode/cuda/cvAdvDiff_diag_cuda.cu | 2 +- .../cvRoberts_block_cusolversp_batchqr.cu | 6 +-- examples/cvode/ginkgo/cv_heat2D_ginkgo.cpp | 2 +- examples/cvode/ginkgo/cv_heat2D_ginkgo.hpp | 4 +- examples/cvode/hip/cvAdvDiff_diag_hip.cpp | 2 +- .../cvode/magma/cv_bruss_batched_magma.cpp | 4 +- examples/cvode/parallel/CMakeLists.txt | 2 +- examples/cvode/parallel/cvAdvDiff_diag_p.c | 2 +- examples/cvode/parallel/cvAdvDiff_non_p.c | 2 +- examples/cvode/parallel/cvDiurnal_kry_bbd_p.c | 2 +- examples/cvode/parallel/cvDiurnal_kry_p.c | 2 +- examples/cvode/parhyp/CMakeLists.txt | 2 +- examples/cvode/parhyp/cvAdvDiff_non_ph.c | 2 +- examples/cvode/petsc/cvAdvDiff_petsc.c | 2 +- examples/cvode/raja/CMakeLists.txt | 2 +- examples/cvode/serial/CMakeLists.txt | 2 +- examples/cvode/serial/cvAdvDiff_bnd.c | 2 +- examples/cvode/serial/cvAdvDiff_bndL.c | 2 +- examples/cvode/serial/cvAnalytic_mels.c | 30 ++++++------- examples/cvode/serial/cvAnalytic_mels.out | 2 +- examples/cvode/serial/cvDiurnal_kry.c | 4 +- examples/cvode/serial/cvDiurnal_kry_bp.c | 4 +- examples/cvode/serial/cvKrylovDemo_ls.c | 4 +- examples/cvode/serial/cvKrylovDemo_prec.c | 18 ++++---- examples/cvode/serial/cvParticle_dns.c | 2 +- examples/cvode/serial/cvRoberts_block_klu.c | 2 +- examples/cvode/serial/cvRoberts_dns.c | 2 +- .../cvode/serial/cvRoberts_dns_constraints.c | 2 +- examples/cvode/serial/cvRocket_dns.c | 2 +- examples/cvode/superludist/CMakeLists.txt | 2 +- .../cvode/superludist/cvAdvDiff_sludist.cpp | 2 +- examples/cvodes/C_openmp/CMakeLists.txt | 2 +- examples/cvodes/C_openmp/cvsAdvDiff_bnd_omp.c | 2 +- .../F2003_serial/cvsAdvDiff_FSA_non_f2003.f90 | 2 +- .../F2003_serial/cvs_analytic_fp_f2003.f90 | 10 ++--- examples/cvodes/parallel/CMakeLists.txt | 2 +- examples/cvodes/parallel/README | 2 +- .../cvodes/parallel/cvsAdvDiff_ASAp_non_p.c | 4 +- .../cvodes/parallel/cvsAdvDiff_FSA_non_p.c | 2 +- examples/cvodes/parallel/cvsAdvDiff_non_p.c | 2 +- .../cvodes/parallel/cvsDiurnal_kry_bbd_p.c | 2 +- examples/cvodes/parallel/cvsDiurnal_kry_p.c | 2 +- examples/cvodes/serial/CMakeLists.txt | 2 +- examples/cvodes/serial/README | 2 +- examples/cvodes/serial/cvsAdvDiff_bnd.c | 2 +- examples/cvodes/serial/cvsAdvDiff_bndL.c | 2 +- examples/cvodes/serial/cvsAnalytic_mels.c | 30 ++++++------- examples/cvodes/serial/cvsAnalytic_mels.out | 2 +- examples/cvodes/serial/cvsDiurnal_FSA_kry.c | 2 +- examples/cvodes/serial/cvsDiurnal_kry.c | 4 +- examples/cvodes/serial/cvsDiurnal_kry_bp.c | 4 +- examples/cvodes/serial/cvsFoodWeb_ASAi_kry.c | 10 ++--- examples/cvodes/serial/cvsFoodWeb_ASAp_kry.c | 10 ++--- examples/cvodes/serial/cvsKrylovDemo_ls.c | 2 +- examples/cvodes/serial/cvsKrylovDemo_prec.c | 18 ++++---- examples/cvodes/serial/cvsParticle_dns.c | 2 +- examples/cvodes/serial/cvsRoberts_ASAi_dns.c | 6 +-- .../serial/cvsRoberts_ASAi_dns_constraints.c | 6 +-- examples/cvodes/serial/cvsRoberts_ASAi_klu.c | 6 +-- examples/cvodes/serial/cvsRoberts_ASAi_sps.c | 6 +-- .../cvodes/serial/cvsRoberts_FSA_dns_Switch.c | 8 ++-- examples/cvodes/serial/cvsRoberts_dns.c | 2 +- .../serial/cvsRoberts_dns_constraints.c | 2 +- examples/ida/C_openmp/CMakeLists.txt | 2 +- examples/ida/C_openmp/idaFoodWeb_bnd_omp.c | 2 +- examples/ida/C_openmp/idaFoodWeb_kry_omp.c | 2 +- examples/ida/F2003_parallel/CMakeLists.txt | 4 +- examples/ida/cuda/CMakeLists.txt | 2 +- examples/ida/cuda/idaHeat2D_kry_cuda.cu | 4 +- examples/ida/mpicuda/CMakeLists.txt | 2 +- .../ida/mpicuda/idaHeat2D_kry_p_mpicuda.cu | 4 +- examples/ida/mpiraja/CMakeLists.txt | 2 +- .../ida/mpiraja/idaHeat2D_kry_p_mpiraja.cpp | 4 +- examples/ida/parallel/CMakeLists.txt | 2 +- examples/ida/parallel/idaFoodWeb_kry_bbd_p.c | 2 +- examples/ida/parallel/idaFoodWeb_kry_p.c | 4 +- examples/ida/parallel/idaHeat2D_kry_p.c | 4 +- examples/ida/petsc/idaHeat2D_petsc_snes.c | 4 +- examples/ida/petsc/idaHeat2D_petsc_spgmr.c | 4 +- examples/ida/raja/CMakeLists.txt | 2 +- examples/ida/raja/idaHeat2D_kry_raja.cpp | 4 +- examples/ida/serial/CMakeLists.txt | 2 +- examples/ida/serial/idaFoodWeb_kry.c | 4 +- examples/ida/serial/idaHeat2D_kry.c | 2 +- examples/ida/serial/idaKrylovDemo_ls.c | 2 +- examples/ida/serial/idaRoberts_dns.c | 4 +- examples/ida/trilinos/CMakeLists.txt | 2 +- .../ida/trilinos/idaHeat2D_kry_p_tpetra.cpp | 8 ++-- .../ida/trilinos/idaHeat2D_kry_tpetra.cpp | 8 ++-- examples/idas/C_openmp/CMakeLists.txt | 2 +- examples/idas/C_openmp/idasFoodWeb_bnd_omp.c | 2 +- examples/idas/C_openmp/idasFoodWeb_kry_omp.c | 2 +- examples/idas/parallel/CMakeLists.txt | 2 +- .../idas/parallel/idasBruss_ASAp_kry_bbd_p.c | 2 +- .../idas/parallel/idasBruss_FSA_kry_bbd_p.c | 4 +- examples/idas/parallel/idasBruss_kry_bbd_p.c | 4 +- .../idas/parallel/idasFoodWeb_kry_bbd_p.c | 2 +- examples/idas/parallel/idasFoodWeb_kry_p.c | 4 +- .../idas/parallel/idasHeat2D_FSA_kry_bbd_p.c | 2 +- examples/idas/parallel/idasHeat2D_kry_p.c | 4 +- examples/idas/serial/CMakeLists.txt | 2 +- examples/idas/serial/idasHeat2D_kry.c | 4 +- examples/idas/serial/idasHessian_ASA_FSA.c | 4 +- examples/idas/serial/idasKrylovDemo_ls.c | 2 +- examples/idas/serial/idasRoberts_ASAi_dns.c | 2 +- examples/idas/serial/idasRoberts_ASAi_klu.c | 2 +- examples/idas/serial/idasRoberts_ASAi_sps.c | 2 +- examples/idas/serial/idasRoberts_dns.c | 4 +- examples/kinsol/CUDA_mpi/CMakeLists.txt | 2 +- examples/kinsol/CUDA_mpi/README | 2 +- examples/kinsol/CUDA_mpi/kin_em_mpicuda.cu | 6 +-- examples/kinsol/CUDA_mpi/kin_em_mpicuda.hpp | 4 +- examples/kinsol/CXX_parallel/CMakeLists.txt | 2 +- examples/kinsol/CXX_parallel/README | 2 +- examples/kinsol/CXX_parallel/kin_em_p.cpp | 6 +-- examples/kinsol/CXX_parallel/kin_em_p.hpp | 4 +- .../CXX_parallel/kin_heat2D_nonlin_p.cpp | 6 +-- .../CXX_parallel/kin_heat2D_nonlin_p.hpp | 6 +-- examples/kinsol/CXX_parhyp/CMakeLists.txt | 2 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.cpp | 4 +- .../CXX_parhyp/kin_bratu2D_hypre_pfmg.hpp | 4 +- .../kin_heat2D_nonlin_hypre_pfmg.cpp | 4 +- .../kin_heat2D_nonlin_hypre_pfmg.hpp | 6 +-- examples/kinsol/C_openmp/CMakeLists.txt | 2 +- examples/kinsol/F2003_parallel/CMakeLists.txt | 4 +- examples/kinsol/parallel/CMakeLists.txt | 2 +- examples/kinsol/serial/CMakeLists.txt | 2 +- .../kinsol/serial/kinLaplace_picard_bnd.c | 2 +- .../kinsol/serial/kinLaplace_picard_kry.c | 2 +- examples/kinsol/serial/kinRoboKin_slu.c | 2 +- examples/nvector/C_openmp/CMakeLists.txt | 2 +- examples/nvector/cuda/CMakeLists.txt | 2 +- examples/nvector/hip/CMakeLists.txt | 2 +- examples/nvector/kokkos/CMakeLists.txt | 2 +- .../nvector/kokkos/test_nvector_kokkos.cpp | 2 +- examples/nvector/manyvector/CMakeLists.txt | 2 +- examples/nvector/mpicuda/CMakeLists.txt | 2 +- examples/nvector/mpimanyvector/CMakeLists.txt | 2 +- examples/nvector/mpiplusx/CMakeLists.txt | 2 +- examples/nvector/openmpdev/CMakeLists.txt | 2 +- examples/nvector/parhyp/CMakeLists.txt | 2 +- examples/nvector/petsc/CMakeLists.txt | 2 +- examples/nvector/pthreads/CMakeLists.txt | 2 +- examples/nvector/serial/CMakeLists.txt | 2 +- examples/nvector/sycl/test_nvector_sycl.cpp | 2 +- examples/nvector/test_nvector.c | 4 +- examples/nvector/trilinos/CMakeLists.txt | 2 +- .../trilinos/test_nvector_trilinos.cpp | 2 +- .../test_sunlinsol_cusolversp_batchqr.cu | 2 +- .../test_sunlinsol_onemkldense.cpp | 2 +- .../serial/test_fsunlinsol_pcg_mod_serial.f90 | 2 +- .../test_fsunlinsol_spbcgs_mod_serial.f90 | 2 +- .../test_fsunlinsol_spfgmr_mod_serial.f90 | 2 +- .../test_fsunlinsol_spgmr_mod_serial.f90 | 2 +- .../test_fsunlinsol_sptfqmr_mod_serial.f90 | 2 +- .../test_sunlinsol_superludist.cpp | 6 +-- examples/sunlinsol/test_sunlinsol.h | 2 +- examples/sunmatrix/dreadrb.c | 2 +- .../test_sunmatrix_onemkldense.cpp | 2 +- .../slunrloc/test_sunmatrix_slunrloc.cpp | 8 ++-- examples/sunmatrix/test_sunmatrix.c | 2 +- examples/sunmatrix/test_sunmatrix.f90 | 2 +- examples/sunmatrix/test_sunmatrix.h | 2 +- .../fixedpoint/test_sunnonlinsol_fixedpoint.c | 2 +- .../templates/cmakelists_serial_F2003_ex.in | 4 +- include/arkode/arkode_bandpre.h | 2 +- include/cvode/cvode_bandpre.h | 2 +- include/cvodes/cvodes_bandpre.h | 2 +- include/sundials/priv/sundials_errors_impl.h | 16 +++---- .../sundials/priv/sundials_mpi_errors_impl.h | 8 ++-- include/sundials/sundials_base.hpp | 2 +- include/sundials/sundials_convertibleto.hpp | 2 +- include/sundials/sundials_cuda_policies.hpp | 2 +- include/sundials/sundials_errors.h | 2 +- include/sundials/sundials_hip_policies.hpp | 2 +- include/sundials/sundials_memory.h | 4 +- include/sundials/sundials_nvector.h | 2 +- include/sundials/sundials_sycl_policies.hpp | 2 +- include/sundials/sundials_xbraid.h | 2 +- include/sunlinsol/sunlinsol_ginkgo.hpp | 2 +- include/sunmatrix/sunmatrix_ginkgo.hpp | 2 +- .../sunnonlinsol/sunnonlinsol_fixedpoint.h | 2 +- scripts/spelling.sh | 19 ++++++++ src/arkode/arkode.c | 10 ++--- src/arkode/arkode_bandpre.c | 4 +- src/arkode/arkode_butcher.c | 2 +- src/arkode/arkode_butcher_erk.def | 2 +- src/arkode/arkode_impl.h | 4 +- src/arkode/arkode_io.c | 2 +- src/arkode/arkode_ls.c | 6 +-- src/arkode/arkode_ls_impl.h | 2 +- src/arkode/arkode_mri_tables.c | 2 +- src/arkode/arkode_mristep.c | 2 +- src/arkode/arkode_sprkstep.c | 2 +- src/arkode/xbraid/arkode_xbraid.c | 4 +- src/cvode/cvode.c | 6 +-- src/cvode/cvode_bandpre.c | 4 +- src/cvode/cvode_impl.h | 2 +- src/cvode/cvode_io.c | 4 +- src/cvode/cvode_ls.c | 4 +- src/cvode/cvode_ls_impl.h | 4 +- src/cvode/cvode_proj.c | 6 +-- src/cvodes/cvodea.c | 10 ++--- src/cvodes/cvodes.c | 32 +++++++------- src/cvodes/cvodes_bandpre.c | 4 +- src/cvodes/cvodes_impl.h | 9 ++-- src/cvodes/cvodes_io.c | 6 +-- src/cvodes/cvodes_ls.c | 4 +- src/cvodes/cvodes_ls_impl.h | 4 +- src/cvodes/cvodes_proj.c | 6 +-- src/ida/ida.c | 10 ++--- src/ida/ida_impl.h | 4 +- src/ida/ida_ls.c | 6 +-- src/ida/ida_ls_impl.h | 4 +- src/idas/idaa.c | 14 +++--- src/idas/idas.c | 38 ++++++++-------- src/idas/idas_bbdpre.c | 4 +- src/idas/idas_impl.h | 11 ++--- src/idas/idas_ls.c | 6 +-- src/idas/idas_ls_impl.h | 4 +- src/kinsol/kinsol.c | 8 ++-- src/kinsol/kinsol_ls.c | 6 +-- src/kinsol/kinsol_ls_impl.h | 4 +- src/nvector/openmpdev/nvector_openmpdev.c | 4 +- src/nvector/pthreads/nvector_pthreads.c | 2 +- src/sundials/sundials_logger_impl.h | 2 +- src/sundials/sundials_nvector.c | 4 +- src/sundials/sundials_sycl.h | 4 +- .../magmadense/sunlinsol_magmadense.cpp | 2 +- .../onemkldense/sunlinsol_onemkldense.cpp | 16 +++---- src/sunlinsol/pcg/sunlinsol_pcg.c | 2 +- src/sunlinsol/spbcgs/sunlinsol_spbcgs.c | 4 +- src/sunlinsol/spfgmr/sunlinsol_spfgmr.c | 2 +- src/sunlinsol/spgmr/sunlinsol_spgmr.c | 2 +- src/sunlinsol/sptfqmr/sunlinsol_sptfqmr.c | 2 +- .../superludist/sunlinsol_superludist.c | 4 +- src/sunmatrix/slunrloc/sunmatrix_slunrloc.c | 4 +- src/sunnonlinsol/newton/sunnonlinsol_newton.c | 2 +- swig/nvector/fnvector_pthreads_mod.i | 2 +- test/answers | 2 +- test/config_cmake.py | 8 ++-- test/env/docker.sh | 2 +- test/jenkins/README.md | 2 +- test/testRunner | 6 +-- test/test_driver.sh | 14 +++--- test/test_install.py | 2 +- .../CXX_parallel/ark_test_heat2D_mri.cpp | 4 +- .../CXX_serial/ark_test_analytic_sys_mri.cpp | 8 ++-- .../ark_test_analytic_sys_mri_0.out | 2 +- .../ark_test_analytic_sys_mri_1.out | 2 +- .../arkode/C_serial/ark_test_reset.c | 4 +- 459 files changed, 1129 insertions(+), 1064 deletions(-) create mode 100644 .github/workflows/check-spelling.yml create mode 100755 scripts/spelling.sh diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 0000000000..8825e58b06 --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,44 @@ +name: Checks - spelling + +on: + pull_request: + workflow_dispatch: + +jobs: + spelling_check: + runs-on: ubuntu-latest + steps: + - name: Install python3-pip + run: | + sudo apt update + sudo apt install -y --no-install-recommends python3-pip + + - name: Install codespell + run: pip install codespell + + - name: Print codespell version + run: codespell --version + + - name: Check out repository code + uses: actions/checkout@v4 + with: + submodules: true + + - name: Run codespell + run: | + ./scripts/spelling.sh + + - name: Run git diff to see if anything changed + run: /usr/bin/git diff --name-only --exit-code + + - name: Run git diff if we failed + if: failure() + run: /usr/bin/git diff > spelling.patch + + - name: Archive diff as a patch if we failed + uses: actions/upload-artifact@v3 + if: failure() + with: + name: spelling.patch + path: | + ${{ github.workspace }}/spelling.patch diff --git a/CHANGELOG.md b/CHANGELOG.md index 3291523216..c77cdcbdfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1789,7 +1789,7 @@ update their code to set the corresponding `ops` structure member, `matvecsetup`, to `NULL`. The generic SUNMatrix API now defines error codes to be returned by SUNMatrix -operations. Operations which return an integer flag indiciating success/failure +operations. Operations which return an integer flag indicating success/failure may return different values than previously. A new SUNMatrix (and SUNLinearSolver) implementation was added to facilitate @@ -1901,7 +1901,7 @@ function signatures have been changed including MRIStepCreate which now takes an ARKStep memory structure for the fast integration as an input. The reinitialization functions `ERKStepReInit`, `ARKStepReInit`, and -`MRIStepReInit` have been updated to retain the minimum and maxiumum step +`MRIStepReInit` have been updated to retain the minimum and maximum step size values from before reinitialization rather than resetting them to the default values. @@ -1926,7 +1926,7 @@ being built. Fixed a memory leak in the PETSc `N_Vector` clone function. -Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +Fixed a memory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using the default nonlinear solver. Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in @@ -2638,7 +2638,7 @@ with sparse direct solvers. #### KINSOL -The Picard iteration return was chanegd to always return the newest iterate upon +The Picard iteration return was changed to always return the newest iterate upon success. A minor bug in the line search was fixed to prevent an infinite loop when the diff --git a/CMakeLists.txt b/CMakeLists.txt index 989c1d7f7d..61b164f678 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,7 @@ include(SundialsSetupCompilers) include(SundialsSetupTPLs) # =============================================================== -# Build options to be proccessed last +# Build options to be processed last # =============================================================== include(SundialsBuildOptionsPost) diff --git a/CODEOWNERS b/CODEOWNERS index 8d465ce4e5..e017386f2b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -3,6 +3,6 @@ # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, -# globabl owners will be requested for review when someone +# global owners will be requested for review when someone # opens a pull request. * @balos1 @gardner48 @cswoodward @drreynolds diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4106e3738b..be273c77a2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing to SUNDIALS -There are two primary ways of contributing to SUNDIALS. The first way is by particpating +There are two primary ways of contributing to SUNDIALS. The first way is by participating in the development of SUNDIALS directly through contributions of code to the primary [SUNDIALS repository](https://github.com/LLNL/sundials). This is the best way to contribute bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources diff --git a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp index 7bbf8743a7..78fafd71ad 100644 --- a/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/ParallelGrid.hpp @@ -72,7 +72,7 @@ class ParallelGrid public: // Constructor that creates a new ParallelGrid object. // [in] - the memory helper to use for allocating the MPI buffers - // [in,out] comm - on input, the overal MPI communicator, on output, the cartesian communicator + // [in,out] comm - on input, the overall MPI communicator, on output, the cartesian communicator // [in] a[] - an array of length 3 which defines the domain [a,b] // [in] b[] - an array of length 3 which defines the domain [a,b] // [in] npts[] - an array of length 3 which defines the number of mesh points in each dimension @@ -563,7 +563,7 @@ class ParallelGrid GLOBALINT nx, ny, nz; /* number of intervals globally */ int nxl, nyl, nzl; /* number of intervals locally */ - int npx, npy, npz; /* numner of processes */ + int npx, npy, npz; /* number of processes */ sunrealtype dx, dy, dz; /* mesh spacing */ sunrealtype ax, ay, az; /* domain in [a, b] */ sunrealtype bx, by, bz; diff --git a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp index 2001c2736a..4f606bd7bf 100644 --- a/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/kokkos/arkode_driver.cpp @@ -33,7 +33,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) diff --git a/benchmarks/advection_reaction_3D/kokkos/check_retval.h b/benchmarks/advection_reaction_3D/kokkos/check_retval.h index b72575c517..a64f816976 100644 --- a/benchmarks/advection_reaction_3D/kokkos/check_retval.h +++ b/benchmarks/advection_reaction_3D/kokkos/check_retval.h @@ -23,7 +23,7 @@ * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ static int check_retval(void* returnvalue, const char* funcname, int opt, int myid) { diff --git a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp index 0dee917835..ea714ecaeb 100644 --- a/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp +++ b/benchmarks/advection_reaction_3D/kokkos/rhs3D.hpp @@ -23,7 +23,7 @@ * --------------------------------------------------------------*/ /* Compute the advection term f(t,y) = -c (grad * y). This is done using - upwind 1st order finite differences. At present, only periodic boudary + upwind 1st order finite differences. At present, only periodic boundary conditions are supported, which are handled via MPI's Cartesian communicator (even for serial runs). */ static int Advection(sunrealtype t, N_Vector y, N_Vector ydot, void* user_data) diff --git a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp index e818194047..f234aa089a 100644 --- a/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp +++ b/benchmarks/advection_reaction_3D/raja/ParallelGrid.hpp @@ -45,7 +45,7 @@ class ParallelGrid public: // Constructor that creates a new ParallelGrid object. // [in] - the memory helper to use for allocating the MPI buffers - // [in,out] comm - on input, the overal MPI communicator, on output, the cartesian communicator + // [in,out] comm - on input, the overall MPI communicator, on output, the cartesian communicator // [in] a[] - an array of length 3 which defines the domain [a,b] // [in] b[] - an array of length 3 which defines the domain [a,b] // [in] npts[] - an array of length 3 which defines the number of mesh points in each dimension @@ -508,7 +508,7 @@ class ParallelGrid GLOBALINT nx, ny, nz; /* number of intervals globally */ int nxl, nyl, nzl; /* number of intervals locally */ - int npx, npy, npz; /* numner of processes */ + int npx, npy, npz; /* number of processes */ REAL dx, dy, dz; /* mesh spacing */ REAL ax, ay, az; /* domain in [a, b] */ REAL bx, by, bz; diff --git a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp index 8499be6f0b..2caa282af9 100644 --- a/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp +++ b/benchmarks/advection_reaction_3D/raja/advection_reaction_3D.hpp @@ -89,7 +89,7 @@ struct UserData N_Vector vmask; N_Vector wmask; - /* problem paramaters */ + /* problem parameters */ sunrealtype xmax; /* maximum x value */ sunrealtype A; /* concentration of species A */ sunrealtype B; /* w source rate */ diff --git a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp index 49dcc6d8cf..420c9d63c9 100644 --- a/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp +++ b/benchmarks/advection_reaction_3D/raja/arkode_driver.cpp @@ -33,7 +33,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) diff --git a/benchmarks/advection_reaction_3D/raja/check_retval.h b/benchmarks/advection_reaction_3D/raja/check_retval.h index b72575c517..a64f816976 100644 --- a/benchmarks/advection_reaction_3D/raja/check_retval.h +++ b/benchmarks/advection_reaction_3D/raja/check_retval.h @@ -23,7 +23,7 @@ * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ static int check_retval(void* returnvalue, const char* funcname, int opt, int myid) { diff --git a/benchmarks/diffusion_2D/diffusion_2D.cpp b/benchmarks/diffusion_2D/diffusion_2D.cpp index bd18cf1dfb..2a64400938 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.cpp +++ b/benchmarks/diffusion_2D/diffusion_2D.cpp @@ -11,7 +11,7 @@ * SPDX-License-Identifier: BSD-3-Clause * SUNDIALS Copyright End * ----------------------------------------------------------------------------- - * Shared implementaiton file for 2D diffusion benchmark problem + * Shared implementation file for 2D diffusion benchmark problem * ---------------------------------------------------------------------------*/ #include "diffusion_2D.hpp" diff --git a/benchmarks/diffusion_2D/diffusion_2D.hpp b/benchmarks/diffusion_2D/diffusion_2D.hpp index 1ebb3394aa..a27c004e63 100644 --- a/benchmarks/diffusion_2D/diffusion_2D.hpp +++ b/benchmarks/diffusion_2D/diffusion_2D.hpp @@ -159,7 +159,7 @@ struct UserData sunrealtype* Ssend = NULL; sunrealtype* Nsend = NULL; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -192,7 +192,7 @@ struct UserData struct UserOutput { - // Ouput variables + // Output variables int output = 1; // 0 = no output, 1 = stats output, 2 = output to disk int nout = 20; // number of output times N_Vector error = NULL; // error vector diff --git a/benchmarks/diffusion_2D/main_arkode.cpp b/benchmarks/diffusion_2D/main_arkode.cpp index c35bf9e9c7..39c6274a6e 100644 --- a/benchmarks/diffusion_2D/main_arkode.cpp +++ b/benchmarks/diffusion_2D/main_arkode.cpp @@ -329,7 +329,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -524,7 +524,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol : relative tolerance" << endl; - cout << " --atol : absoltue tolerance" << endl; + cout << " --atol : absolute tolerance" << endl; cout << " --nonlinear : disable linearly implicit flag" << endl; cout << " --order : method order" << endl; cout << " --fixedstep : used fixed step size" << endl; diff --git a/benchmarks/diffusion_2D/main_cvode.cpp b/benchmarks/diffusion_2D/main_cvode.cpp index 71172e4ce9..47420cdc98 100644 --- a/benchmarks/diffusion_2D/main_cvode.cpp +++ b/benchmarks/diffusion_2D/main_cvode.cpp @@ -310,7 +310,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -479,7 +479,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol : relative tolerance" << endl; - cout << " --atol : absoltue tolerance" << endl; + cout << " --atol : absolute tolerance" << endl; cout << " --ls : linear solver" << endl; cout << " --lsinfo : output residual history" << endl; cout << " --liniters : max number of iterations" << endl; diff --git a/benchmarks/diffusion_2D/main_ida.cpp b/benchmarks/diffusion_2D/main_ida.cpp index 515256ddd9..ccd86c7ad5 100644 --- a/benchmarks/diffusion_2D/main_ida.cpp +++ b/benchmarks/diffusion_2D/main_ida.cpp @@ -305,7 +305,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / uout.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = uout.open(&udata); if (check_flag(&flag, "UserOutput::open", 1)) { return 1; } @@ -460,7 +460,7 @@ void UserOptions::help() cout << endl; cout << "Integrator command line options:" << endl; cout << " --rtol : relative tolerance" << endl; - cout << " --atol : absoltue tolerance" << endl; + cout << " --atol : absolute tolerance" << endl; cout << " --ls : linear solver" << endl; cout << " --liniters : max number of iterations" << endl; cout << " --epslin : linear tolerance factor" << endl; diff --git a/benchmarks/nvector/plot_nvector_performance_results.py b/benchmarks/nvector/plot_nvector_performance_results.py index 55bb5ae32e..c5e9f69301 100755 --- a/benchmarks/nvector/plot_nvector_performance_results.py +++ b/benchmarks/nvector/plot_nvector_performance_results.py @@ -15,7 +15,7 @@ # This script plots the output from test_nector_performance_* and assumes: # 1. vector lengths are powers of two starting from 0, and # 2. output files are named: output_nelem_nvec_nsum_ntest_timing.txt -# where nelem is the number of elements in the vector, nvec is the nuber of +# where nelem is the number of elements in the vector, nvec is the number of # vectors, nsum is the number of sums, ntest is the number of tests, and timing # indicates if timing was enabled. # ----------------------------------------------------------------------------- diff --git a/benchmarks/nvector/plot_nvector_performance_speedup.py b/benchmarks/nvector/plot_nvector_performance_speedup.py index 623d716c01..baaaf43682 100755 --- a/benchmarks/nvector/plot_nvector_performance_speedup.py +++ b/benchmarks/nvector/plot_nvector_performance_speedup.py @@ -15,7 +15,7 @@ # This script plots the output from test_nector_performance_* and assumes: # 1. vector lengths are powers of two starting from 0, and # 2. output files are named: output_nelem_nvec_nsum_ntest_timing.txt -# where nelem is the number of elements in the vector, nvec is the nuber of +# where nelem is the number of elements in the vector, nvec is the number of # vectors, nsum is the number of sums, ntest is the number of tests, and timing # indicates if timing was enabled. # ----------------------------------------------------------------------------- diff --git a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp index 0691d036e4..52b12e966f 100644 --- a/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp +++ b/benchmarks/nvector/sycl/test_nvector_performance_sycl.cpp @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) ? "Yes" : "No") << std::endl; - std::cout << " suports usm shared allocations? " + std::cout << " supports usm shared allocations? " << (dev.get_info<::sycl::info::device::usm_shared_allocations>() ? "Yes" : "No") diff --git a/benchmarks/nvector/test_nvector_performance.h b/benchmarks/nvector/test_nvector_performance.h index 23af102a8e..74528b749d 100644 --- a/benchmarks/nvector/test_nvector_performance.h +++ b/benchmarks/nvector/test_nvector_performance.h @@ -17,7 +17,7 @@ #include -/* define constatnts */ +/* define constants */ #define NEG_ONE SUN_RCONST(-1.0) #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) diff --git a/cmake/SundialsBuildOptionsPost.cmake b/cmake/SundialsBuildOptionsPost.cmake index 2bf6acd14f..e914eefd1f 100644 --- a/cmake/SundialsBuildOptionsPost.cmake +++ b/cmake/SundialsBuildOptionsPost.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# SUNDIALS build options that are interepreted after all other +# SUNDIALS build options that are interpreted after all other # CMake configuration. # --------------------------------------------------------------- diff --git a/cmake/SundialsBuildOptionsPre.cmake b/cmake/SundialsBuildOptionsPre.cmake index 048137ff2d..96e17ea087 100644 --- a/cmake/SundialsBuildOptionsPre.cmake +++ b/cmake/SundialsBuildOptionsPre.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# SUNDIALS build options that are interepreted prior to any +# SUNDIALS build options that are interpreted prior to any # other CMake configuration. # --------------------------------------------------------------- diff --git a/cmake/SundialsSetupCXX.cmake b/cmake/SundialsSetupCXX.cmake index f4967f16cc..187e597d40 100644 --- a/cmake/SundialsSetupCXX.cmake +++ b/cmake/SundialsSetupCXX.cmake @@ -41,7 +41,7 @@ set(DOCSTR "Enable C++ compiler specific extensions") sundials_option(CMAKE_CXX_EXTENSIONS BOOL "${DOCSTR}" ON) message(STATUS "C++ extensions set to ${CMAKE_CXX_EXTENSIONS}") -# SYCL requries C++17 +# SYCL requires C++17 if(ENABLE_SYCL AND (CMAKE_CXX_STANDARD LESS "17")) message(SEND_ERROR "CMAKE_CXX_STANDARD must be >= 17 because ENABLE_SYCL=ON") endif() diff --git a/cmake/SundialsSetupCompilers.cmake b/cmake/SundialsSetupCompilers.cmake index 797c743a3f..aad26bdaf7 100644 --- a/cmake/SundialsSetupCompilers.cmake +++ b/cmake/SundialsSetupCompilers.cmake @@ -21,12 +21,12 @@ include(SundialsIndexSize) # =============================================================== -# Platform specifc settings +# Platform specific settings # =============================================================== if(WIN32) # Under Windows, add compiler directive to inhibit warnings about use of - # unsecure functions. + # insecure functions. add_compile_definitions(_CRT_SECURE_NO_WARNINGS) # Under Windows, we need to have dll and exe files in the same directory to diff --git a/cmake/SundialsSetupCuda.cmake b/cmake/SundialsSetupCuda.cmake index 8a0703336b..ef01d0faba 100644 --- a/cmake/SundialsSetupCuda.cmake +++ b/cmake/SundialsSetupCuda.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # --------------------------------------------------------------- -# Setup the CUDA languge and CUDA libraries. +# Setup the CUDA language and CUDA libraries. # --------------------------------------------------------------- # =============================================================== diff --git a/cmake/tpl/FindMAGMA.cmake b/cmake/tpl/FindMAGMA.cmake index 0d71560b72..f28780129f 100644 --- a/cmake/tpl/FindMAGMA.cmake +++ b/cmake/tpl/FindMAGMA.cmake @@ -97,7 +97,7 @@ if(MAGMA_LIBRARY AND MAGMA_INCLUDE_DIR) # Check if we need to find cusparse or cublas if(SUNDIALS_MAGMA_BACKENDS MATCHES "CUDA") # Replace cublas, cusparse with the CMake targets because the library - # path in the magma pkgconfig is not reliable. Sepcifically, the path + # path in the magma pkgconfig is not reliable. Specifically, the path # is wrong on systems like Perlmutter where the NVIDIA HPC SDK is # used. if(lib STREQUAL "-lcublas") diff --git a/cmake/tpl/SundialsHypre.cmake b/cmake/tpl/SundialsHypre.cmake index 9d880d2562..12d7b550b1 100644 --- a/cmake/tpl/SundialsHypre.cmake +++ b/cmake/tpl/SundialsHypre.cmake @@ -37,12 +37,12 @@ endif() # ----------------------------------------------------------------------------- if(ENABLE_HYPRE) - # Using hypre requres building with MPI enabled + # Using hypre requires building with MPI enabled if(NOT ENABLE_MPI) message( FATAL_ERROR "MPI is required for hypre support. Set ENABLE_MPI to ON.") endif() - # Using hypre requres C99 or newer + # Using hypre requires C99 or newer if(CMAKE_C_STANDARD STREQUAL "90") message(SEND_ERROR "CMAKE_C_STANDARD must be >= c99 with ENABLE_HYPRE=ON") endif() diff --git a/cmake/tpl/SundialsLapack.cmake b/cmake/tpl/SundialsLapack.cmake index 74261bb469..ecc3e4475b 100644 --- a/cmake/tpl/SundialsLapack.cmake +++ b/cmake/tpl/SundialsLapack.cmake @@ -11,7 +11,7 @@ # SPDX-License-Identifier: BSD-3-Clause # SUNDIALS Copyright End # ----------------------------------------------------------------------------- -# Module to find and setup LAPACK/BLAS corrrectly. +# Module to find and setup LAPACK/BLAS correctly. # Created from the SundialsTPL.cmake template. # All SUNDIALS modules that find and setup a TPL must: # @@ -160,8 +160,8 @@ if(NEED_FORTRAN_NAME_MANGLING) list(LENGTH options imax) set(iopt 0) - # We will attempt to sucessfully generate the "ctest1" executable as long as - # there still are entries in the "options" list + # We will attempt to successfully generate the "ctest1" executable as long + # as there still are entries in the "options" list while(${iopt} LESS ${imax}) # Get the current list entry (current scheme) list(GET options ${iopt} opt) diff --git a/doc/arkode/examples/source/c_serial.rst b/doc/arkode/examples/source/c_serial.rst index 4a9fce62cf..81d8b6b248 100644 --- a/doc/arkode/examples/source/c_serial.rst +++ b/doc/arkode/examples/source/c_serial.rst @@ -326,7 +326,7 @@ The problem implements the following testing scenario: :math:`u_0=1.2`, Numerical method ---------------- -This program solves the problem with the default thrid order method. +This program solves the problem with the default third order method. The problem is run using a fixed slow step size :math:`hs=0.025` and fast step size :math:`0.001`. @@ -854,7 +854,7 @@ is the product of two matrices: only a subset of the :math:`3\times3` blocks). Four different runs are made for this problem. The product -preconditoner is applied on the left and on the right. In each case, +preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt orthogonalization options are tested. In the series of runs, ``ARKodeInit``, ``SUNSPGMR``, ``ARKSpilsSetLinearSolver``, ``SUNSPGMRSetGSType``, diff --git a/doc/arkode/examples/source/conf.py b/doc/arkode/examples/source/conf.py index 826730c1f7..703861d658 100644 --- a/doc/arkode/examples/source/conf.py +++ b/doc/arkode/examples/source/conf.py @@ -442,7 +442,7 @@ texinfo_documents = [ ('index', 'ARKODE_example', u'ARKODE Example Documentation', u'Daniel R. Reynolds', 'ARKODE_example', - 'Example programs for the ARKODE time integration package for multi-rate systems of ordinary differntial equations.', + 'Example programs for the ARKODE time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/arkode/guide/source/Mathematics.rst b/doc/arkode/guide/source/Mathematics.rst index ddbd7c4122..9d9835c53d 100644 --- a/doc/arkode/guide/source/Mathematics.rst +++ b/doc/arkode/guide/source/Mathematics.rst @@ -548,7 +548,7 @@ can be ignored). Optionally, a different algorithm leveraging compensated summation can be used that is more robust to roundoff error at the expense of 2 extra vector operations per stage and an additional 5 per time step. It also requires one extra vector to -be stored. However, it is signficantly more robust to roundoff error accumulation +be stored. However, it is significantly more robust to roundoff error accumulation :cite:p:`Sof:02`. When compensated summation is enabled, the following incremental form is used to compute a time step: diff --git a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst index a6c07ac5e6..5a21f7ea15 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/User_callable.rst @@ -841,7 +841,7 @@ Optional inputs for ARKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ARKStepSetStopTime`). A stop time not reached before a call to :c:func:`ARKStepReInit` or @@ -886,7 +886,7 @@ Optional inputs for ARKStep * *ARK_MEM_NULL* if the ARKStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ARKStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst index 665610283a..8245f0efc9 100644 --- a/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst +++ b/doc/arkode/guide/source/Usage/ARKStep/XBraid.rst @@ -79,9 +79,9 @@ operations (e.g., computing vector sums or norms) as well as functions to initialize the problem state, access the current solution, and take a time step. The ARKBraid interface, built on the SUNBraidApp and SUNBraidVector structures, -provides all the functionaly needed combine ARKODE and XBraid for +provides all the functionality needed combine ARKODE and XBraid for parallel-in-time integration. As such, only a minimal number of changes are -necessary to update an exsting code that uses ARKODE to also use XBraid. +necessary to update an existing code that uses ARKODE to also use XBraid. @@ -123,7 +123,7 @@ Here, the SUNBraidOps structure is defined as typedef struct _SUNBraidOps *SUNBraidOps; The generic SUNBraidApp defines and implements the generic operations acting on -a SUNBraidApp obejct. These generic functions are nothing but wrappers to access +a SUNBraidApp object. These generic functions are nothing but wrappers to access the specific implementation through the object's operations structure. To illustrate this point we show below the implementation of the :c:func:`SUNBraidApp_GetVecTmpl()` function: @@ -876,7 +876,7 @@ A skeleton of the user's main program with XBraid In addition to the header files required for the integration of the ODE problem (see the section :numref:`ARKODE.Usage.Headers`), to use the ARKBraid -interace, the user's program must include the header file +interface, the user's program must include the header file ``arkode/arkode_xbraid.h`` which declares the needed function prototypes. The following is a skeleton of the user's main program (or calling program) for @@ -965,7 +965,7 @@ Advanced ARKBraid Utility Functions This section describes utility functions utilized in the ARKODE + XBraid interfacing. These functions are used internally by the above ARKBraid interface functions but are exposed to the user to assist in advanced usage of -ARKODE and XBraid that requries defining a custom SUNBraidApp implementation. +ARKODE and XBraid that requires defining a custom SUNBraidApp implementation. diff --git a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst index 017aa17110..5bbb3e1f63 100644 --- a/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/ERKStep/User_callable.rst @@ -625,7 +625,7 @@ Optional inputs for ERKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ERKStepSetStopTime`). A stop time not reached before a call to :c:func:`ERKStepReInit` or @@ -672,7 +672,7 @@ Optional inputs for ERKStep * *ARK_MEM_NULL* if the ERKStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ERKStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst index 88fb32a748..53d5a8c7d5 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/MRIStepCoupling.rst @@ -24,7 +24,7 @@ supply a custom set of slow-to-fast time scale coupling coefficients by constructing a coupling table and attaching it with :c:func:`MRIStepSetCoupling`. The MRI coupling tables are stored in an :c:func:`MRIStepCoupling` object which is a pointer to a -:c:struct:`MRIStepCouplingMem` strucutre: +:c:struct:`MRIStepCouplingMem` structure: .. c:type:: MRIStepCouplingMem *MRIStepCoupling diff --git a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst index 95f13fb608..24e8497c04 100644 --- a/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/MRIStep/User_callable.rst @@ -303,7 +303,7 @@ Rootfinding initialization function *nrtfn = 0*. Rootfinding is only supported for the slow (outer) integrator and should not - be actived for the fast (inner) integrator. + be activated for the fast (inner) integrator. .. deprecated:: 6.1.0 @@ -676,7 +676,7 @@ Optional inputs for MRIStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`MRIStepSetStopTime`). A stop time not reached before a call to :c:func:`MRIStepReInit` or @@ -723,7 +723,7 @@ Optional inputs for MRIStep * *ARK_MEM_NULL* if the MRIStep memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`MRIStepSetStopTime`. .. versionadded:: 5.5.1 diff --git a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst index d8f4dec8f9..14d45133d1 100644 --- a/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst +++ b/doc/arkode/guide/source/Usage/SPRKStep/User_callable.rst @@ -336,7 +336,7 @@ Optional inputs for SPRKStep The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`SPRKStepSetStopTime`). A stop time not reached before a call to :c:func:`SPRKStepReInit` or @@ -359,7 +359,7 @@ Optional inputs for SPRKStep Disables the stop time set with :c:func:`SPRKStepSetStopTime`. - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`SPRKStepSetStopTime`. :param arkode_mem: pointer to the SPRKStep memory block. @@ -486,7 +486,7 @@ Optional inputs for IVP method selection This increases the computational cost by 2 extra vector operations per stage and an additional 5 per time step. It also requires one extra vector to be - stored. However, it is signficantly more robust to roundoff error + stored. However, it is significantly more robust to roundoff error accumulation. :param arkode_mem: pointer to the SPRKStep memory block. diff --git a/doc/arkode/guide/source/Usage/User_callable.rst b/doc/arkode/guide/source/Usage/User_callable.rst index fd9261eaa3..fd9b572382 100644 --- a/doc/arkode/guide/source/Usage/User_callable.rst +++ b/doc/arkode/guide/source/Usage/User_callable.rst @@ -1235,7 +1235,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr The default is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for - ``tstop`` is disabled (and can be reenabled only though a new call to + ``tstop`` is disabled (and can be re-enabled only though a new call to :c:func:`ARKodeSetStopTime`). A stop time not reached before a call to ``*StepReInit`` or @@ -1271,7 +1271,7 @@ Set max number of constraint failures :c:func:`ARKodeSetMaxNumConstr .. note:: - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`ARKodeSetStopTime`. .. versionadded:: 6.1.0 diff --git a/doc/arkode/guide/source/conf.py b/doc/arkode/guide/source/conf.py index a0817d416f..2975c7bd36 100644 --- a/doc/arkode/guide/source/conf.py +++ b/doc/arkode/guide/source/conf.py @@ -290,7 +290,7 @@ texinfo_documents = [ ('index', 'ARKODE', u'ARKODE Documentation', u'Daniel R. Reynolds, David J. Gardner, Carol S. Woodward, Rujeko Chinomona, and Cody J. Balos', 'ARKODE', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst index ea807ed00c..ab90aae357 100644 --- a/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunlinsol/ARKODE_interface.rst @@ -184,7 +184,7 @@ In certain instances, users may wish to provide a custom SUNLinSol implementation to ARKODE in order to leverage the structure of a problem. While the "standard" API for these routines is typically sufficient for most users, others may need additional ARKODE-specific information on top of what is -provided. For these purposes, we note the following advanced ouptut functions +provided. For these purposes, we note the following advanced output functions available in ARKStep and MRIStep: diff --git a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst index 92046f510c..5d0f0b02f3 100644 --- a/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst +++ b/doc/arkode/guide/source/sunnonlinsol/ARKODE_interface.rst @@ -141,7 +141,7 @@ of user-supplied SUNNonlinSol modules are as follows. This is only compatible with time-stepping modules that support implicit algebraic solvers. - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -150,7 +150,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`ARKodeGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKODE (through @@ -259,7 +259,7 @@ of user-supplied SUNNonlinSol modules are as follows. .. note:: - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -268,7 +268,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`ARKStepGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by ARKStep (through @@ -362,7 +362,7 @@ of user-supplied SUNNonlinSol modules are as follows. .. note:: - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn()`) or who need access to nonlinear system data to compute the nonlinear system function as part of @@ -371,7 +371,7 @@ of user-supplied SUNNonlinSol modules are as follows. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`MRIStepGetNonlinearSystemData()` **inside** the nonlinear system - function to access the requisite data for evaluting the nonlinear systen + function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by MRIStep (through diff --git a/doc/cvode/cv_ex_cuda.tex b/doc/cvode/cv_ex_cuda.tex index 26578e73d2..c6a0e0645a 100644 --- a/doc/cvode/cv_ex_cuda.tex +++ b/doc/cvode/cv_ex_cuda.tex @@ -28,7 +28,7 @@ \subsection{An unpreconditioned Krylov example: cvAdvDiff\_kry\_cuda}\label{ss:c model at the device. In the example, model right hand side and Jacobian-vector product are implemented as {\cuda} kernels \id{fKernel} and \id{jtvKernel}, respectively. User provided {\CC} functions \id{f} and \id{jtv}, which are called -directly by {\cvode}, set thread partitioning and launch thier respective +directly by {\cvode}, set thread partitioning and launch their respective {\cuda} kernels. Vector data on the device is accessed using \id{N\_VGetDeviceArrayPointer\_Cuda} function. diff --git a/doc/cvode/cv_ex_intro.tex b/doc/cvode/cv_ex_intro.tex index e761486efd..efd01e2b72 100644 --- a/doc/cvode/cv_ex_intro.tex +++ b/doc/cvode/cv_ex_intro.tex @@ -121,7 +121,7 @@ \section{Introduction}\label{s:ex_intro} interaction terms only, using block-grouping. \newline Four different runs are made for this problem. - The product preconditoner is applied on the left and on the right. + The product preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt options are tested. \item \id{cvHeat2D\_klu} solves a discretized 2D heat equation using diff --git a/doc/cvode/cv_ex_parallel.tex b/doc/cvode/cv_ex_parallel.tex index 146df50eba..d2a5102456 100644 --- a/doc/cvode/cv_ex_parallel.tex +++ b/doc/cvode/cv_ex_parallel.tex @@ -149,7 +149,7 @@ \subsection{A user preconditioner example: cvDiurnal\_kry\_p}\label{ss:cvDiurnal iteration and {\spgmr}. The left preconditioner is the block-diagonal part of the Newton matrix, with $2 \times 2$ blocks, and the corresponding diagonal blocks of the Jacobian are saved each time the -preconditioner is generated, for re-use later under certain conditions. +preconditioner is generated, for reuse later under certain conditions. The organization of the \id{cvDiurnal\_kry\_p} program deserves some comments. The right-hand side routine \id{f} calls two other routines: \id{ucomm}, which diff --git a/doc/cvode/cv_ex_serial.tex b/doc/cvode/cv_ex_serial.tex index 35d62d5f79..4e48db6c25 100644 --- a/doc/cvode/cv_ex_serial.tex +++ b/doc/cvode/cv_ex_serial.tex @@ -79,7 +79,7 @@ \subsection{A dense example: cvRoberts\_dns}\label{ss:cvRoberts} \id{SUNLinearSolver}. The next several lines allocate memory for the \id{y} and \id{abstol} vectors using \id{N\_VNew\_Serial} with a length argument of \id{NEQ} ($= 3$). The -lines following that load the initial values of the dependendent +lines following that load the initial values of the dependent variable vector into \id{y} and the absolute tolerances into \id{abstol} using the \id{Ith} macro. @@ -492,14 +492,14 @@ \subsection{A Krylov example: cvDiurnal\_kry}\label{ss:cvDiurnal} to allocate space for $J_{bd}$, $P$, and the pivot arrays; \id{InitUserData} to load problem constants in the \id{data} block; \id{FreeUserData} to free that block; \id{SetInitialProfiles} to load the initial values in \id{y}; -\id{PrintOutput} to retreive and print selected solution values and +\id{PrintOutput} to retrieve and print selected solution values and statistics; \id{PrintFinalStats} to print statistics; and \id{check\_flag} to check return values for error conditions. The output generated by \id{cvDiurnal\_kry.c} is shown below. Note that the number of preconditioner evaluations, \id{npe}, is much smaller than the number of preconditioner setups, \id{nsetups}, as a result of the -Jacobian re-use scheme. +Jacobian reuse scheme. %% \includeOutput{cvDiurnal\_dns}{../../examples/cvode/serial/cvDiurnal_kry.out} diff --git a/doc/cvode/cv_ex_tests.tex b/doc/cvode/cv_ex_tests.tex index 8b747c2ff9..177da0e766 100644 --- a/doc/cvode/cv_ex_tests.tex +++ b/doc/cvode/cv_ex_tests.tex @@ -94,7 +94,7 @@ \section{Parallel tests}\label{s:ex_tests} grows. This means that the highly portable MPI version of {\cvode}, with an appropriate choice of MPI implementation, is fully competitive with the Cray-specific version using the SHMEM library. While the overall costs do -not prepresent a well-scaled parallel algorithm (because of the +not represent a well-scaled parallel algorithm (because of the preconditioner choice), the cost per function evaluation is quite flat for EPCC and SHMEM, at .033 to .037 (for MPICH it ranges from .044 to .068). diff --git a/doc/cvode/guide/source/Constants.rst b/doc/cvode/guide/source/Constants.rst index bf2a8a40d5..ebb0971921 100644 --- a/doc/cvode/guide/source/Constants.rst +++ b/doc/cvode/guide/source/Constants.rst @@ -84,7 +84,7 @@ the CVODE output constants. +----------------------------+-----+----------------------------------------------------------------------------------------+ | ``CV_FIRST_RHSFUNC_ERR`` | -9 | The right-hand side function failed at the first call. | +----------------------------+-----+----------------------------------------------------------------------------------------+ - | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repetead recoverable errors. | + | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repeated recoverable errors. | +----------------------------+-----+----------------------------------------------------------------------------------------+ | ``CV_UNREC_RHSFUNC_ERR`` | -11 | The right-hand side function had a recoverable error, but no recovery is possible. | +----------------------------+-----+----------------------------------------------------------------------------------------+ diff --git a/doc/cvode/guide/source/Introduction.rst b/doc/cvode/guide/source/Introduction.rst index 651efba809..ba5bd22a84 100644 --- a/doc/cvode/guide/source/Introduction.rst +++ b/doc/cvode/guide/source/Introduction.rst @@ -47,7 +47,7 @@ and VODPK have been combined in the C-language package CVODE :cite:p:`CoHi:96`. At present, CVODE may utilize a variety of Krylov methods provided -in SUNDIALS that can be used in conjuction with Newton iteration: +in SUNDIALS that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate diff --git a/doc/cvode/guide/source/Usage/index.rst b/doc/cvode/guide/source/Usage/index.rst index 722e20533e..3c56d48587 100644 --- a/doc/cvode/guide/source/Usage/index.rst +++ b/doc/cvode/guide/source/Usage/index.rst @@ -440,7 +440,7 @@ makes no sense (and is overly costly) after ``y[i]`` is below some noise level. ``abstol`` (if scalar) or ``abstol[i]`` (if a vector) needs to be set to that noise level. If the different components have different noise levels, then ``abstol`` should be a vector. See the example ``cvsRoberts_dns`` in the CVODE package, and the discussion of it in the CVODE Examples document -:cite:p:`cvodes_ex`. In that problem, the three components vary betwen 0 and 1, +:cite:p:`cvodes_ex`. In that problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as to what those @@ -764,7 +764,7 @@ rootfinding. In the ``CV_ONE_STEP`` mode, ``tout`` is used only on the first call, and only to get the direction and a rough scale of the independent variable. - If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). All failure return values are negative and so the test ``flag < 0`` will trap all ``CVode`` failures. @@ -909,7 +909,7 @@ Main solver optional input functions **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``nst`` -- number of successful steps inbetween calls to the monitor function 0 by default; a 0 input will turn off monitoring. + * ``nst`` -- number of successful steps in between calls to the monitor function 0 by default; a 0 input will turn off monitoring. **Return value:** * ``CV_SUCCESS`` -- The optional value has been successfully set. @@ -1051,7 +1051,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. - Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. @@ -1084,7 +1084,7 @@ Main solver optional input functions * ``CV_MEM_NULL`` if the CVODE memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`CVodeSetStopTime`. .. versionadded:: 6.5.1 @@ -2627,7 +2627,7 @@ described next. The values returned in ``ele`` are valid only if :c:func:`CVode` returned a non-negative value. - The ``ele`` vector, togther with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. @@ -3145,7 +3145,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** - * ``CVDIAG_SUCCESS`` -- The optional output valus have been successfully set. + * ``CVDIAG_SUCCESS`` -- The optional output values have been successfully set. * ``CVDIAG_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. @@ -3232,7 +3232,7 @@ known, simply make that location a value of tout. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the RHS function *not* incorporate the discontinuity, but rather have a smooth -extention over the discontinuity, so that the step across it (and +extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the RHS function (communicated through ``user_data``) that can be flipped between the stopping of the integration and the restart, so that @@ -3383,7 +3383,7 @@ These weights will be used in place of those defined by Eq. .. warning:: - The error weight vector must have all components positive. It is the user's responsiblity to perform this test and return -1 if it is not satisfied. + The error weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it is not satisfied. .. _CVODE.Usage.CC.user_fct_sim.rootFn: @@ -3406,7 +3406,7 @@ follows: * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. **Return value:** - A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occured (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. + A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occurred (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. **Notes:** Allocation of memory for ``gout`` is automatically handled within CVODE. @@ -3429,7 +3429,7 @@ user-defined projection operation the projection function must have type * ``t`` -- the current value of the independent variable. * ``ycur`` -- the current value of the dependent variable vector :math:`y(t)`. * ``corr`` -- the correction, :math:`c`, to the dependent variable vector so that :math:`y(t) + c` satisfies the constraint equation. - * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrainted least squares problem. + * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrained least squares problem. * ``err`` -- is on input the current error estimate, if error projection is enabled (the default) then this should be overwritten with the projected error on output. If error projection is disabled then ``err`` is ``NULL``. * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. @@ -3934,7 +3934,7 @@ the CVBANDPRE module: **Arguments:** * ``cvode_mem`` -- pointer to the CVODE memory block. - * ``lenrwBP`` -- the number of ``sunrealtype`` values in teh CVBANDPRE workspace. + * ``lenrwBP`` -- the number of ``sunrealtype`` values in the CVBANDPRE workspace. * ``leniwBP`` -- the number of integer values in the CVBANDPRE workspace. **Return value:** diff --git a/doc/cvode/guide/source/conf.py b/doc/cvode/guide/source/conf.py index 3d86ad65cb..4377102f1e 100644 --- a/doc/cvode/guide/source/conf.py +++ b/doc/cvode/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'CVODE', u'CVODE Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'CVODE', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst index be0259cf57..4300c48f3f 100644 --- a/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst +++ b/doc/cvode/guide/source/sunnonlinsol/CVODE_interface.rst @@ -111,7 +111,7 @@ might need access to the current value of :math:`\gamma` to compute Jacobian dat custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemData` inside the - nonlinear system function to access the requisite data for evaluting + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` diff --git a/doc/cvodes/cvs_ex_adj.tex b/doc/cvodes/cvs_ex_adj.tex index 00269acf6f..e7b6fc8ebb 100644 --- a/doc/cvodes/cvs_ex_adj.tex +++ b/doc/cvodes/cvs_ex_adj.tex @@ -132,7 +132,7 @@ \subsection{A serial dense example: cvsRoberts\_ASAi\_dns}\label{ss:cvsRoberts_A checkpoint information printed). The next segment of code deals with the setup of the backward problem. -First, a serial vector \id{yB} of length \id{NEQ} is allocated and initalized with the +First, a serial vector \id{yB} of length \id{NEQ} is allocated and initialized with the value of $\lambda (= 0.0)$ at the final time (\id{TB1} = 4.0E7). A second serial vector \id{qB} of dimension \id{NP} is created and initialized to $0.0$. This vector corresponds to the quadrature variables $\xi$ whose values at $t_0$ @@ -415,7 +415,7 @@ \subsection{A parallel example using CVBBDPRE: cvsAtmDisp\_ASAi\_kry\_bbd\_p} \id{f\_comm}, called in \id{f} and \id{fB} before evaluation of the local residual components. Since there is no additional communication required for the {\cvbbdpre} preconditioner, a \id{NULL} pointer is passed for \id{gloc} and \id{glocB} in the -calls to \id{CVBBDPrecInit} and \id{CVBBDPrecInitB}, respectivley. +calls to \id{CVBBDPrecInit} and \id{CVBBDPrecInitB}, respectively. For the sake of clarity, the \id{cvsAtmDisp\_ASAi\_kry\_bbd\_p} example does not use the most memory-efficient implementation possible, as the local segment of the diff --git a/doc/cvodes/cvs_ex_fwd.tex b/doc/cvodes/cvs_ex_fwd.tex index ec8f23fa9e..6c1d8f8803 100644 --- a/doc/cvodes/cvs_ex_fwd.tex +++ b/doc/cvodes/cvs_ex_fwd.tex @@ -252,7 +252,7 @@ \subsection{A serial dense example: cvsRoberts\_FSA\_dns} \id{pbar} (\id{pbar}$_i$ = \id{p}$_i$, which can typically be used for nonzero model parameters). Next, the program allocates memory for \id{yS}, by calling the {\nvecs} function -\id{N\_VCloneVectorArray\_Serial}, and initializaes all sensitivity variables to $0.0$. +\id{N\_VCloneVectorArray\_Serial}, and initializes all sensitivity variables to $0.0$. The call to \id{CVodeSensInit1} specifies the sensitivity solution method through the argument \id{sensi\_meth} (read from the command @@ -290,7 +290,7 @@ \subsection{A serial dense example: cvsRoberts\_FSA\_dns} The user-supplied functions \id{f} (for the right-hand side of the original ODEs) and \id{Jac} (for the system Jacobian) are identical to those in \id{cvRoberts\_dns.c}, -with the notable exeption that model parameters are extracted from the user-defined +with the notable exception that model parameters are extracted from the user-defined data structure \id{data}, which must first be cast to the \id{UserData} type. Similarly, the user-supplied function \id{ewt} is identical to that in \id{cvRoberts\_dns\_uw.c}. The user-supplied function \id{fS} computes the diff --git a/doc/cvodes/cvs_ex_intro.tex b/doc/cvodes/cvs_ex_intro.tex index 6ac7624626..efa1a58264 100644 --- a/doc/cvodes/cvs_ex_intro.tex +++ b/doc/cvodes/cvs_ex_intro.tex @@ -167,7 +167,7 @@ \section{Introduction}\label{s:ex_intro} interaction terms only, using block-grouping. \newline Four different runs are made for this problem. - The product preconditoner is applied on the left and on the right. + The product preconditioner is applied on the left and on the right. In each case, both the modified and classical Gram-Schmidt options are tested. diff --git a/doc/cvodes/guide/source/Constants.rst b/doc/cvodes/guide/source/Constants.rst index cbd469ad51..4be7173ac0 100644 --- a/doc/cvodes/guide/source/Constants.rst +++ b/doc/cvodes/guide/source/Constants.rst @@ -137,7 +137,7 @@ CVODES output constants | ``CV_FIRST_RHSFUNC_ERR`` | -9 | The right-hand side function failed at the first | | | | call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repetead | + | ``CV_REPTD_RHSFUNC_ERR`` | -10 | The right-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_RHSFUNC_ERR`` | -11 | The right-hand side function had a recoverable | @@ -180,7 +180,7 @@ CVODES output constants | ``CV_FIRST_QRHSFUNC_ERR`` | -32 | The quadrature right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_QRHSFUNC_ERR`` | -33 | The quadrature ight-hand side function had repetead | + | ``CV_REPTD_QRHSFUNC_ERR`` | -33 | The quadrature ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_QRHSFUNC_ERR`` | -34 | The quadrature right-hand side function had a | @@ -194,7 +194,7 @@ CVODES output constants | ``CV_FIRST_SRHSFUNC_ERR`` | -42 | The sensitivity right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_SRHSFUNC_ERR`` | -43 | The sensitivity ight-hand side function had repetead | + | ``CV_REPTD_SRHSFUNC_ERR`` | -43 | The sensitivity ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_SRHSFUNC_ERR`` | -44 | The sensitivity right-hand side function had a | @@ -211,7 +211,7 @@ CVODES output constants | ``CV_FIRST_QSRHSFUNC_ERR`` | -52 | The sensitivity right-hand side function failed at | | | | the first call. | +----------------------------------+------+--------------------------------------------------------+ - | ``CV_REPTD_QSRHSFUNC_ERR`` | -53 | The sensitivity ight-hand side function had repetead | + | ``CV_REPTD_QSRHSFUNC_ERR`` | -53 | The sensitivity ight-hand side function had repeated | | | | recoverable errors. | +----------------------------------+------+--------------------------------------------------------+ | ``CV_UNREC_QSRHSFUNC_ERR`` | -54 | The sensitivity right-hand side function had a | diff --git a/doc/cvodes/guide/source/Introduction.rst b/doc/cvodes/guide/source/Introduction.rst index fbf0685067..419fd7ee20 100644 --- a/doc/cvodes/guide/source/Introduction.rst +++ b/doc/cvodes/guide/source/Introduction.rst @@ -46,7 +46,7 @@ capabilities of both VODE and VODPK have been combined in the C-language package CVODE :cite:p:`CoHi:96`. At present, CVODE may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) @@ -77,7 +77,7 @@ resulting in PVODE :cite:p:`ByHi:99`, the parallel variant of CVODE. CVODES is written with a functionality that is a superset of that of the pair CVODE/PVODE. Sensitivity analysis capabilities, both forward and adjoint, have -been added to the main integrator. Enabling forward sensititivity computations +been added to the main integrator. Enabling forward sensitivity computations in CVODES will result in the code integrating the so-called *sensitivity equations* simultaneously with the original IVP, yielding both the solution and its sensitivity with respect to parameters in the model. Adjoint sensitivity @@ -181,7 +181,7 @@ The structure of this document is as follows: addition to those already described in Chapter :numref:`CVODES.Usage.SIM`. Following that we provide detailed descriptions of the user-callable interface routines specific to forward sensitivity analysis and - of the additonal optional user-defined routines. + of the additional optional user-defined routines. - Chapter :numref:`CVODES.Usage.ADJ` describes the usage of CVODES for adjoint sensitivity analysis. We begin by describing the CVODES checkpointing implementation for interpolation of diff --git a/doc/cvodes/guide/source/Mathematics.rst b/doc/cvodes/guide/source/Mathematics.rst index 6424a6b98f..6f5ec2b285 100644 --- a/doc/cvodes/guide/source/Mathematics.rst +++ b/doc/cvodes/guide/source/Mathematics.rst @@ -850,7 +850,7 @@ the solution of the combined ODE and sensitivity system for the vector matrix of the above linear system is based on exactly the same information as the matrix :math:`M` in :eq:`CVODES_Newtonmat`, it must be updated and factored at every step of the integration, in contrast to an - evalutaion of :math:`M` which is updated only occasionally. For problems with + evaluation of :math:`M` which is updated only occasionally. For problems with many parameters (relative to the problem size), the staggered direct method can outperform the methods described below :cite:p:`LPZ:99`. However, the computational cost associated with matrix updates and factorizations makes @@ -1132,7 +1132,7 @@ the gradient of :math:`G` with respect to :math:`p` is nothing but :label: CVODES_dgdp_1 The gradient of :math:`g(T,y,p)` with respect to :math:`p` can be then obtained -by using the Leibnitz differentiation rule. Indeed, from :eq:`CVODES_G`, +by using the Leibniz differentiation rule. Indeed, from :eq:`CVODES_G`, .. math:: \frac{\mathrm dg}{\mathrm dp}(T) = \frac{\mathrm d}{\mathrm dT}\frac{\mathrm dG}{\mathrm dp} diff --git a/doc/cvodes/guide/source/Usage/ADJ.rst b/doc/cvodes/guide/source/Usage/ADJ.rst index fde6cd2261..6ab2b68396 100644 --- a/doc/cvodes/guide/source/Usage/ADJ.rst +++ b/doc/cvodes/guide/source/Usage/ADJ.rst @@ -1142,7 +1142,7 @@ potentially non-differentiable factor. Krylov linear solver's convergence test constant is reduced from the nonlinear iteration test constant. This routine can be used in both the cases where the backward problem does and does not depend on the forward - sensitvities. + sensitivities. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. @@ -1171,7 +1171,7 @@ potentially non-differentiable factor. converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. This routine can be used in both the cases wherethe backward - problem does and does not depend on the forward sensitvities. + problem does and does not depend on the forward sensitivities. **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. @@ -1527,7 +1527,7 @@ provide a ``rhsBS`` function of type :c:type:`CVRhsFnBS` defined as follows: **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``yBdot`` -- is the output vector containing the right-hand side. * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. @@ -1596,7 +1596,7 @@ by of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations provided with CVODES do not perform any - consistency checks with repsect to their ``N_Vector`` arguments + consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQB`` function every time it is called and can be the same as the ``user_data`` pointer used for the forward problem. @@ -1626,7 +1626,7 @@ defined by **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors continaing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``qBdot`` -- is the output vector containing the right-hand side ``fQBS`` of the backward quadrature equations. * ``user_dataB`` -- is a pointer to user data, same as passed to ``CVodeSetUserDataB``. @@ -1645,7 +1645,7 @@ defined by data consistently (including the use of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations - provided with CVODES do not perform any consistency checks with repsect to + provided with CVODES do not perform any consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQBS`` function every time it is called and can be the same as the ``user_data`` pointer used @@ -1729,7 +1729,7 @@ non-``NULL`` ``SUNMatrix`` object was supplied to **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the forward solution vector. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``JacB`` -- is the output approximate Jacobian matrix. @@ -1795,7 +1795,7 @@ J_B` (or an approximation of it) for the backward problem. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``AB`` -- is the output approximate linear system matrix. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -1838,7 +1838,7 @@ J_B` (or an approximation of it) for the backward problem. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. * ``AB`` -- is the output approximate linear system matrix. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or informtion saved from a previous information can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous information can be safely used (``jokB = SUNTRUE``). * ``jcurB`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -2010,7 +2010,7 @@ function of type :c:type:`CVLsJacTimesSetupFnB` or **Arguments:** * ``t`` -- is the current value of the independent variable. * ``y`` -- is the current value of the dependent variable vector, :math:`y(t)`. - * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitvities of the forward solution. + * ``yS`` -- a pointer to an array of ``Ns`` vectors containing the sensitivities of the forward solution. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the right-hand-side function for the backward problem. * ``user_dataB`` -- is a pointer to the same user data provided to ``CVodeSetUserDataB``. @@ -2128,7 +2128,7 @@ function of one of the following two types: * ``y`` -- is the current value of the forward solution vector. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invocation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. @@ -2156,7 +2156,7 @@ function of one of the following two types: * ``yS`` -- is a pointer to an array containing the forward sensitivity vectors. * ``yB`` -- is the current value of the backward dependent variable vector. * ``fyB`` -- is the current value of the backward right-hand side function :math:`f_B`. - * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invokation can be safely used (``jokB = SUNTRUE``). + * ``jokB`` -- is an input flag indicating whether Jacobian-related data needs to be recomputed (``jokB = SUNFALSE``) or information saved from a previous invocation can be safely used (``jokB = SUNTRUE``). * ``jcurPtr`` -- is an output flag which must be set to ``SUNTRUE`` if Jacobian-related data was recomputed or ``SUNFALSE`` otherwise. * ``gammaB`` -- is the scalar appearing in the matrix :math:`M_B = I - \gamma_B J_B`. * ``user_dataB`` -- is a pointer to the same user data passed to ``CVodeSetUserDataB``. diff --git a/doc/cvodes/guide/source/Usage/FSA.rst b/doc/cvodes/guide/source/Usage/FSA.rst index bec66d6d76..17723f0607 100644 --- a/doc/cvodes/guide/source/Usage/FSA.rst +++ b/doc/cvodes/guide/source/Usage/FSA.rst @@ -320,7 +320,7 @@ one, respectively. The form of the call to each of these routines is as follows: Passing ``fS1 = NULL`` indicates using the default internal difference quotient sensitivity right-hand side routine. If an error occurred, :c:func:`CVodeSensInit1` also sends an error message to the error handler - funciton. + function. In terms of the problem size :math:`N`, number of sensitivity vectors @@ -1317,7 +1317,7 @@ steps are in bold. #. :silver:`Create sensitivity nonlinear solver object` -#. :silver:`Attach the sensitvity nonlinear solver module` +#. :silver:`Attach the sensitivity nonlinear solver module` #. :silver:`Set sensitivity nonlinear solver optional inputs` @@ -1394,7 +1394,7 @@ of the call to this function is as follows: **Notes:** .. warning:: Before calling :c:func:`CVodeQuadSensInit`, the user must enable the - sensitivites by calling :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. If + sensitivities by calling :c:func:`CVodeSensInit` or :c:func:`CVodeSensInit1`. If an error occurred, :c:func:`CVodeQuadSensInit` also sends an error message to the error handler function. diff --git a/doc/cvodes/guide/source/Usage/SIM.rst b/doc/cvodes/guide/source/Usage/SIM.rst index 18dce59206..8bc54ff2a2 100644 --- a/doc/cvodes/guide/source/Usage/SIM.rst +++ b/doc/cvodes/guide/source/Usage/SIM.rst @@ -443,7 +443,7 @@ makes no sense (and is overly costly) after ``y[i]`` is below some noise level. ``abstol`` (if scalar) or ``abstol[i]`` (if a vector) needs to be set to that noise level. If the different components have different noise levels, then ``abstol`` should be a vector. See the example ``cvsRoberts_dns`` in the CVODES package, and the discussion of it in the CVODES Examples document -:cite:p:`cvodes_ex`. In that problem, the three components vary betwen 0 and 1, +:cite:p:`cvodes_ex`. In that problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as to what those @@ -772,7 +772,7 @@ rootfinding. In the ``CV_ONE_STEP`` mode, ``tout`` is used only on the first call, and only to get the direction and a rough scale of the independent variable. - If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + If a stop time is enabled (through a call to ``CVodeSetStopTime``), then ``CVode`` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). All failure return values are negative and so the test ``flag < 0`` will trap all ``CVode`` failures. @@ -914,7 +914,7 @@ Main solver optional input functions **Arguments:** * ``cvode_mem`` -- pointer to the CVODES memory block. - * ``nst`` -- number of successful steps inbetween calls to the monitor function 0 by default; a 0 input will turn off monitoring. + * ``nst`` -- number of successful steps in between calls to the monitor function 0 by default; a 0 input will turn off monitoring. **Return value:** * ``CV_SUCCESS`` -- The optional value has been successfully set. @@ -1056,7 +1056,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. - Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be reenabled only though a new call to ``CVodeSetStopTime``). + Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and can be re-enabled only though a new call to ``CVodeSetStopTime``). A stop time not reached before a call to :c:func:`CVodeReInit` will remain active but can be disabled by calling :c:func:`CVodeClearStopTime`. @@ -1089,7 +1089,7 @@ Main solver optional input functions * ``CV_MEM_NULL`` if the CVODES memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`CVodeSetStopTime`. .. versionadded:: 6.5.1 @@ -2627,7 +2627,7 @@ described next. The values returned in ``ele`` are valid only if :c:func:`CVode` returned a non-negative value. - The ``ele`` vector, togther with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`CVodeGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose components are the products of the components of these two vectors. Thus, for example, if there were recent error test failures, the components causing the failures are those with largest values for the products, denoted loosely as ``eweight[i]*ele[i]``. @@ -3136,7 +3136,7 @@ solver, a suffix (for Linear Solver) has been added here (e.g. ``lenrwLS``). * ``leniwLS`` -- the number of integer values in the CVDIAG workspace. **Return value:** - * ``CVDIAG_SUCCESS`` -- The optional output valus have been successfully set. + * ``CVDIAG_SUCCESS`` -- The optional output values have been successfully set. * ``CVDIAG_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. * ``CVDIAG_LMEM_NULL`` -- The CVDIAG linear solver has not been initialized. @@ -3223,7 +3223,7 @@ known, simply make that location a value of tout. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the RHS function *not* incorporate the discontinuity, but rather have a smooth -extention over the discontinuity, so that the step across it (and +extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the RHS function (communicated through ``user_data``) that can be flipped between the stopping of the integration and the restart, so that @@ -3382,7 +3382,7 @@ These weights will be used in place of those defined by Eq. .. warning:: - The error weight vector must have all components positive. It is the user's responsiblity to perform this test and return -1 if it is not satisfied. + The error weight vector must have all components positive. It is the user's responsibility to perform this test and return -1 if it is not satisfied. .. _CVODES.Usage.SIM.user_supplied.rootFn: @@ -3405,7 +3405,7 @@ follows: * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. **Return value:** - A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occured (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. + A ``CVRootFn`` should return 0 if successful or a non-zero value if an error occurred (in which case the integration is haled and ``CVode`` returns ``CV_RTFUNC_FAIL``. **Notes:** Allocation of memory for ``gout`` is automatically handled within CVODES. @@ -3428,7 +3428,7 @@ user-defined projection operation the projection function must have type * ``t`` -- the current value of the independent variable. * ``ycur`` -- the current value of the dependent variable vector :math:`y(t)`. * ``corr`` -- the correction, :math:`c`, to the dependent variable vector so that :math:`y(t) + c` satisfies the constraint equation. - * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrainted least squares problem. + * ``epsProj`` -- the tolerance to use in the nonlinear solver stopping test when solving the nonlinear constrained least squares problem. * ``err`` -- is on input the current error estimate, if error projection is enabled (the default) then this should be overwritten with the projected error on output. If error projection is disabled then ``err`` is ``NULL``. * ``user_data`` a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`CVodeSetUserData`. @@ -3855,7 +3855,7 @@ are in bold. #. **Set optional inputs for quadrature integration** Call :c:func:`CVodeSetQuadErrCon` to indicate whether or not quadrature - variables shoule be used in the step size control mechanism, and to specify + variables should be used in the step size control mechanism, and to specify the integration tolerances for quadrature variables. See :numref:`CVODES.Usage.purequad.optional_inputs` for details. diff --git a/doc/cvodes/guide/source/conf.py b/doc/cvodes/guide/source/conf.py index a8a21e28a1..a8e4f703f7 100644 --- a/doc/cvodes/guide/source/conf.py +++ b/doc/cvodes/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'CVODES', u'CVODES Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'CVODES', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst index fa046db709..3d4a42140d 100644 --- a/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst +++ b/doc/cvodes/guide/source/sunnonlinsol/CVODES_interface.rst @@ -49,7 +49,7 @@ the combined state and sensitivity nonlinear systems are also reformulated in terms of the correction to the predicted state and sensitivities. The nonlinear system functions provided by CVODES to the nonlinear solver module -internally update the current value of the new state (and the sensitvities) +internally update the current value of the new state (and the sensitivities) based on the input correction vector(s) i.e., :math:`y^n = y_{pred} + y_{cor}` and :math:`s_i^n = s_{i,pred} + s_{i,cor}`. The updated vector(s) are used when calling the right-hand side function and when setting up linear solves (e.g., @@ -125,7 +125,7 @@ need access to the current value of :math:`\gamma` to compute Jacobian data. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemData` inside the - nonlinear system function to access the requisite data for evaluting + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` @@ -208,15 +208,15 @@ need access to the current value of :math:`\gamma` to compute Jacobian data. * ``CV_MEM_NULL`` -- The ``cvode_mem`` pointer is ``NULL``. **Notes:** - This routine is intended for users who whish to attach a custom + This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to ``SUNNonlinSolSetSysFn``) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`CVodeGetNonlinearSystemDataSens` inside the nonlinear system function used in the sensitivity nonlinear solve to access the - requisite data for evaluting the nonlinear system function of their + requisite data for evaluating the nonlinear system function of their choosing. This could be the same function used for solving for the new state (the simultaneous approach) or a different function (the staggered or stagggered1 approaches). Additionlly, the vectors ``ySn`` are only diff --git a/doc/ida/guide/source/Introduction.rst b/doc/ida/guide/source/Introduction.rst index 029b9a3523..b100289002 100644 --- a/doc/ida/guide/source/Introduction.rst +++ b/doc/ida/guide/source/Introduction.rst @@ -37,7 +37,7 @@ LLNL to support the ordinary differential equation (ODE) solvers CVODE nonlinear system solver KINSOL :cite:p:`kinsol_ug`. At present, IDA may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) diff --git a/doc/ida/guide/source/Usage/index.rst b/doc/ida/guide/source/Usage/index.rst index 2402ae83eb..36b20b743e 100644 --- a/doc/ida/guide/source/Usage/index.rst +++ b/doc/ida/guide/source/Usage/index.rst @@ -449,7 +449,7 @@ For many users, the appropriate choices for tolerance values in ``reltol`` and different components have different noise levels, then ``abstol`` should be a vector. See the example ``idaRoberts_dns`` in the IDA package, and the discussion of it in the IDA Examples document :cite:p:`ida_ex`. In that - problem, the three components vary betwen 0 and 1, and have different noise + problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as @@ -840,7 +840,7 @@ rootfinding (with :c:func:`IDARootInit`). If a stop time is enabled (through a call to :c:func:`IDASetStopTime`), then :c:func:`IDASolve` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and - can be reenabled only though a new call to :c:func:`IDASetStopTime`). + can be re-enabled only though a new call to :c:func:`IDASetStopTime`). All failure return values are negative and therefore a test ``flag < 0`` will trap all :c:func:`IDASolve` failures. @@ -1067,7 +1067,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for ``tstop`` - is disabled (and can be reenabled only though a new call to + is disabled (and can be re-enabled only though a new call to :c:func:`IDASetStopTime`). A stop time not reached before a call to :c:func:`IDAReInit` will @@ -1085,7 +1085,7 @@ Main solver optional input functions * ``IDA_MEM_NULL`` if the IDA memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`IDASetStopTime`. .. versionadded:: 6.5.1 @@ -2492,7 +2492,7 @@ described next. .. note:: - The ``ele`` vector, togther with the ``eweight`` vector from + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`IDAGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose @@ -3054,7 +3054,7 @@ To stop when the location of the discontinuity is known, simply make that location a value of :math:`t_{\text{out}}`. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the residual function *not* incorporate the -discontinuity, but rather have a smooth extention over the discontinuity, so +discontinuity, but rather have a smooth extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the residual function (communicated through ``user_data``) that can be flipped between the stopping of the @@ -3164,7 +3164,7 @@ Error weight function **Return value:** * ``0`` -- if it the error weights were successfully set. - * ``-1`` -- if any error occured. + * ``-1`` -- if any error occurred. **Notes:** Allocation of memory for ``ewt`` is handled within IDA. @@ -3172,7 +3172,7 @@ Error weight function .. warning:: The error weight vector must have all components positive. It is the - user's responsiblity to perform this test and return -1 if it is not + user's responsibility to perform this test and return -1 if it is not satisfied. @@ -3203,8 +3203,8 @@ as follows: parameter passed to :c:func:`IDASetUserData`. **Return value:** - ``0`` if successful or non-zero if an error occured (in which case the - integration is halted and :c:func:`IDASolve` returs ``IDA_RTFUNC_FAIL``). + ``0`` if successful or non-zero if an error occurred (in which case the + integration is halted and :c:func:`IDASolve` returns ``IDA_RTFUNC_FAIL``). **Notes:** Allocation of memory for ``gout`` is handled within IDA. @@ -3247,7 +3247,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: value if a recoverable error occurred, or a negative value if a nonrecoverable error occurred. - In the case of a recoverable eror return, the integrator will attempt to + In the case of a recoverable error return, the integrator will attempt to recover by reducing the stepsize, and hence changing :math:`\alpha` in :eq:`IDA_DAE_Jacobian`. diff --git a/doc/ida/guide/source/conf.py b/doc/ida/guide/source/conf.py index a92a878cf5..53f27fadba 100644 --- a/doc/ida/guide/source/conf.py +++ b/doc/ida/guide/source/conf.py @@ -291,7 +291,7 @@ texinfo_documents = [ ('index', 'IDA', u'IDA Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'IDA', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst index 36feccee89..2ec40ffb7a 100644 --- a/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst +++ b/doc/ida/guide/source/sunnonlinsol/IDA_interface.rst @@ -117,13 +117,13 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of a + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemData` inside the nonlinear system function to - access the requisite data for evaluting the nonlinear system function of + access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by IDA (through calls to diff --git a/doc/ida/ida_ex_fortran.tex b/doc/ida/ida_ex_fortran.tex index af9260e4dc..60ab483870 100644 --- a/doc/ida/ida_ex_fortran.tex +++ b/doc/ida/ida_ex_fortran.tex @@ -66,7 +66,7 @@ \subsection{A parallel example: fidaHeat2D\_kry\_bbd\_p}\label{ss:fidaHeat2D_bbd a call to \id{FNVINITP} to initialize {\nvecp}, and a call to \id{SETINITPROFILE} to initialize the \id{UU}, \id{UP}, \id{ID}, and \id{CONSTR} arrays (containing the solution vector, solution derivative vector, -the differential/algebraic bit vector, and the contraint specification +the differential/algebraic bit vector, and the constraint specification vector, respectively). A call to \id{FIDASETIIN} and two calls to \id{FIDASETVIN} are made to suppress error control on the algebraic variables, and to supply the \id{ID} array and constraints array (making diff --git a/doc/ida/ida_ex_serial.tex b/doc/ida/ida_ex_serial.tex index fb9e8fd934..6322125609 100644 --- a/doc/ida/ida_ex_serial.tex +++ b/doc/ida/ida_ex_serial.tex @@ -61,7 +61,7 @@ \subsection{A dense example: idaRoberts\_dns}\label{ss:idaRoberts} After various declarations, the \id{main} program begins by allocating memory for the \id{yy}, \id{yp}, and \id{avtol} vectors using \id{N\_VNew\_Serial} with a length argument of \id{NEQ} ($= 3$). The -lines following that load the initial values of the dependendent +lines following that load the initial values of the dependent variable vectors into \id{yy} and \id{yp}, and set the relative tolerance \id{rtol} and absolute tolerance vector \id{avtol}. Serial \id{N\_Vector} values are set by first accessing the pointer to their underlying data using @@ -389,7 +389,7 @@ \subsection{A Krylov example: idaHeat2D\_kry}\label{ss:idaHeat2D} of the PDE (using central differences) in the rest of the domain. The user-supplied functions \id{PsetupHeat} and \id{PsolveHeat} together define the -left preconditoner matrix $P$ approximating the system Jacobian matrix +left preconditioner matrix $P$ approximating the system Jacobian matrix $J = \partial F/ \partial u + \alpha \partial F/ \partial u'$ (where the DAE system is $F(t,u,u') = 0$), and solve the linear systems $P z = r$. Preconditioning is done in this case by keeping only the diagonal elements of diff --git a/doc/ida/ida_ex_trilinos.tex b/doc/ida/ida_ex_trilinos.tex index aa4ad1140e..58dc769c4b 100644 --- a/doc/ida/ida_ex_trilinos.tex +++ b/doc/ida/ida_ex_trilinos.tex @@ -49,7 +49,7 @@ \subsection{A nonstiff shared memory parallel example: idaHeat2D\_kry\_tpetra} changing the example code. Once the communicator and map are set, a Tpetra vector is created as: \begin{verbatim} - /* Create a Tpetra vector and return refernce counting pointer to it. */ + /* Create a Tpetra vector and return reference counting pointer to it. */ Teuchos::RCP rcpuu = Teuchos::rcp(new vector_type(mpiMap)); \end{verbatim} diff --git a/doc/idas/guide/source/Introduction.rst b/doc/idas/guide/source/Introduction.rst index 771da6ec5b..5f1b554c5f 100644 --- a/doc/idas/guide/source/Introduction.rst +++ b/doc/idas/guide/source/Introduction.rst @@ -37,7 +37,7 @@ at LLNL to support the ordinary differential equation (ODE) solvers CVODE nonlinear system solver KINSOL :cite:p:`kinsol_ug`. At present, IDAS may utilize a variety of Krylov methods provided in SUNDIALS -that can be used in conjuction with Newton iteration: these include the GMRES +that can be used in conjunction with Newton iteration: these include the GMRES (Generalized Minimal RESidual) :cite:p:`SaSc:86`, FGMRES (Flexible Generalized Minimum RESidual) :cite:p:`Saa:93`, Bi-CGStab (Bi-Conjugate Gradient Stabilized) :cite:p:`Van:92`, TFQMR (Transpose-Free Quasi-Minimal Residual) @@ -119,7 +119,7 @@ The structure of this document is as follows: that are required in addition to those already described in Chapter :numref:`IDAS.Usage.SIM`. Following that we provide detailed descriptions of the user-callable interface routines specific to forward - sensitivity analysis and of the additonal optional user-defined routines. + sensitivity analysis and of the additional optional user-defined routines. * Chapter :numref:`IDAS.Usage.ADJ` describes the usage of IDAS for adjoint sensitivity analysis. We begin by describing the IDAS checkpointing diff --git a/doc/idas/guide/source/Usage/ADJ.rst b/doc/idas/guide/source/Usage/ADJ.rst index 60c76147d7..af8b782a28 100644 --- a/doc/idas/guide/source/Usage/ADJ.rst +++ b/doc/idas/guide/source/Usage/ADJ.rst @@ -1115,7 +1115,7 @@ setting increments for the finite-difference approximation, via a call to increments used in the difference quotient approximations to matrix-vector products for the backward problem. This routine can be used in both the cases where the backward problem does and does not depend on the forward - sensitvities. + sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1245,7 +1245,7 @@ These may be accomplished through calling the following functions: Krylov linear solver's convergence test constant is reduced from the nonlinear iteration test constant. (See :numref:`IDAS.Mathematics.ivp_sol`). This routine can be used in both the cases wherethe backward problem does - and does not depend on the forward sensitvities. + and does not depend on the forward sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1275,7 +1275,7 @@ These may be accomplished through calling the following functions: converting from the integrator tolerance (WRMS norm) to the linear solver tolerance (L2 norm) for Newton linear system solves e.g., ``tol_L2 = fac * tol_WRMS``. This routine can be used in both the cases wherethe backward - problem does and does not depend on the forward sensitvities. + problem does and does not depend on the forward sensitivities. **Arguments:** * ``ida_mem`` -- pointer to the IDAS memory block. @@ -1746,7 +1746,7 @@ The user must provide an ``fQB`` function of type ``IDAQuadRhsFnB`` defined by data consistently (including the use of the correct accessor macros from each ``N_Vector`` implementation). For the sake of computational efficiency, the vector functions in the two ``N_Vector`` implementations - provided with IDAS do not perform any consistency checks with repsect to + provided with IDAS do not perform any consistency checks with respect to their ``N_Vector`` arguments (see :numref:`NVectors`). The ``user_dataB`` pointer is passed to the user's ``fQB`` function every time it is called and can be the same as the ``user_data`` pointer used for the forward diff --git a/doc/idas/guide/source/Usage/FSA.rst b/doc/idas/guide/source/Usage/FSA.rst index 6309026184..38f5608634 100644 --- a/doc/idas/guide/source/Usage/FSA.rst +++ b/doc/idas/guide/source/Usage/FSA.rst @@ -1224,7 +1224,7 @@ in the notation of :eq:`IDAS_QUAD`. The form of the call to this function is as .. warning:: Before calling :c:func:`IDAQuadSensInit`, the user must enable the - sensitivites by calling :c:func:`IDASensInit`. If an error occurred, + sensitivities by calling :c:func:`IDASensInit`. If an error occurred, :c:func:`IDAQuadSensInit` also sends an error message to the error handler function. diff --git a/doc/idas/guide/source/Usage/SIM.rst b/doc/idas/guide/source/Usage/SIM.rst index 981291a4aa..f8bbe96021 100644 --- a/doc/idas/guide/source/Usage/SIM.rst +++ b/doc/idas/guide/source/Usage/SIM.rst @@ -447,7 +447,7 @@ For many users, the appropriate choices for tolerance values in ``reltol`` and different components have different noise levels, then ``abstol`` should be a vector. See the example ``idaRoberts_dns`` in the IDAS package, and the discussion of it in the IDAS Examples document :cite:p:`ida_ex`. In that - problem, the three components vary betwen 0 and 1, and have different noise + problem, the three components vary between 0 and 1, and have different noise levels; hence the ``abstol`` vector. It is impossible to give any general advice on ``abstol`` values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as @@ -845,7 +845,7 @@ rootfinding (with :c:func:`IDARootInit`). If a stop time is enabled (through a call to :c:func:`IDASetStopTime`), then :c:func:`IDASolve` returns the solution at ``tstop``. Once the integrator returns at a stop time, any future testing for ``tstop`` is disabled (and - can be reenabled only though a new call to :c:func:`IDASetStopTime`). + can be re-enabled only though a new call to :c:func:`IDASetStopTime`). All failure return values are negative and therefore a test ``flag < 0`` will trap all :c:func:`IDASolve` failures. @@ -1072,7 +1072,7 @@ Main solver optional input functions **Notes:** The default, if this routine is not called, is that no stop time is imposed. Once the integrator returns at a stop time, any future testing for ``tstop`` - is disabled (and can be reenabled only though a new call to + is disabled (and can be re-enabled only though a new call to :c:func:`IDASetStopTime`). A stop time not reached before a call to :c:func:`IDAReInit` will @@ -1090,7 +1090,7 @@ Main solver optional input functions * ``IDA_MEM_NULL`` if the IDA memory is ``NULL`` **Notes:** - The stop time can be reenabled though a new call to + The stop time can be re-enabled though a new call to :c:func:`IDASetStopTime`. .. versionadded:: 6.5.1 @@ -1802,7 +1802,7 @@ to set optional inputs controlling the initial condition calculation. If :c:func:`IDASetMaxBacksIC` is called in a Forward Sensitivity Analysis, the the limit ``maxbacks`` applies in the calculation of both the initial state - values and the initial sensititivies. + values and the initial sensitivities. .. c:function:: int IDASetLineSearchOffIC(void * ida_mem, sunbooleantype lsoff) @@ -2518,7 +2518,7 @@ described next. .. note:: - The ``ele`` vector, togther with the ``eweight`` vector from + The ``ele`` vector, together with the ``eweight`` vector from :c:func:`IDAGetErrWeights`, can be used to determine how the various components of the system contributed to the estimated local error test. Specifically, that error test uses the RMS norm of a vector whose @@ -3084,7 +3084,7 @@ To stop when the location of the discontinuity is known, simply make that location a value of :math:`t_{\text{out}}`. To stop when the location of the discontinuity is determined by the solution, use the rootfinding feature. In either case, it is critical that the residual function *not* incorporate the -discontinuity, but rather have a smooth extention over the discontinuity, so +discontinuity, but rather have a smooth extension over the discontinuity, so that the step across it (and subsequent rootfinding, if used) can be done efficiently. Then use a switch within the residual function (communicated through ``user_data``) that can be flipped between the stopping of the @@ -3204,7 +3204,7 @@ Error weight function **Return value:** * ``0`` -- if it the error weights were successfully set. - * ``-1`` -- if any error occured. + * ``-1`` -- if any error occurred. **Notes:** Allocation of memory for ``ewt`` is handled within IDAS. @@ -3212,7 +3212,7 @@ Error weight function .. warning:: The error weight vector must have all components positive. It is the - user's responsiblity to perform this test and return -1 if it is not + user's responsibility to perform this test and return -1 if it is not satisfied. @@ -3243,7 +3243,7 @@ as follows: parameter passed to :c:func:`IDASetUserData`. **Return value:** - ``0`` if successful or non-zero if an error occured (in which case the + ``0`` if successful or non-zero if an error occurred (in which case the integration is halted and :c:func:`IDASolve` returns ``IDA_RTFUNC_FAIL``). **Notes:** @@ -3287,7 +3287,7 @@ user may provide a function of type :c:type:`IDALsJacFn` defined as follows: value if a recoverable error occurred, or a negative value if a nonrecoverable error occurred. - In the case of a recoverable eror return, the integrator will attempt to + In the case of a recoverable error return, the integrator will attempt to recover by reducing the stepsize, and hence changing :math:`\alpha` in :eq:`IDAS_DAE_Jacobian`. @@ -3658,7 +3658,7 @@ steps are in bold. #. **Set optional inputs for quadrature integration** Call :c:func:`IDASetQuadErrCon` to indicate whether or not quadrature - variables shoule be used in the step size control mechanism, and to specify + variables should be used in the step size control mechanism, and to specify the integration tolerances for quadrature variables. See :numref:`IDAS.Usage.Purequad.quad_optional_input` for details. diff --git a/doc/idas/guide/source/conf.py b/doc/idas/guide/source/conf.py index 8613adcf6a..e0da18474a 100644 --- a/doc/idas/guide/source/conf.py +++ b/doc/idas/guide/source/conf.py @@ -292,7 +292,7 @@ texinfo_documents = [ ('index', 'IDAS', u'IDAS Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'IDAS', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst index d2d6cc8746..54f8375db9 100644 --- a/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst +++ b/doc/idas/guide/source/sunnonlinsol/IDAS_interface.rst @@ -40,7 +40,7 @@ reformulated in terms of the correction to the predicted sensitivities. The nonlinear system function provided by IDAS to the nonlinear solver module internally updates the current value of the new state and its derivative based -on the current corretion passed to the function (as well as the sensitivities). +on the current correction passed to the function (as well as the sensitivities). These values are used when calling the DAE residual function and when setting up linear solves (e.g., for updating the Jacobian or preconditioner). @@ -149,13 +149,13 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of a + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemData` inside the nonlinear system function to - access the requisite data for evaluting the nonlinear system function of + access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the ``SUNNonlinearSolver`` object (existing or custom) leverages the :c:type:`SUNNonlinSolLSetupFn` and/or :c:type:`SUNNonlinSolLSolveFn` functions supplied by IDAS (through calls to @@ -203,11 +203,11 @@ the current :math:`y` and :math:`\dot{y}` vectors to compute Jacobian data. This routine is intended for users who wish to attach a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object (through a call to :c:func:`SUNNonlinSolSetSysFn`) or who need access to - nonlinear system data to compute the nonlinear system fucntion as part of + nonlinear system data to compute the nonlinear system function as part of a custom ``SUNNonlinearSolver`` object. When supplying a custom :c:type:`SUNNonlinSolSysFn` to an existing ``SUNNonlinearSolver`` object, the user should call :c:func:`IDAGetNonlinearSystemDataSens` inside the - nonlinear system function to access the requisite data for evaluting the + nonlinear system function to access the requisite data for evaluating the nonlinear system function of their choosing. Additionlly, if the the vectors ``yySn`` and ``ypSn`` are provided as additional workspace and do not need to be filled in by the user's :c:type:`SUNNonlinSolSysFn`. If diff --git a/doc/idas/idas_ex_intro.tex b/doc/idas/idas_ex_intro.tex index fde54914d3..d2ca2de7eb 100644 --- a/doc/idas/idas_ex_intro.tex +++ b/doc/idas/idas_ex_intro.tex @@ -296,7 +296,7 @@ \section{Introduction}\label{s:ex_intro} {\em builddir}\id{/lib/libsundials\_idas.}{\em lib} instead of {\em builddir}\id{/lib/libsundials\_ida.}{\em lib}. -We also give our output files for each of thes examples described below, +We also give our output files for each of the examples described below, but users should be cautioned that their results may differ slightly from these. Differences in solution values may differ within the tolerances, and differences in cumulative counters, such as numbers of steps or Newton iterations, may differ diff --git a/doc/kinsol/guide/source/Usage/index.rst b/doc/kinsol/guide/source/Usage/index.rst index dd1bcacec1..ebe2aeef76 100644 --- a/doc/kinsol/guide/source/Usage/index.rst +++ b/doc/kinsol/guide/source/Usage/index.rst @@ -1030,7 +1030,7 @@ negative, so a test ``retval`` :math:`<0` will catch any error. .. c:function:: int KINSetDampingAA(void * kin_mem, sunrealtype beta) The function :c:func:`KINSetDampingAA` specifies the value of the Anderson - acceleration damping paramter. + acceleration damping parameter. **Arguments:** * ``kin_mem`` -- pointer to the KINSOL memory block. @@ -1946,7 +1946,7 @@ supplied, the default is a difference quotient approximation to these products. This function computes the product :math:`J v` (or an approximation to it). **Arguments:** - * ``v`` -- is the vector by which the Jacobian must be multplied to the right. + * ``v`` -- is the vector by which the Jacobian must be multiplied to the right. * ``Jv`` -- is the computed output vector. * ``u`` -- is the current value of the dependent variable vector. * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` @@ -1999,7 +1999,7 @@ of type :c:type:`KINLsPrecSolveFn`, defined as follows: * ``uscale`` -- is a vector containing diagonal elements of the scaling matrix ``u`` * ``fval`` -- is the vector :math:`F(u)` evaluated at ``u`` * ``fscale`` -- is a vector containing diagonal elements of the scaling matrix for ``fval`` - * ``v`` -- on inpuut, ``v`` is set to the right-hand side vector of the linear system, ``r``. On output, ``v`` must contain the solution ``z`` of the linear system :math:`Pz=r` + * ``v`` -- on input, ``v`` is set to the right-hand side vector of the linear system, ``r``. On output, ``v`` must contain the solution ``z`` of the linear system :math:`Pz=r` * ``user_data`` -- is a pointer to user data, the same as the ``user_data`` parameter passed to :c:func:`KINSetUserData`. @@ -2131,7 +2131,7 @@ communication. **Return value:** An :c:type:`KINBBDLocalFn` function type should return 0 to indicate success, - or non-zero if an error occured. + or non-zero if an error occurred. **Notes:** This function must assume that all inter-processor communication of data @@ -2155,7 +2155,7 @@ communication. **Return value:** An :c:type:`KINBBDLocalFn` function type should return 0 to indicate success, - or non-zero if an error occured. + or non-zero if an error occurred. **Notes:** The ``Gcomm`` function is expected to save communicated data in space defined diff --git a/doc/kinsol/guide/source/conf.py b/doc/kinsol/guide/source/conf.py index c8cef7c6ac..074821a0a3 100644 --- a/doc/kinsol/guide/source/conf.py +++ b/doc/kinsol/guide/source/conf.py @@ -296,7 +296,7 @@ texinfo_documents = [ ('index', 'KINSOL', u'KINSOL Documentation', u'Alan C. Hindmarsh, Radu Serban, Cody J. Balos, David J. Gardner, Daniel R. Reynolds, and Carol S. Woodward', 'KINSOL', - 'Time integration package for multi-rate systems of ordinary differntial equations.', + 'Time integration package for multi-rate systems of ordinary differential equations.', 'Miscellaneous'), ] diff --git a/doc/kinsol/kin_ex_c.tex b/doc/kinsol/kin_ex_c.tex index 74fd91f289..8fea81bf05 100644 --- a/doc/kinsol/kin_ex_c.tex +++ b/doc/kinsol/kin_ex_c.tex @@ -89,7 +89,7 @@ \subsection{A serial dense example: kinFerTron\_dns}\label{ss:kinFerTron_dns} functions \id{SetInitialGuess1} and \id{SetInitialGuess2} and the constraint vector \id{c} is initialized to $[0,0,1,-1,1,-1]$ indicating that there are no additional constraints on the first two components of \id{u} (i.e. $x_1$ and -$x_2$) and that the 3rd and 5th compnents should be non-negative, while +$x_2$) and that the 3rd and 5th components should be non-negative, while the 4th and 6th should be non-positive. The calls to \id{N\_VNew\_Serial}, and also later calls to various \id{KIN***} @@ -275,7 +275,7 @@ \subsection{A serial Krylov example: kinFoodWeb\_kry}\label{ss:kinFoodWeb_kry} to load problem constants in the \id{data} block; \id{FreeUserData} to free that block; \id{SetInitialProfiles} to load the initial values in \id{cc}; \id{PrintHeader} to print the heading for the output; -\id{PrintOutput} to retreive and print selected solution values; +\id{PrintOutput} to retrieve and print selected solution values; \id{PrintFinalStats} to print statistics; and \id{check\_flag} to check return values for error conditions. @@ -326,7 +326,7 @@ \subsection{A parallel example: kinFoodWeb\_kry\_bbd\_p}\label{ss:kinFoodWeb_kry The function \id{func\_local} is also passed as the \id{gloc} argument to \id{KINBBDPrecInit}. Since all communication needed for the evaluation of the -local aproximation of $f$ used in building the band-block-diagonal preconditioner +local approximation of $f$ used in building the band-block-diagonal preconditioner is already done for the evaluation of $f$ in \id{func}, a \id{NULL} pointer is passed as the \id{gcomm} argument to \id{KINBBDPrecInit}. diff --git a/doc/kinsol/kin_ex_fortran.tex b/doc/kinsol/kin_ex_fortran.tex index 2c7b263144..c8c1f25c69 100644 --- a/doc/kinsol/kin_ex_fortran.tex +++ b/doc/kinsol/kin_ex_fortran.tex @@ -95,7 +95,7 @@ \subsection{A parallel example: fkinDiagon\_kry\_p}\label{ss:fkinDiagon_kry_p} \id{fkinDiagon\_kry}. Upon successful return from \id{fkinsol}, the solution segment local to the process with id equal to $0$ is printed to unit 6. Finally, the {\kinsol} memory is released and the {\mpi} -environent is terminated. +environment is terminated. For this simple example, no inter-process communication is required to evaluate the nonlinear system function $f$ or the preconditioner. diff --git a/doc/shared/Changelog.rst b/doc/shared/Changelog.rst index 5bf5c04203..bc9d5c1ad9 100644 --- a/doc/shared/Changelog.rst +++ b/doc/shared/Changelog.rst @@ -1999,7 +1999,7 @@ implemented a custom :c:type:`SUNMatrix` will need to at least update their code to set the corresponding ``ops`` structure member, ``matvecsetup``, to ``NULL``. The generic :c:type:`SUNMatrix` API now defines error codes to be returned by -matrix operations. Operations which return an integer flag indiciating +matrix operations. Operations which return an integer flag indicating success/failure may return different values than previously. A new :c:type:`SUNMatrix` (and :c:type:`SUNLinearSolver`) implementation was @@ -2112,7 +2112,7 @@ function signatures have been changed including :c:func:`MRIStepCreate` which now takes an ARKStep memory structure for the fast integration as an input. The reinitialization functions :c:func:`ERKStepReInit`, :c:func:`ARKStepReInit`, -and :c:func:`MRIStepReInit` have been updated to retain the minimum and maxiumum +and :c:func:`MRIStepReInit` have been updated to retain the minimum and maximum step size values from before reinitialization rather than resetting them to the default values. @@ -2138,7 +2138,7 @@ being built. Fixed a memory leak in the PETSc :c:type:`N_Vector` clone function. -Fixed a memeory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using +Fixed a memory leak in the ARKODE, CVODE, and IDA F77 interfaces when not using the default nonlinear solver. Fixed a bug in the ARKStep time-stepping module in ARKODE that would result in @@ -2878,7 +2878,7 @@ with sparse direct solvers. *KINSOL* -The Picard iteration return was chanegd to always return the newest iterate upon +The Picard iteration return was changed to always return the newest iterate upon success. A minor bug in the line search was fixed to prevent an infinite loop when the diff --git a/doc/shared/nvectors/NVector_CUDA.rst b/doc/shared/nvectors/NVector_CUDA.rst index df27c93672..d81ba70e7c 100644 --- a/doc/shared/nvectors/NVector_CUDA.rst +++ b/doc/shared/nvectors/NVector_CUDA.rst @@ -45,7 +45,7 @@ if the vector owns the execution policies and memory helper objects (i.e., it is in change of freeing the objects), :c:type:`SUNMemory` objects for the vector data on the host and device, pointers to execution policies that control how streaming and reduction kernels are launched, a :c:type:`SUNMemoryHelper` for performing memory -operations, and a private data structure which holds additonal members that +operations, and a private data structure which holds additional members that should not be accessed directly. When instantiated with :c:func:`N_VNew_Cuda`, the underlying data will be @@ -84,7 +84,7 @@ accessor functions: .. c:function:: sunbooleantype N_VIsManagedMemory_Cuda(N_Vector v) - This function returns a boolean flag indiciating if the vector + This function returns a boolean flag indicating if the vector data array is in managed memory or not. @@ -272,7 +272,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Cuda``, ``v``, - it is recommeded to use functions :c:func:`N_VGetDeviceArrayPointer_Cuda()` or + it is recommended to use functions :c:func:`N_VGetDeviceArrayPointer_Cuda()` or :c:func:`N_VGetHostArrayPointer_Cuda()`. However, when using managed memory, the function :c:func:`N_VGetArrayPointer` may also be used. @@ -375,7 +375,7 @@ In total, SUNDIALS provides 3 execution policies: .. cpp:function:: SUNCudaBlockReduceExecPolicy(const size_t blockDim, const cudaStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks. The + Is for kernels performing a reduction across individual thread blocks. The number of threads per block (blockDim) can be set to any valid multiple of the CUDA warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size will be chosen so @@ -384,7 +384,7 @@ In total, SUNDIALS provides 3 execution policies: .. cpp:function:: SUNCudaBlockReduceAtomicExecPolicy(const size_t blockDim, const cudaStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks using + Is for kernels performing a reduction across individual thread blocks using atomic operations. The number of threads per block (blockDim) can be set to any valid multiple of the CUDA warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size diff --git a/doc/shared/nvectors/NVector_HIP.rst b/doc/shared/nvectors/NVector_HIP.rst index f722e9cfac..050e379982 100644 --- a/doc/shared/nvectors/NVector_HIP.rst +++ b/doc/shared/nvectors/NVector_HIP.rst @@ -44,7 +44,7 @@ The content members are the vector length (size), a boolean flag that signals if the vector owns the data (i.e. it is in charge of freeing the data), pointers to vector data on the host and the device, pointers to :cpp:type:`SUNHipExecPolicy` implementations that control how the HIP kernels are launched for streaming and -reduction vector kernels, and a private data structure which holds additonal members +reduction vector kernels, and a private data structure which holds additional members that should not be accessed directly. When instantiated with :c:func:`N_VNew_Hip`, the underlying data will be @@ -81,7 +81,7 @@ accessor functions: .. c:function:: sunbooleantype N_VIsManagedMemory_Hip(N_Vector v) - This function returns a boolean flag indiciating if the vector + This function returns a boolean flag indicating if the vector data array is in managed memory or not. @@ -255,7 +255,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Hip``, ``v``, - it is recommeded to use functions :c:func:`N_VGetDeviceArrayPointer_Hip()` or + it is recommended to use functions :c:func:`N_VGetDeviceArrayPointer_Hip()` or :c:func:`N_VGetHostArrayPointer_Hip()`. However, when using managed memory, the function :c:func:`N_VGetArrayPointer` may also be used. @@ -359,7 +359,7 @@ In total, SUNDIALS provides 4 execution policies: .. cpp:function:: SUNHipBlockReduceExecPolicy(const size_t blockDim, const hipStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks. The + Is for kernels performing a reduction across individual thread blocks. The number of threads per block (blockDim) can be set to any valid multiple of the HIP warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size will be chosen so that there @@ -368,7 +368,7 @@ In total, SUNDIALS provides 4 execution policies: .. cpp:function:: SUNHipBlockReduceAtomicExecPolicy(const size_t blockDim, const hipStream_t stream = 0) - Is for kernels performing a reduction across indvidual thread blocks using + Is for kernels performing a reduction across individual thread blocks using atomic operations. The number of threads per block (blockDim) can be set to any valid multiple of the HIP warp size. The grid size (gridDim) can be set to any value greater than 0. If it is set to 0, then the grid size diff --git a/doc/shared/nvectors/NVector_MPIManyVector.rst b/doc/shared/nvectors/NVector_MPIManyVector.rst index fdaeaf31c9..f7907c446c 100644 --- a/doc/shared/nvectors/NVector_MPIManyVector.rst +++ b/doc/shared/nvectors/NVector_MPIManyVector.rst @@ -27,7 +27,7 @@ construction of distinct NVECTOR modules for each component, that are then combined together to form the NVECTOR_MPIMANYVECTOR. Three potential use cases for this module include: -A. *Heterogenous computational architectures (single-node or multi-node)*: +A. *Heterogeneous computational architectures (single-node or multi-node)*: for data partitioning between different computing resources on a node, architecture-specific subvectors may be created for each partition. For example, a user could create one MPI-parallel component based on diff --git a/doc/shared/nvectors/NVector_MPIPlusX.rst b/doc/shared/nvectors/NVector_MPIPlusX.rst index 88905edd50..d22070eaef 100644 --- a/doc/shared/nvectors/NVector_MPIPlusX.rst +++ b/doc/shared/nvectors/NVector_MPIPlusX.rst @@ -71,7 +71,7 @@ user-callable routines: .. c:function:: N_Vector N_VMake_MPIPlusX(MPI_Comm comm, N_Vector *local_vector, SUNContext sunctx) - This function creates a MPIPlusX vector from an exisiting local + This function creates a MPIPlusX vector from an existing local (i.e. on node) NVECTOR object, and a user-created MPI communicator. The input *comm* should be this user-created MPI communicator. diff --git a/doc/shared/nvectors/NVector_ManyVector.rst b/doc/shared/nvectors/NVector_ManyVector.rst index cded89fd73..5afeccb8dc 100644 --- a/doc/shared/nvectors/NVector_ManyVector.rst +++ b/doc/shared/nvectors/NVector_ManyVector.rst @@ -24,7 +24,7 @@ construction of distinct NVECTOR modules for each component, that are then combined together to form the NVECTOR_MANYVECTOR. Two potential use cases for this flexibility include: -A. *Heterogenous computational architectures*: +A. *Heterogeneous computational architectures*: for data partitioning between different computing resources on a node, architecture-specific subvectors may be created for each partition. For example, a user could create one GPU-accelerated component based diff --git a/doc/shared/nvectors/NVector_OpenMP.rst b/doc/shared/nvectors/NVector_OpenMP.rst index 4f84694770..2947c403db 100644 --- a/doc/shared/nvectors/NVector_OpenMP.rst +++ b/doc/shared/nvectors/NVector_OpenMP.rst @@ -276,7 +276,7 @@ options as the vector they are cloned from while vectors created with loop than it is to use ``NV_Ith_OMP(v,i)`` within the loop. * :c:func:`N_VNewEmpty_OpenMP` and :c:func:`N_VMake_OpenMP` set the field - *own_data* to ``SUNFALSE``. The implemenation of :c:func:`N_VDestroy` will + *own_data* to ``SUNFALSE``. The implementation of :c:func:`N_VDestroy` will not attempt to free the pointer data for any ``N_Vector`` with *own_data* set to ``SUNFALSE``. In such a case, it is the user's responsibility to deallocate the data pointer. diff --git a/doc/shared/nvectors/NVector_Operations.rst b/doc/shared/nvectors/NVector_Operations.rst index e184b829de..475abc4a84 100644 --- a/doc/shared/nvectors/NVector_Operations.rst +++ b/doc/shared/nvectors/NVector_Operations.rst @@ -104,7 +104,7 @@ operations below. Returns a pointer to a ``sunrealtype`` array from the ``N_Vector`` *v*. Note that this assumes that the internal data in the ``N_Vector`` is a contiguous array of ``sunrealtype`` and is - accesible from the CPU. + accessible from the CPU. This routine is only used in the solver-specific interfaces to the dense and banded diff --git a/doc/shared/nvectors/NVector_PETSc.rst b/doc/shared/nvectors/NVector_PETSc.rst index f7284ae7f8..3d0983e149 100644 --- a/doc/shared/nvectors/NVector_PETSc.rst +++ b/doc/shared/nvectors/NVector_PETSc.rst @@ -162,7 +162,7 @@ options as the vector they are cloned from while vectors created with **Notes** * When there is a need to access components of an ``N_Vector_Petsc v``, it - is recommeded to extract the PETSc vector via ``x_vec = N_VGetVector_Petsc(v);`` + is recommended to extract the PETSc vector via ``x_vec = N_VGetVector_Petsc(v);`` and then access components using appropriate PETSc functions. * The functions :c:func:`N_VNewEmpty_Petsc` and :c:func:`N_VMake_Petsc`, set the diff --git a/doc/shared/nvectors/NVector_Trilinos.rst b/doc/shared/nvectors/NVector_Trilinos.rst index c891f07ab6..d5b404ea58 100644 --- a/doc/shared/nvectors/NVector_Trilinos.rst +++ b/doc/shared/nvectors/NVector_Trilinos.rst @@ -104,7 +104,7 @@ The module NVECTOR_TRILINOS provides the following additional user-callable rout in SUNDIALS. * When there is a need to access components of an ``N_Vector_Trilinos v``, - it is recommeded to extract the Trilinos vector object via ``x_vec = + it is recommended to extract the Trilinos vector object via ``x_vec = N_VGetVector_Trilinos(v)`` and then access components using the appropriate Trilinos functions. diff --git a/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst index 6c8a77bcb8..0c1b0cc620 100644 --- a/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst +++ b/doc/shared/sunadaptcontroller/SUNAdaptController_Soderlind.rst @@ -254,7 +254,7 @@ also provides the following additional user-callable routines: h' = h_n \varepsilon_n^{-\hat{k}_1/(p+1)} \left(\frac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-\hat{k}_2/(p+1)}. The inputs to this function correspond to the values of :math:`\hat{k}_1` and :math:`\hat{k}_2`, - which are internally transformed into the Soderlind coeficients :math:`k_1 = \hat{k}_1+\hat{k}_2` + which are internally transformed into the Soderlind coefficients :math:`k_1 = \hat{k}_1+\hat{k}_2` and :math:`k_2 = -\hat{k}_2`. :param C: the SUNAdaptController_Soderlind object. @@ -300,7 +300,7 @@ also provides the following additional user-callable routines: h' = h_n \varepsilon_n^{-\hat{k}_1/(p+1)} \left(\frac{\varepsilon_n}{\varepsilon_{n-1}}\right)^{-\hat{k}_2/(p+1)} \left(\frac{h_n}{h_{n-1}}\right). The inputs to this function correspond to the values of :math:`\hat{k}_1` and :math:`\hat{k}_2`, - which are internally transformed into the Soderlind coeficients :math:`k_1 = \hat{k}_1+\hat{k}_2`, + which are internally transformed into the Soderlind coefficients :math:`k_1 = \hat{k}_1+\hat{k}_2`, :math:`k_2 = -\hat{k}_2`, and :math:`k_4=1`. :param C: the SUNAdaptController_Soderlind object. diff --git a/doc/shared/sundials/Errors.rst b/doc/shared/sundials/Errors.rst index 20cbcc5405..ce273ea76e 100644 --- a/doc/shared/sundials/Errors.rst +++ b/doc/shared/sundials/Errors.rst @@ -18,7 +18,7 @@ Error Checking .. versionadded:: 7.0.0 Until version 7.0.0, error reporting and handling was inconsistent throughout SUNDIALS. Starting with version 7.0.0 all of SUNDIALS (the core, implementations of core modules, and -packages) reports error mesages through the :c:type:`SUNLogger` API. Furthermore, functions in the +packages) reports error messages through the :c:type:`SUNLogger` API. Furthermore, functions in the SUNDIALS core API (i.e., ``SUN`` or ``N_V`` functions only) either return a :c:type:`SUNErrCode`, or (if they don't return a :c:type:`SUNErrCode`) they internally record an error code (if an error occurs) within the :c:type:`SUNContext` for the execution stream. This "last error" is accessible @@ -45,17 +45,17 @@ Thus, in user code, SUNDIALS core API functions can be checked for errors in one length = 2; v = N_VNew_Serial(length, sunctx); sunerr = SUNContext_GetLastError(sunctx); - if (sunerr) { /* an error occured, do something */ } + if (sunerr) { /* an error occurred, do something */ } // If the function returns a SUNErrCode, we can check it directly sunerr = N_VLinearCombination(...); - if (sunerr) { /* an error occured, do something */ } + if (sunerr) { /* an error occurred, do something */ } // Another function that does not return a SUNErrCode. dotprod = N_VDotProd(...); SUNContext_GetLastError(sunctx); if (sunerr) { - /* an error occured, do something */ + /* an error occurred, do something */ } else { print("dotprod = %.2f\n", dotprod); } @@ -114,11 +114,11 @@ The error handlers provided in SUNDIALS are: Logs the error that occurred using the :c:type:`SUNLogger` from ``sunctx``. This is the default error handler. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: the message to log, if this is ``NULL`` then the default error message for the error code will be used - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object @@ -128,13 +128,13 @@ The error handlers provided in SUNDIALS are: const char* msg, SUNErrCode err_code, \ void* err_user_data, SUNContext sunctx) - Logs the error and aborts the program if an error occured. + Logs the error and aborts the program if an error occurred. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: this parameter is ignored - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object @@ -145,13 +145,13 @@ The error handlers provided in SUNDIALS are: const char* msg, SUNErrCode err_code, \ void* err_user_data, SUNContext sunctx) - Logs the error and calls ``MPI_Abort`` if an error occured. + Logs the error and calls ``MPI_Abort`` if an error occurred. - :param line: the line number at which the error occured - :param func: the function in which the error occured - :param file: the file in which the error occured + :param line: the line number at which the error occurred + :param func: the function in which the error occurred + :param file: the file in which the error occurred :param msg: this parameter is ignored - :param err_code: the error code for the error that occured + :param err_code: the error code for the error that occurred :param err_user_data: the user pointer provided to :c:func:`SUNContext_PushErrHandler` :param sunctx: pointer to a valid :c:type:`SUNContext` object diff --git a/doc/shared/sundials/GPU.rst b/doc/shared/sundials/GPU.rst index 8607643adf..e3c12bb41c 100644 --- a/doc/shared/sundials/GPU.rst +++ b/doc/shared/sundials/GPU.rst @@ -64,7 +64,7 @@ data partitioning (achievable with the NVECTOR_MANYVECTOR, see programming environments they support, and what class of memory they support (unmanaged or UVM). Users may also supply their own GPU-enabled :c:type:`N_Vector`, :c:type:`SUNMatrix`, or :c:type:`SUNLinearSolver` - implementation, and the capabilties will be leveraged since SUNDIALS operates + implementation, and the capabilities will be leveraged since SUNDIALS operates on data through these APIs. .. ifconfig:: package_name != 'kinsol' @@ -77,7 +77,7 @@ data partitioning (achievable with the NVECTOR_MANYVECTOR, see programming environments they support, and what class of memory they support (unmanaged or UVM). Users may also supply their own GPU-enabled :c:type:`N_Vector`, :c:type:`SUNMatrix`, :c:type:`SUNLinearSolver`, or - :c:type:`SUNNonlinearSolver` implementation, and the capabilties will be + :c:type:`SUNNonlinearSolver` implementation, and the capabilities will be leveraged since SUNDIALS operates on data through these APIs. In addition, SUNDIALS provides a memory management helper module @@ -174,7 +174,7 @@ accelerated SUNDIALS are: #. Write user-supplied functions so that they use data only in the device memory space (again, unless an atypical data partitioning is used). A few examples of these functions are the right-hand side evaluation function, the Jacobian - evalution function, or the preconditioner evaulation function. In the context + evaluation function, or the preconditioner evaluation function. In the context of CUDA and the right-hand side function, one way a user might ensure data is accessed on the device is, for example, calling a CUDA kernel, which does all of the computation, from a CPU function which simply extracts the underlying diff --git a/doc/shared/sundials/Install.rst b/doc/shared/sundials/Install.rst index d666fc7b29..d75eca6e9e 100644 --- a/doc/shared/sundials/Install.rst +++ b/doc/shared/sundials/Install.rst @@ -31,7 +31,7 @@ by cloning the `SUNDIALS GitHub repository `_ SUNDIALS release compressed archives (``.tar.gz``) from the SUNDIALS `website `_. -The compressed archives allow for downloading of indvidual SUNDIALS packages. +The compressed archives allow for downloading of individual SUNDIALS packages. The name of the distribution archive is of the form ``SOLVER-7.1.0.tar.gz``, where ``SOLVER`` is one of: ``sundials``, ``cvode``, ``cvodes``, ``arkode``, ``ida``, ``idas``, or ``kinsol``, and ``7.1.0`` @@ -187,7 +187,7 @@ Using CMake with the ``cmake-gui`` GUI follows a similar process: #. The first time you click ``Configure``, make sure to pick the appropriate generator (the following will assume generation of Unix - Makfiles). + Makefiles). #. New values are highlighted in red @@ -591,7 +591,7 @@ illustration only. Default: ``OFF`` .. warning:: There is a known issue with MSYS/gfortran and SUNDIALS shared libraries - that causes linking the Fortran interfaces to fail when buidling SUNDIALS. For + that causes linking the Fortran interfaces to fail when building SUNDIALS. For now the work around is to only build with static libraries when using MSYS with gfortran on Windows. @@ -612,7 +612,7 @@ illustration only. .. cmakeoption:: SUNDIALS_BUILD_WITH_MONITORING - Build SUNDIALS with capabilties for fine-grained monitoring of solver progress + Build SUNDIALS with capabilities for fine-grained monitoring of solver progress and statistics. This is primarily useful for debugging. Default: OFF @@ -624,7 +624,7 @@ illustration only. .. cmakeoption:: SUNDIALS_BUILD_WITH_PROFILING - Build SUNDIALS with capabilties for fine-grained profiling. + Build SUNDIALS with capabilities for fine-grained profiling. This requires POSIX timers or the Windows ``profileapi.h`` timers. Default: OFF @@ -669,8 +669,8 @@ illustration only. .. cmakeoption:: SUNDIALS_GINKGO_BACKENDS - Semi-colon separated list of Ginkgo target architecutres/executors to build for. - Options currenty supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and SYCL. + Semi-colon separated list of Ginkgo target architectures/executors to build for. + Options currently supported are REF (the Ginkgo reference executor), OMP, CUDA, HIP, and SYCL. Default: "REF;OMP" @@ -901,7 +901,7 @@ illustration only. .. cmakeoption:: PETSC_INCLUDES - Semi-colon separated list of PETSc include directroies. Unless provided by + Semi-colon separated list of PETSc include directories. Unless provided by the user, this is autopopulated based on the PETSc installation found in ``PETSC_DIR``. @@ -935,7 +935,7 @@ illustration only. Default: ``OFF`` - .. note:: See additional information on building wtih + .. note:: See additional information on building with SuperLU_DIST enabled in :numref:`Installation.CMake.ExternalLibraries`. .. cmakeoption:: SUPERLUDIST_DIR @@ -1264,7 +1264,7 @@ CUDA (for NVIDIA devices), HIP (for AMD devices) and SYCL/DPC++ (for Intel devic supported hardware). To enable Ginkgo in SUNDIALS, set the :cmakeop:`ENABLE_GINKGO` to ``ON`` and provide the path to the root of the Ginkgo installation in :cmakeop:`Ginkgo_DIR`. Additionally, :cmakeop:`SUNDIALS_GINKGO_BACKENDS` must be set to a list of Ginkgo target -architecutres/executors. E.g., +architectures/executors. E.g., .. code-block:: bash diff --git a/doc/shared/sunlinsol/SUNLinSol_API.rst b/doc/shared/sunlinsol/SUNLinSol_API.rst index 6650b88d20..9bc00e30da 100644 --- a/doc/shared/sunlinsol/SUNLinSol_API.rst +++ b/doc/shared/sunlinsol/SUNLinSol_API.rst @@ -900,7 +900,7 @@ SUNLinSol implementations. As SUNDIALS packages utilize generic SUNLinSol modules they may naturally leverage user-supplied ``SUNLinearSolver`` implementations, thus there exist a wide range of possible linear solver combinations. Some intended use cases for both the -SUNDIALS-provided and user-supplied SUNLinSol modules are discussd in the +SUNDIALS-provided and user-supplied SUNLinSol modules are discussed in the sections below. @@ -949,7 +949,7 @@ Matrix-based iterative linear solvers (reusing :math:`A`) Matrix-based iterative linear solver modules require a matrix and compute an inexact solution to the linear system *defined by the matrix*. This -matrix will be updated infrequently and resued across multiple solves +matrix will be updated infrequently and reused across multiple solves to amortize the cost of matrix construction. As in the direct linear solver case, only thin SUNMATRIX and SUNLinSol wrappers for the underlying matrix and linear solver structures need to be created to utilize diff --git a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst index 34fd25c82d..5b1a4e0a3d 100644 --- a/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst +++ b/doc/shared/sunlinsol/SUNLinSol_Ginkgo.rst @@ -45,9 +45,9 @@ Using SUNLINEARSOLVER_GINKGO After choosing a compatible ``N_Vector`` (see :numref:`SUNMatrix.Ginkgo.CompatibleNVectors`) and creating a Ginkgo-enabled ``SUNMatrix`` (see :numref:`SUNMatrix.Ginkgo`) to use the SUNLINEARSOLVER_GINKGO module, we first create a Ginkgo stopping criteria object. Importantly, the ``sundials::ginkgo::DefaultStop`` class provided -by SUNDIALS implements a stopping critierion that matches the default SUNDIALS stopping critierion. +by SUNDIALS implements a stopping criterion that matches the default SUNDIALS stopping criterion. Namely, it checks if the max iterations (5 by default) were reached or if the absolute residual -norm was below a speicified tolerance. The critierion can be created just like any other +norm was below a specified tolerance. The criterion can be created just like any other Ginkgo stopping criteria: .. code-block:: cpp @@ -59,7 +59,7 @@ Ginkgo stopping criteria: but it is optional. However, to use the Ginkgo multigrid or cbgmres linear solvers, different Ginkgo criterion must be used. -Once we have created our stopping critierion, we create a Ginkgo solver factory object and +Once we have created our stopping criterion, we create a Ginkgo solver factory object and wrap it in a :cpp:type:`sundials::ginkgo::LinearSolver` object. In this example, we create a Ginkgo conjugate gradient solver: @@ -185,7 +185,7 @@ In this section we list the public API of the :cpp:type:`sundials::ginkgo::Linea .. cpp:function:: gko::LinOp* Solve(N_Vector b, N_Vector x, sunrealtype tol) - Solve the linear system Ax = b to the specificed tolerance. + Solve the linear system Ax = b to the specified tolerance. :param b: the right-hand side vector :param x: the solution vector diff --git a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst index 177d9558b2..462c0c7c7e 100644 --- a/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst +++ b/doc/shared/sunlinsol/SUNLinSol_SuperLUDIST.rst @@ -164,7 +164,7 @@ information: * ``berr`` -- the componentwise relative backward error of the computed solution, -* ``grid`` -- pointer to the SuperLU_DIST structure that strores the 2D process grid +* ``grid`` -- pointer to the SuperLU_DIST structure that stores the 2D process grid * ``lu`` -- pointer to the SuperLU_DIST structure that stores the distributed ``L`` and ``U`` factors, @@ -172,7 +172,7 @@ information: * ``scaleperm`` -- pointer to the SuperLU_DIST structure that stores vectors describing the transformations done to the matrix ``A``, -* ``options`` -- pointer to the SuperLU_DIST stucture which contains options that control +* ``options`` -- pointer to the SuperLU_DIST structure which contains options that control how the linear system is factorized and solved, * ``solve`` -- pointer to the SuperLU_DIST solve structure, diff --git a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst index 23894bd7ef..58ce79681d 100644 --- a/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst +++ b/doc/shared/sunlinsol/SUNLinSol_cuSolverSp.rst @@ -125,7 +125,7 @@ In addition, the module provides the following user-callable routines: The function ``SUNLinSol_cuSolverSp_batchQR_GetDeviceSpace`` returns the cuSOLVER batch QR method internal buffer size, in bytes, in the argument ``cuSolverInternal`` and the cuSOLVER - batch QR workspace buffer size, in bytes, in the agrument + batch QR workspace buffer size, in bytes, in the argument ``cuSolverWorkspace``. The size of the internal buffer is proportional to the number of matrix blocks while the size of the workspace is almost independent of the number of blocks. diff --git a/doc/shared/sunmatrix/SUNMatrix_Description.rst b/doc/shared/sunmatrix/SUNMatrix_Description.rst index 11f69ab896..fe17e6f3f2 100644 --- a/doc/shared/sunmatrix/SUNMatrix_Description.rst +++ b/doc/shared/sunmatrix/SUNMatrix_Description.rst @@ -207,7 +207,7 @@ set and all operations are copied when cloning a matrix. SUNMATRIX_CUSPARSE CUDA sparse CSR matrix SUNMATRIX_CUSTOM User-provided custom matrix SUNMATRIX_DENSE Dense :math:`M \times N` matrix - SUNMATRIX_GINKGO SUNMatrix wraper for Ginkgo matrices + SUNMATRIX_GINKGO SUNMatrix wrapper for Ginkgo matrices SUNMATRIX_MAGMADENSE Dense :math:`M \times N` matrix SUNMATRIX_ONEMKLDENSE oneMKL dense :math:`M \times N` matrix SUNMATRIX_SLUNRLOC SUNMatrix wrapper for SuperLU_DIST SuperMatrix diff --git a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst index 899782dcbf..bbcadfe20c 100644 --- a/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst +++ b/doc/shared/sunmatrix/SUNMatrix_KokkosDense.rst @@ -142,7 +142,7 @@ class. :param rows: number of matrix rows :param cols: number of matrix columns - :param ex: an execuation space + :param ex: an execution space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(size_type blocks, size_type block_rows, \ @@ -166,7 +166,7 @@ class. :param blocks: number of matrix blocks :param block_rows: number of rows in a block :param block_cols: number of columns in a block - :param ex: an execuation space + :param ex: an execution space :param sunctx: the SUNDIALS simulation context object (:c:type:`SUNContext`) .. cpp:function:: DenseMatrix(DenseMatrix&& that_matrix) noexcept diff --git a/doc/shared/sunmemory/SUNMemory_Description.rst b/doc/shared/sunmemory/SUNMemory_Description.rst index 3499367c7b..2efc154aa4 100644 --- a/doc/shared/sunmemory/SUNMemory_Description.rst +++ b/doc/shared/sunmemory/SUNMemory_Description.rst @@ -70,7 +70,7 @@ This API consists of three new SUNDIALS types: :c:type:`SUNMemoryType`, .. c:enumerator:: SUNMEMTYPE_PINNED - Page-locked memory accesible on the host + Page-locked memory accessible on the host .. c:enumerator:: SUNMEMTYPE_DEVICE diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst index d169c83001..4715ee8e29 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_API.rst @@ -122,7 +122,7 @@ initialization (:c:func:`SUNNonlinSolInitialize`), setup * *mem* -- the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value + The return value is zero for a successful solve, a positive value for a recoverable error (i.e., the solve failed and the integrator should reduce the step size and reattempt the step), and a negative value for an unrecoverable error (i.e., the solve failed the and @@ -357,7 +357,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** @@ -383,7 +383,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** @@ -415,7 +415,7 @@ module have types defined in the header file * *mem* -- is the SUNDIALS integrator memory structure. **Return value:** - The return value is zero for a successul solve, a positive value for + The return value is zero for a successful solve, a positive value for a recoverable error, and a negative value for an unrecoverable error. **Notes:** diff --git a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst index e9d9c856f1..1cb332300d 100644 --- a/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst +++ b/doc/shared/sunnonlinsol/SUNNonlinSol_PetscSNES.rst @@ -25,7 +25,7 @@ configured to use PETSc. Instructions on how to do this are given in SUNNonlinSol_PetscSNES module, include the header file ``sunnonlinsol/sunnonlinsol_petscsnes.h``. The library to link to is ``libsundials_sunnonlinsolpetsc.lib`` where ``.lib`` is typically ``.so`` for -shared libaries and ``.a`` for static libraries. Users of the +shared libraries and ``.a`` for static libraries. Users of the SUNNonlinSol_PetscSNES module should also see :numref:`NVectors.NVPETSc` which discusses the NVECTOR interface to the PETSc ``Vec`` API. @@ -184,4 +184,4 @@ These entries of the *content* field contain the following information: * ``r`` -- the nonlinear residual, * ``y`` -- wrapper for PETSc vectors used in the system function, * ``f`` -- wrapper for PETSc vectors used in the system function, -* ``Sys`` -- nonlinear system definining function. +* ``Sys`` -- nonlinear system defining function. diff --git a/doc/sundials/ug.tex b/doc/sundials/ug.tex index aa3d25945c..a7478dc4e8 100644 --- a/doc/sundials/ug.tex +++ b/doc/sundials/ug.tex @@ -486,7 +486,7 @@ \setlength{\leftmargin}{\labelwidth+\labelsep}}} {\end{list}} %%----------------------------------------------------- -%% Underlying list environemnt for function definitions +%% Underlying list environment for function definitions %%----------------------------------------------------- \newenvironment{Ventry}[1][\quad] {\begin{list}{}{ @@ -652,7 +652,7 @@ \makeatletter \long\def\addDepName#1{\def\@tempa{#1}\ifx\@tempa\empty\item[Deprecated Name]{None}\else\item[Deprecated Name]{For backward compatibility, the wrapper - function \id{#1} with idential input and output arguments is also + function \id{#1} with identical input and output arguments is also provided.}\fi} \makeatother diff --git a/doc/superbuild/source/contributing/index.rst b/doc/superbuild/source/contributing/index.rst index 947443d9f5..4bc71a6bc5 100644 --- a/doc/superbuild/source/contributing/index.rst +++ b/doc/superbuild/source/contributing/index.rst @@ -16,7 +16,7 @@ Contributing ============ -There are two primary ways of contributing to SUNDIALS. The first way is by particpating +There are two primary ways of contributing to SUNDIALS. The first way is by participating in the development of SUNDIALS directly through contributions of code to the primary `SUNDIALS repository `_. This is the best way to contribute bug fixes and minor improvements. At this time, the SUNDIALS team does not have the resources diff --git a/doc/superbuild/source/developers/appendix/GitCheatSheet.rst b/doc/superbuild/source/developers/appendix/GitCheatSheet.rst index 3e3c7f2a5c..1f7d86fa7d 100644 --- a/doc/superbuild/source/developers/appendix/GitCheatSheet.rst +++ b/doc/superbuild/source/developers/appendix/GitCheatSheet.rst @@ -248,7 +248,7 @@ the :ref:`Workflow` section. reordering, squashing, updating commit messages, etc.) before pushing to the remote repository. - Rebase the commited but not pushed changes on the current branch and execute + Rebase the committed but not pushed changes on the current branch and execute a given command (``cmd``) between each step in the rebase .. code-block:: none diff --git a/doc/superbuild/source/developers/getting_started/Workflow.rst b/doc/superbuild/source/developers/getting_started/Workflow.rst index 5da388e53a..52967d44b8 100644 --- a/doc/superbuild/source/developers/getting_started/Workflow.rst +++ b/doc/superbuild/source/developers/getting_started/Workflow.rst @@ -149,7 +149,7 @@ branches and the ``master`` for maintenance branches. work. #. During the development cycle it is a good practice to periodically push local - commits to the remote repo. To push your locally commited changes use: + commits to the remote repo. To push your locally committed changes use: .. code-block:: none @@ -259,7 +259,7 @@ Manually resolve the conflicts in an editor: $ git rebase --continue -#. If desired, push the updated local brach to the remote repo with +#. If desired, push the updated local branch to the remote repo with .. code-block:: none @@ -293,7 +293,7 @@ merge tool: $ git rebase --continue -#. If desired, push the updated local brach to the remote repo with +#. If desired, push the updated local branch to the remote repo with .. code-block:: none diff --git a/doc/superbuild/source/developers/style_guide/SourceCode.rst b/doc/superbuild/source/developers/style_guide/SourceCode.rst index 5a05602867..ba5a9c4ff8 100644 --- a/doc/superbuild/source/developers/style_guide/SourceCode.rst +++ b/doc/superbuild/source/developers/style_guide/SourceCode.rst @@ -17,7 +17,7 @@ Naming ====== -All exported symbols that will be publically available must be namespaced +All exported symbols that will be publicly available must be namespaced appropriately! * ``SUN_`` or ``SUNDIALS_`` for macros diff --git a/doc/superbuild/source/developers/testing/Answers.rst b/doc/superbuild/source/developers/testing/Answers.rst index ecefcfbd4d..6d64f7e4ea 100644 --- a/doc/superbuild/source/developers/testing/Answers.rst +++ b/doc/superbuild/source/developers/testing/Answers.rst @@ -32,7 +32,7 @@ Due to difference in microarichtectures and the nature of floating point arithme possible that the output generated on one machine may differ from the output generated on another. As such, we specify that the the answer files that are embedded in ``examples/`` (the ``.out`` files) should match what is produced on the Jenkins CI machine. We also have a `separate git -repostiory `_ which holds answers for other machines, +repository `_ which holds answers for other machines, such as the GitHub Actions virtual machines. diff --git a/doc/superbuild/source/developers/testing/CI.rst b/doc/superbuild/source/developers/testing/CI.rst index 00ded30a77..a71b4e5930 100644 --- a/doc/superbuild/source/developers/testing/CI.rst +++ b/doc/superbuild/source/developers/testing/CI.rst @@ -94,7 +94,7 @@ environment so that its buildcache can be leveraged. We also maintain two containers for the {int32, double} pair that are built automatically (in a GitHub action) every week against the latest Spack develop commit. This allows us to test against -the latest versions of dependencies reguarly and detect interface breakages. +the latest versions of dependencies regularly and detect interface breakages. GitLab CI Testing @@ -264,7 +264,7 @@ These submodules work in conjunction with ``spack_packages/sundials/package.py`` to configure and build any third-party libraries needed by the SUNDIALS configuration and generates an initial CMake cache file for building SUNDIALS. Other packages can be added to ``spack_packages//package.py`` -if the default Spack package needs to be overriden. We do this currently for +if the default Spack package needs to be overridden. We do this currently for Caliper, as we need a newer version than in the Spack commit currently used. Updating Spack diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D.h b/examples/arkode/CXX_parallel/ark_brusselator1D.h index b95390bc4a..8f4b873e9e 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D.h +++ b/examples/arkode/CXX_parallel/ark_brusselator1D.h @@ -148,7 +148,7 @@ struct UserData N_Vector vmask; N_Vector wmask; - /* problem paramaters */ + /* problem parameters */ int nvar; /* number of species */ long int nx; /* number of intervals globally */ int nxl; /* number of intervals locally */ @@ -197,7 +197,7 @@ typedef struct SUNNonlinearSolver local_nls; }* TaskLocalNewton_Content; -/* Content accessor macors */ +/* Content accessor macros */ #define GET_NLS_CONTENT(NLS) ((TaskLocalNewton_Content)(NLS->content)) #define LOCAL_NLS(NLS) (GET_NLS_CONTENT(NLS)->local_nls) diff --git a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp index 8bee143d0b..b5029ca9a5 100644 --- a/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp +++ b/examples/arkode/CXX_parallel/ark_brusselator1D_task_local_nls.cpp @@ -22,7 +22,7 @@ * w_t = -c * w_x + (B - w) / ep - w * u * * for t in [0, 10], x in [0, xmax] with periodic boundary conditions. The - * initial condition is a Gaussian pertubation of the steady state + * initial condition is a Gaussian perturbation of the steady state * solution without advection * * u(0,x) = k1 * A / k4 + p(x) @@ -1730,7 +1730,7 @@ void InputError(char* name) * opt == 0 means the function allocates memory and returns a * pointer so check if a NULL pointer was returned * opt == 1 means the function returns an integer where a - * value < 0 indicates an error occured + * value < 0 indicates an error occurred * --------------------------------------------------------------*/ int check_retval(void* returnvalue, const char* funcname, int opt) { diff --git a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp index 63108a9bd2..5643211620 100644 --- a/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp +++ b/examples/arkode/CXX_parallel/ark_diffusion_reaction_p.cpp @@ -16,7 +16,7 @@ * u_t = Dux u_xx + Duy u_yy + A + u * u * v - (B + 1) * u * v_t = Dvx u_xx + Dvy u_yy + B * u - u * u * v * - * where u and v represent the concentrations of the two chemcial species, the + * where u and v represent the concentrations of the two chemical species, the * diffusion rates are Dux = Duy = Dvx = Dvy = 1e-3, and the species with * constant concentration over time are A = 1 and B = 3. * @@ -159,7 +159,7 @@ struct UserData bool reaction = true; // -------------------------- - // Discretization parameteres + // Discretization parameters // -------------------------- // Global and local number of nodes in the x and y directions @@ -228,7 +228,7 @@ struct UserData sunrealtype* SWsend = NULL; sunrealtype* NErecv = NULL; - // Recieve and send requests + // Receive and send requests MPI_Request reqRW, reqRE, reqRS, reqRN; MPI_Request reqSW, reqSE, reqSS, reqSN; MPI_Request reqRC, reqSC; @@ -307,7 +307,7 @@ struct UserData N_Vector diag = NULL; // inverse of Jacobian diagonal // --------------- - // Ouput variables + // Output variables // --------------- int output = 1; // 0 = no output, 1 = output stats, 2 = write to disk @@ -597,7 +597,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata.tf / udata.nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(&udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -2349,14 +2349,14 @@ static void InputHelp() << " --mri-cvode-local : use MRI with CVODE task-local stepper" << endl; cout << " --rtol_imex : IMEX relative tolerance" << endl; - cout << " --atol_imex : IMEX absoltue tolerance" << endl; + cout << " --atol_imex : IMEX absolute tolerance" << endl; cout << " --h_imex : IMEX fixed step size" << endl; cout << " --order_imex : IMEX method order" << endl; cout << " --rtol_slow : MRI slow relative tolerance" << endl; - cout << " --atol_slow : MRI slow absoltue tolerance" << endl; + cout << " --atol_slow : MRI slow absolute tolerance" << endl; cout << " --h_slow : MRI slow step size" << endl; cout << " --rtol_fast : MRI fast relative tolerance" << endl; - cout << " --atol_fast : MRI fast absoltue tolerance" << endl; + cout << " --atol_fast : MRI fast absolute tolerance" << endl; cout << " --h_fast : MRI fast step size" << endl; cout << " --controller : time step adaptivity" << endl; cout << " --nonlinear : nonlinearly implicit" << endl; @@ -2839,7 +2839,7 @@ static int OutputStatsMRICVODE(void* arkode_mem, MRIStepInnerStepper stepper, return 0; } -// Ouput timing stats +// Output timing stats static int OutputTiming(UserData* udata) { if (udata->outproc) diff --git a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp index 566a7a4b41..0bf8d97ba7 100644 --- a/examples/arkode/CXX_parallel/ark_heat2D_p.cpp +++ b/examples/arkode/CXX_parallel/ark_heat2D_p.cpp @@ -153,7 +153,7 @@ struct UserData sunrealtype* Ssend; sunrealtype* Nsend; - // Send requests for neighor exchange + // Send requests for neighbor exchange MPI_Request reqSW; MPI_Request reqSE; MPI_Request reqSS; @@ -180,7 +180,7 @@ struct UserData // Inverse of Jacobian diagonal for preconditioner N_Vector d; - // Ouput variables + // Output variables int output; // output level int nout; // number of output times ofstream uout; // output file stream @@ -486,7 +486,7 @@ int main(int argc, char* argv[]) sunrealtype dTout = udata->tf / udata->nout; sunrealtype tout = dTout; - // Inital output + // Initial output flag = OpenOutput(udata); if (check_flag(&flag, "OpenOutput", 1)) { return 1; } @@ -1576,7 +1576,7 @@ static void InputHelp() cout << " --noforcing : disable forcing term" << endl; cout << " --tf