From 4cc9ea9d95951d197136f3a8801e0c14bace9d26 Mon Sep 17 00:00:00 2001 From: "Daniel R. Reynolds" Date: Tue, 28 Nov 2023 11:26:39 -0600 Subject: [PATCH] Fixed compilation issue --- examples/ida/F2003_openmp/CMakeLists.txt | 28 ++++++++++--------- .../idaHeat2D_kry_omp_f2003_4.out | 24 ++++++++-------- .../idaHeat2D_kry_omp_f2003_8.out | 24 ++++++++-------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/examples/ida/F2003_openmp/CMakeLists.txt b/examples/ida/F2003_openmp/CMakeLists.txt index 47b1f7929c..852d1ac20a 100644 --- a/examples/ida/F2003_openmp/CMakeLists.txt +++ b/examples/ida/F2003_openmp/CMakeLists.txt @@ -20,8 +20,8 @@ # Examples using SUNDIALS linear solvers set(FIDA_examples_OMP - "idaHeat2D_kry_omp_f2003\;4\;develop" - "idaHeat2D_kry_omp_f2003\;8\;develop" + "idaHeat2D_kry_omp_f2003.f90\;4\;develop" + "idaHeat2D_kry_omp_f2003.f90\;8\;develop" ) # Specify libraries to link against @@ -37,14 +37,16 @@ foreach(example_tuple ${FIDA_examples_OMP}) list(GET example_tuple 1 example_args) list(GET example_tuple 2 example_type) - if(NOT TARGET ${example}) - # example source files - add_executable(${example} ${example}.f90) + # extract the file name without extension + get_filename_component(example_target ${example} NAME_WE) - set_target_properties(${example} PROPERTIES FOLDER "Examples") + if(NOT TARGET ${example_target}) + add_executable(${example_target} ${example}) + + set_target_properties(${example_target} PROPERTIES FOLDER "Examples") # libraries to link against - target_link_libraries(${example} + target_link_libraries(${example_target} sundials_ida sundials_fida_mod sundials_nvecopenmp @@ -52,27 +54,27 @@ foreach(example_tuple ${FIDA_examples_OMP}) ${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_target}.dir) endif() # check if example args are provided and set the test name if("${example_args}" STREQUAL "") - set(test_name ${example}) + set(test_name ${example_target}) else() - string(REGEX REPLACE " " "_" test_name ${example}_${example_args}) + string(REGEX REPLACE " " "_" test_name ${example_target}_${example_args}) endif() # add example to regression tests - sundials_add_test(${example} ${example} + sundials_add_test(${test_name} ${example_target} TEST_ARGS ${example_args} ANSWER_DIR ${CMAKE_CURRENT_SOURCE_DIR} - ANSWER_FILE ${example}.out + ANSWER_FILE ${test_name}.out EXAMPLE_TYPE ${example_type}) # install example source and out files if(EXAMPLES_INSTALL) - install(FILES ${example}.f90 ${example}.out + install(FILES ${example} ${example}.out DESTINATION ${EXAMPLES_INSTALL_PATH}/ida/F2003_opemp) endif() endforeach(example_tuple ${FIDA_examples_OMP}) diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out index a7be1240cc..c84da69e84 100644 --- a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_4.out @@ -22,12 +22,12 @@ Tolerance parameters: rtol = 0.0E+00 atol = 1.0E-03 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 - 0.32 1.41345E-02 1 64 105 530 105 530 2.76E-03 20 635 - 0.64 1.41279E-02 1 82 138 590 138 590 1.13E-01 37 728 - 1.28 1.82904E-02 1 86 144 615 144 615 1.97E-01 38 759 - 2.56 2.11107E-02 1 90 151 646 151 646 6.51E-01 39 797 - 5.12 3.15927E-02 1 94 160 663 160 663 1.69E+00 42 823 -10.24 4.33520E-02 1 100 171 691 171 691 9.06E-01 46 862 + 0.32 1.41347E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41331E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82940E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11147E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16023E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.32995E-02 1 100 171 691 171 691 9.06E-01 46 862 Error test failures = 3 Nonlinear convergence failures = 5 @@ -45,12 +45,12 @@ Linear convergence failures = 2 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 - 0.32 1.41345E-02 1 64 105 530 105 530 2.76E-03 20 635 - 0.64 1.41282E-02 1 82 138 590 138 590 1.13E-01 37 728 - 1.28 1.82906E-02 1 86 144 615 144 615 1.97E-01 38 759 - 2.56 2.11109E-02 1 90 151 646 151 646 6.51E-01 39 797 - 5.12 3.15933E-02 1 94 160 663 160 663 1.69E+00 42 823 -10.24 4.33486E-02 1 100 171 691 171 691 9.06E-01 46 862 + 0.32 1.41347E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41337E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82944E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11152E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.16035E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.32936E-02 1 100 171 691 171 691 9.06E-01 46 862 Error test failures = 3 Nonlinear convergence failures = 5 diff --git a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out index f6784b6156..986388a65a 100644 --- a/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out +++ b/examples/ida/F2003_openmp/idaHeat2D_kry_omp_f2003_8.out @@ -22,12 +22,12 @@ Tolerance parameters: rtol = 0.0E+00 atol = 1.0E-03 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 - 0.32 1.41348E-02 1 64 105 530 105 530 2.76E-03 20 635 - 0.64 1.41356E-02 1 82 138 590 138 590 1.13E-01 37 728 - 1.28 1.82958E-02 1 86 144 615 144 615 1.97E-01 38 759 - 2.56 2.11166E-02 1 90 151 646 151 646 6.51E-01 39 797 - 5.12 3.16071E-02 1 94 160 663 160 663 1.69E+00 42 823 -10.24 4.32754E-02 1 100 171 691 171 691 9.06E-01 46 862 + 0.32 1.41346E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41313E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82928E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11134E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.15991E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.33163E-02 1 100 171 691 171 691 9.06E-01 46 862 Error test failures = 3 Nonlinear convergence failures = 5 @@ -45,12 +45,12 @@ Linear convergence failures = 2 0.04 4.69419E-01 2 28 42 124 42 124 3.99E-03 11 166 0.08 2.44066E-01 2 35 57 192 57 192 1.01E-02 14 249 0.16 6.23528E-02 2 44 69 296 69 296 7.46E-03 14 365 - 0.32 1.41343E-02 1 64 105 530 105 530 2.76E-03 20 635 - 0.64 1.41212E-02 1 82 138 590 138 590 1.13E-01 37 728 - 1.28 1.82858E-02 1 86 144 615 144 615 1.97E-01 38 759 - 2.56 2.11055E-02 1 90 151 646 151 646 6.51E-01 39 797 - 5.12 3.15811E-02 1 94 160 663 160 663 1.69E+00 42 823 -10.24 4.34206E-02 1 100 171 691 171 691 9.06E-01 46 862 + 0.32 1.41342E-02 1 64 105 530 105 530 2.76E-03 20 635 + 0.64 1.41198E-02 1 82 138 590 138 590 1.13E-01 37 728 + 1.28 1.82848E-02 1 86 144 615 144 615 1.97E-01 38 759 + 2.56 2.11044E-02 1 90 151 646 151 646 6.51E-01 39 797 + 5.12 3.15787E-02 1 94 160 663 160 663 1.69E+00 42 823 +10.24 4.32463E-02 1 100 171 691 171 691 9.06E-01 46 862 Error test failures = 3 Nonlinear convergence failures = 5