Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TYPE: new feature KEYWORDS: CMake, build, make SOURCE: internal DESCRIPTION OF CHANGES: Problem: The current WRF build system is fragile with many pitfalls making it difficult for users to build & add to it without perpetuating existing problems. Many options exist across various layers of files, languages, and option control-flow. Solution: *This requires CMake version 3.20 or newer* A redesign of the build system from the ground up, maintaining the interfacing feel and knowledge accumulated in `arch/configure.defaults`. Condense option selection and control to single locations and as best as possible reduce the complexity of this control. This will be a work in progress as gaps are identified in reproducing the full functionality of the makefile build system. Currently only `em_real` and `em_ideal` have limited supported Brief how to use: As this is a work in progress, the original `configure` and `compile` scripts have been left as-is. Alongside them are now `configure_new` and `compile_new` which walk a user through a slightly similar experience of configuring & compiling WRF. A simple usage example would be: ```bash # Ensure you have cmake 3.20+ and configuration environment set up ./configure_new # Follow prompts to select configuration ./compile_new [-j N] ``` Notable differences are : * Submodule code must be checked out beforehand and is not checked out during the compile process * Stanzas presented to a user are only those for which the compiler exists in the current environment * `!!` warnings appear for subconfigurations (MPI) that would not be supported in the current environment * DM/SM selection is now done after selecting a base configuration rather than an individual configuration # within a family of compilers * Compilation via `compile_new` does not take target to build as an argument - parallel `-j N` jobs still supported * Users do not need to set `NETCDF` or `LD_LIBRARY_PATH` variables * Base binaries do not have `.exe` extension, but symlinks are provided * Binaries, test setups, and everything else generated from compilation is copy-placed (not softlinked) to a separate location - default is `./install`. This means the equivalent `test/em_real/wrf.exe` is now at `install/test/em_real/wrf.exe` LIST OF MODIFIED FILES: A CMakeLists.txt A arch/configure_reader.py A chem/CMakeLists.txt A cleanCMake.sh A cmake/c_preproc.cmake A cmake/confcheck.cmake A cmake/gitinfo.cmake A cmake/m4_preproc.cmake A cmake/modules/FindJasper.cmake A cmake/modules/FindRPC.cmake A cmake/modules/FindnetCDF-Fortran.cmake A cmake/modules/FindnetCDF.cmake A cmake/modules/FindpnetCDF.cmake A cmake/printOption.cmake A cmake/target_copy.cmake A cmake/template/WRFConfig.cmake.in A cmake/template/arch_config.cmake A cmake/template/commit_decl.cmake A cmake/wrf_case_setup.cmake A cmake/wrf_get_version.cmake A compile_new A confcheck/CMakeLists.txt A configure_new A dyn_em/CMakeLists.txt A external/CMakeLists.txt A external/RSL_LITE/CMakeLists.txt A external/atm_ocn/CMakeLists.txt A external/esmf_time_f90/CMakeLists.txt A external/fftpack/fftpack5/CMakeLists.txt A external/io_adios2/CMakeLists.txt A external/io_esmf/CMakeLists.txt A external/io_grib1/CMakeLists.txt A external/io_grib1/MEL_grib1/CMakeLists.txt A external/io_grib1/WGRIB/CMakeLists.txt A external/io_grib1/grib1_util/CMakeLists.txt A external/io_grib2/CMakeLists.txt A external/io_grib2/bacio-1.3/CMakeLists.txt A external/io_grib2/g2lib/CMakeLists.txt A external/io_grib2/g2lib/utest/CMakeLists.txt A external/io_grib_share/CMakeLists.txt A external/io_int/CMakeLists.txt A external/io_netcdf/CMakeLists.txt A external/io_netcdfpar/CMakeLists.txt A external/io_phdf5/CMakeLists.txt A external/io_pio/CMakeLists.txt A external/io_pnetcdf/CMakeLists.txt A external/ioapi_share/CMakeLists.txt A frame/CMakeLists.txt A inc/CMakeLists.txt A main/CMakeLists.txt A phys/CMakeLists.txt A share/CMakeLists.txt A test/em_b_wave/CMakeLists.txt A test/em_convrad/CMakeLists.txt A test/em_fire/CMakeLists.txt A test/em_grav2d_x/CMakeLists.txt A test/em_heldsuarez/CMakeLists.txt A test/em_hill2d_x/CMakeLists.txt A test/em_les/CMakeLists.txt A test/em_quarter_ss/CMakeLists.txt A test/em_real/CMakeLists.txt A test/em_scm_xy/CMakeLists.txt A test/em_seabreeze2d_x/CMakeLists.txt A test/em_squall2d_x/CMakeLists.txt A test/em_squall2d_y/CMakeLists.txt A test/em_tropical_cyclone/CMakeLists.txt A tools/CMakeLists.txt A tools/CodeBase/CMakeLists.txt A doc/README.cmake_build M tools/fseek_test.c M README M arch/configure.defaults - Modified file include an adjustment to a compile test to allow the test to be conducted in an out-of-source build manner as prescribed by CMake. Default logic of this test to still test on the existence of `Makefile` TESTS CONDUCTED: 1. In various instances this build is faster and more reliable with meaningful diagnostics when errors occur RELEASE NOTE: Introduction of a CMake build system for em_real and em_ideal
- Loading branch information