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

Add switch for each executable not to compile unnecessary executables #56

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 89 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,29 @@ option(OPENMP "Enable OpenMP Threading" ON)
# Echo user options
message(STATUS "OPENMP ................. ${OPENMP}")

option(FV3_ENSMEAN_RECENTER "Enable building FV3_ensmean_recenter.fd" ON)
option(ADJUST_SOILTQ "Enable building adjust_soiltq.fd" ON)
option(BLENDING "Enable building blending.fd" ON)
option(BUFRSND "Enable building bufrsnd.fd" ON)
option(CLOUDANALYSIS "Enable building cloudanalysis.fd" ON)
option(ENS_MEAN_RECENTER "Enable building ens_mean_recenter.fd" ON)
option(GEN_CS "Enable building gen_cs.fd" ON)
option(LAKESURGERY "Enable building lakesurgery.fd" ON)
option(LARCCLD "Enable building larccld.fd" ON)
option(LIGHTNING "Enable building lightning.fd" ON)
option(METARCLD "Enable building metarcld.fd" ON)
option(MOSAIC "Enable building mosaic.fd" ON)
option(PM "Enable building pm.fd" ON)
option(RADMON "Enable building radmon.fd" ON)
option(REF2TTEN "Enable building ref2tten.fd" ON)
option(RTMA_MINMAXTRH "Enable building rtma_minmaxtrh.fd" ON)
option(UPDATE_BC "Enable building update_bc.fd" ON)
option(UPDATE_GVF "Enable building update_gvf.fd" ON)
option(UPDATE_ICE "Enable building update_ice.fd" ON)
option(UPDATE_SNOW "Enable building update_snow.fd" ON)
option(UPDATE_SST "Enable building update_sst.fd" ON)
option(USE_RAPHRRR_SFC "Enable building use_raphrrr_sfc.fd" ON)

# Dependencies
find_package(MPI REQUIRED)
find_package(NetCDF REQUIRED Fortran)
Expand All @@ -56,26 +79,70 @@ find_package(gsi REQUIRED)

add_subdirectory(baselib/regional_esg_grid.fd)
add_subdirectory(baselib)
add_subdirectory(mosaic)
add_subdirectory(lightning)
add_subdirectory(ref2tten)
add_subdirectory(cloudanalysis)
add_subdirectory(larccld)
add_subdirectory(metarcld)
add_subdirectory(update_sst)
add_subdirectory(use_raphrrr_sfc)
add_subdirectory(update_gvf)
add_subdirectory(update_snow)
add_subdirectory(update_ice)
add_subdirectory(lakesurgery)
add_subdirectory(gen_cs)
add_subdirectory(adjust_soiltq)
add_subdirectory(update_bc)
add_subdirectory(ens_mean_recenter)
add_subdirectory(FV3_ensmean_recenter)
add_subdirectory(bufrsnd)
add_subdirectory(radmon)
add_subdirectory(rtma_minmaxtrh)
add_subdirectory(pm)
add_subdirectory(blending)
if(FV3_ENSMEAN_RECENTER)
add_subdirectory(FV3_ensmean_recenter.fd)
endif()
if(ADJUST_SOILTQ)
add_subdirectory(adjust_soiltq.fd)
endif()
if(BLENDING)
add_subdirectory(blending.fd)
endif()
if(BUFRSND)
add_subdirectory(bufrsnd.fd)
endif()
if(CLOUDANALYSIS)
add_subdirectory(cloudanalysis.fd)
endif()
if(ENS_MEAN_RECENTER)
add_subdirectory(ens_mean_recenter.fd)
endif()
if(GEN_CS)
add_subdirectory(gen_cs.fd)
endif()
if(LAKESURGERY)
add_subdirectory(lakesurgery.fd)
endif()
if(LARCCLD)
add_subdirectory(larccld.fd)
endif()
if(LIGHTNING)
add_subdirectory(lightning.fd)
endif()
if(METARCLD)
add_subdirectory(metarcld.fd)
endif()
if(MOSAIC)
add_subdirectory(mosaic.fd)
endif()
if(PM)
add_subdirectory(pm.fd)
endif()
if(RADMON)
add_subdirectory(radmon.fd)
endif()
if(REF2TTEN)
add_subdirectory(ref2tten.fd)
endif()
if(RTMA_MINMAXTRH)
add_subdirectory(rtma_minmaxtrh.fd)
endif()
if(UPDATE_BC)
add_subdirectory(update_bc.fd)
endif()
if(UPDATE_GVF)
add_subdirectory(update_gvf.fd)
endif()
if(UPDATE_ICE)
add_subdirectory(update_ice.fd)
endif()
if(UPDATE_SNOW)
add_subdirectory(update_snow.fd)
endif()
if(UPDATE_SST)
add_subdirectory(update_sst.fd)
endif()
if(USE_RAPHRRR_SFC)
add_subdirectory(use_raphrrr_sfc.fd)
endif()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chan-hoo Thanks a lot for making these changes!! A function we've been waiting for!

I have a comment to add a top-level option such as "RRFS_UTL_ALL" which can turn on/off building all executables except those explicitly set in the cmake command line.
Changes are in this PR to your fork:
chan-hoo#1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guoqing-noaa, thanks for the PR. Merged.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chan-hoo Thanks for merging the changes!


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.