Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cmake build #48

Merged
merged 26 commits into from
Jun 21, 2024
Merged

Update cmake build #48

merged 26 commits into from
Jun 21, 2024

Conversation

jedwards4b
Copy link
Contributor

testing new github testing

@jedwards4b jedwards4b self-assigned this Jun 19, 2024
@jedwards4b
Copy link
Contributor Author

@billsacks Would you review this PR and also have a look at the unit tests.

@billsacks
Copy link
Member

For now I'll document what I did and the problems I ran into. My plate is full between now and the end of June with things needed for the CESM3 science feature freeze and the upcoming ESMF release, so I won't have time before then to do more work on this - but we can circle back to this in July if you'd like to work together on it then and/or want more than a cursory review from me. (But note that I'll be gone the first and third weeks of July).

You may already know this, but the process for running these unit tests is kind of awkward - at least the process I'm aware of: the top level CMakeLists.txt file actually resides in CIME, so you need a model checkout that includes CIME and maybe some other things along with CESM_share. (See also #18 , #19 and #20 .) What I did just now was to use a CTSM checkout. Then from cime, I ran:

scripts/fortran_unit_testing/run_tests.py --build-dir `mktemp -d ./unit_test_temp.XXXXXX`

Doing this from the latest CTSM, with its out-of-the-box externals, the share tests passed.

Updating to your branch, I got these errors:

CMake Error at /Users/sacks/ctsm/ctsm0/share/src/CMakeLists.txt:23 (include):
  include could not find requested file:

    /Users/sacks/ctsm/ctsm0/cime/unit_test_temp.GTOvF8/__command_line_test__/__command_line_test__/share_src/genf90/src/genf90/CMake/genf90_utils.cmake


CMake Error at CMakeLists.txt:45 (add_subdirectory):
  add_subdirectory given source
  "/Users/sacks/ctsm/ctsm0/share/esmf_wrf_timemgr" which is not an existing
  directory.


CMake Error at CIME/non_py/src/CMake/Sourcelist_utils.cmake:105 (message):
  Source file not found: shr_kind_mod.F90

  After searching in list:
Call Stack (most recent call first):
  /Users/sacks/ctsm/ctsm0/share/test/unit/shr_abort_test/CMakeLists.txt:9 (extract_sources)


-- Configuring incomplete, errors occurred!' from dir '/Users/sacks/ctsm/ctsm0/cime/unit_test_temp.GTOvF8/__command_line_test__/__command_line_test__'

I assume this is from some moved / removed files?

Regarding the esmf_wrf_timemgr, we'd like to stop using it, but I think that doing so requires getting the value of ESMFMKFILE for the given machine/compiler in the CMake unit test build - see ESCOMP/CTSM#2375. I haven't spent much time on this, but if you know off-hand how to do this, that could help move us forward on switching over to using the actual ESMF library in the unit tests instead of esmf_wrf_timemgr. (@ekluzek @samsrabin and @adrifoster might also be interested in this.)

@jedwards4b
Copy link
Contributor Author

If you load the ESMF module ESMFMKFILE is defined in the environment.

@jedwards4b
Copy link
Contributor Author

 ESMF_ROOT=$NCAR_ROOT_ESMF ./scripts/fortran_unit_testing/run_tests.py --build-dir `pwd`/ftest 
Compiler is intel
Using PFUNIT_PATH: /glade/campaign/cesm/cesmdata/tools/pFUnit/pFUnit4.8.0_derecho_Intel2023.2.1_noMPI_noOpenMP
==================================================
Running cmake for __command_line_test__/__command_line_test__.
==================================================
==================================================
Running make for __command_line_test__/__command_line_test__.
==================================================
==================================================
Running CTest tests for __command_line_test__/__command_line_test__.
==================================================
Running 'ctest --output-on-failure'
Test project /glade/work/jedwards/sandboxes/cesm3_0_x/cime/ftest/__command_line_test__/__command_line_test__
      Start  1: shr_abort_mod
 1/12 Test  #1: shr_abort_mod ....................   Passed    0.29 sec
      Start  2: assert
 2/12 Test  #2: assert ...........................   Passed    0.03 sec
      Start  3: spfn
 3/12 Test  #3: spfn .............................   Passed    0.03 sec
      Start  4: infnan
 4/12 Test  #4: infnan ...........................   Passed    0.02 sec
      Start  5: shr_string
 5/12 Test  #5: shr_string .......................   Passed    0.03 sec
      Start  6: shr_strconvert
 6/12 Test  #6: shr_strconvert ...................   Passed    0.03 sec
      Start  7: shr_log
 7/12 Test  #7: shr_log ..........................   Passed    0.03 sec
      Start  8: dynamic_vector
 8/12 Test  #8: dynamic_vector ...................   Passed    0.04 sec
      Start  9: vmath
 9/12 Test  #9: vmath ............................   Passed    0.10 sec
      Start 10: shr_wv_sat_mod
10/12 Test #10: shr_wv_sat_mod ...................   Passed    0.03 sec
      Start 11: shr_precip_mod
11/12 Test #11: shr_precip_mod ...................   Passed    0.03 sec
      Start 12: shr_cal_mod
12/12 Test #12: shr_cal_mod ......................   Passed    0.28 sec

100% tests passed, 0 tests failed out of 12

Total Test time (real) =   0.95 sec

All unit tests are now working again.

@billsacks
Copy link
Member

Awesome, thank you very much @jedwards4b !!!

@jedwards4b jedwards4b merged commit a28c9f4 into ESCOMP:main Jun 21, 2024
1 check passed
@jedwards4b jedwards4b deleted the update_cmake_build branch June 21, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants