-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'jgfouca/cmake_names_in_macros' into master (PR #6014)
Use CMake variables/names in our cmake macros This should be the last major PR in CMAKE V2 effort. Changes Summary: * Macro structure changes * Add post-process step to set final values for a few items * Make cmake conversion more robust by storing pre-macro values and comparing instead of just looking at new variables * Change all macros to set variables that cmake knows about! This is a huge change with wide impacts * We no longer have to set flag properties on all files. This simplifies things but makes it hard to support e3sm_remove_flags so that feature has been removed. You should always be able to append flags to achieve the same effect as removing a flag. * Try to remove as much of the linker flag micromanagement as possible * We now default to cxx linker. Intel and PGI still have to use fortran unfortunately since our main function is in fortran * Remove as many non-cmake settings as possible from the macros * Add script for converting macros from the old style to new style * Upgrade the compare-flags tool to support parsing the e3sm.bldlog file. This is a tougher way to compare flags since you have to build the cases with -j 1, but it's more robust than looking at cmake internal files. * Remove lots of unneeded stuff from main cmake files (build_model and common_setup) * Remove unused old makefiles for COSP and MPAS * Move gptl build to cmake Testing: * mappy_gnu: e3sm_developer, with full flag compare on a couple big cases * anlgce: e3sm_developer builds * pm-cpu_intel: e3sm_developer, with full flag compare on one big case * chrysalis_intel: e3sm_developer, with full flag compare on one big case * summit: build one big case with pgigpu, ibmgpu, pgi [BFB]
- Loading branch information
Showing
156 changed files
with
1,362 additions
and
2,013 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cmake_policy(SET CMP0057 NEW) | ||
cmake_minimum_required(VERSION 3.5) | ||
project(cime LANGUAGES C Fortran) | ||
include(../Macros.cmake) | ||
include(${CMAKE_CURRENT_BINARY_DIR}/../Macros.cmake) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
if (DEBUG) | ||
string(APPEND CFLAGS " -O0 -g") | ||
string(APPEND FFLAGS " -O0 -g") | ||
string(APPEND CXXFLAGS " -O0 -g") | ||
string(APPEND CPPDEFS " -DYAKL_DEBUG") | ||
endif() | ||
string(APPEND CMAKE_C_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CPPDEFS_DEBUG " -DYAKL_DEBUG") | ||
if (compile_threaded) | ||
string(APPEND FFLAGS " -fopenmp") | ||
string(APPEND CFLAGS " -fopenmp") | ||
string(APPEND CXXFLAGS " -fopenmp") | ||
string(APPEND LDFLAGS " -fopenmp") | ||
string(APPEND CMAKE_Fortran_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_C_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_CXX_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fopenmp") | ||
endif() | ||
string(APPEND CPPDEFS " -DNO_R16 -DCPRAMD -DFORTRANUNDERSCORE") | ||
string(APPEND FFLAGS_NOOPT " -O0") | ||
set(HAS_F2008_CONTIGUOUS "FALSE") | ||
set(MPICC "cc") | ||
set(MPICXX "CC") | ||
set(MPIFC "ftn") | ||
set(SUPPORTS_CXX "TRUE") | ||
set(CXX_LINKER "FORTRAN") | ||
string(APPEND CXX_LIBS " -lstdc++") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
if (COMP_NAME STREQUAL gptl) | ||
string(APPEND CPPDEFS " -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY") | ||
endif() | ||
if (NOT DEBUG) | ||
string(APPEND CFLAGS " -O2 -g") | ||
string(APPEND CXXFLAGS " -O2 -g") | ||
string(APPEND FFLAGS " -O2 -g") | ||
endif() | ||
string(APPEND CMAKE_C_FLAGS_RELEASE " -O2 -g") | ||
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -O2 -g") | ||
string(APPEND CMAKE_Fortran_FLAGS_RELEASE " -O2 -g") | ||
#string(APPEND FFLAGS " -march=znver3") | ||
set(SCC "clang") | ||
set(SCXX "clang++") | ||
set(SFC "flang") | ||
|
||
if (COMP_NAME STREQUAL cism) | ||
string(APPEND CMAKE_OPTS " -D CISM_GNU=ON") | ||
endif() | ||
|
||
string(APPEND FC_AUTO_R8 " -fdefault-real-8") | ||
string(APPEND FFLAGS " -Mflushz ") | ||
string(APPEND FIXEDFLAGS " -Mfixed") | ||
string(APPEND FREEFLAGS " -Mfreeform") | ||
string(APPEND CMAKE_Fortran_FLAGS " -Mflushz ") | ||
string(APPEND CMAKE_Fortran_FORMAT_FIXED_FLAG " -Mfixed") | ||
string(APPEND CMAKE_Fortran_FORMAT_FREE_FLAG " -Mfreeform") | ||
if (compile_threaded) | ||
string(APPEND FFLAGS " -mp") | ||
string(APPEND LDFLAGS " -mp") | ||
string(APPEND CMAKE_Fortran_FLAGS " -mp") | ||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -mp") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,18 @@ | ||
if (COMP_NAME STREQUAL gptl) | ||
string(APPEND CPPDEFS " -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY") | ||
endif() | ||
if (NOT DEBUG) | ||
string(APPEND CFLAGS " -O2 -g") | ||
string(APPEND CXXFLAGS " -O2 -g") | ||
string(APPEND FFLAGS " -O2") | ||
endif() | ||
string(APPEND CMAKE_C_FLAGS_RELEASE " -O2 -g") | ||
string(APPEND CMAKE_CXX_FLAGS_RELEASE " -O2 -g") | ||
string(APPEND CMAKE_Fortran_FLAGS_RELEASE " -O2") | ||
#string(APPEND FFLAGS " -march=znver3") | ||
set(SCC "clang") | ||
set(SCXX "clang++") | ||
set(SFC "flang") | ||
|
||
if (COMP_NAME STREQUAL cism) | ||
string(APPEND CMAKE_OPTS " -D CISM_GNU=ON") | ||
endif() | ||
|
||
string(APPEND FC_AUTO_R8 " -fdefault-real-8") | ||
string(APPEND FFLAGS " -Mflushz ") | ||
string(APPEND FIXEDFLAGS " -Mfixed") | ||
string(APPEND FREEFLAGS " -Mfreeform") | ||
string(APPEND CMAKE_Fortran_FLAGS " -Mflushz ") | ||
string(APPEND CMAKE_Fortran_FORMAT_FIXED_FLAG " -Mfixed") | ||
string(APPEND CMAKE_Fortran_FORMAT_FREE_FLAG " -Mfreeform") | ||
if (compile_threaded) | ||
string(APPEND FFLAGS " -mp") | ||
string(APPEND LDFLAGS " -mp") | ||
string(APPEND CMAKE_Fortran_FLAGS " -mp") | ||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -mp") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,17 @@ | ||
if (DEBUG) | ||
string(APPEND CFLAGS " -O0 -g") | ||
string(APPEND FFLAGS " -O0 -g") | ||
string(APPEND CXXFLAGS " -O0 -g") | ||
string(APPEND CPPDEFS " -DYAKL_DEBUG") | ||
endif() | ||
string(APPEND CMAKE_C_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CMAKE_Fortran_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -O0 -g") | ||
string(APPEND CPPDEFS_DEBUG " -DYAKL_DEBUG") | ||
if (compile_threaded) | ||
string(APPEND FFLAGS " -fopenmp") | ||
string(APPEND CFLAGS " -fopenmp") | ||
string(APPEND CXXFLAGS " -fopenmp") | ||
string(APPEND LDFLAGS " -fopenmp") | ||
string(APPEND CMAKE_Fortran_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_C_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_CXX_FLAGS " -fopenmp") | ||
string(APPEND CMAKE_EXE_LINKER_FLAGS " -fopenmp") | ||
endif() | ||
string(APPEND CPPDEFS " -DNO_R16 -DCPRAMD -DFORTRANUNDERSCORE") | ||
string(APPEND FFLAGS_NOOPT " -O0") | ||
set(HAS_F2008_CONTIGUOUS "FALSE") | ||
set(MPICC "cc") | ||
set(MPICXX "CC") | ||
set(MPIFC "ftn") | ||
set(SCC "cc") | ||
set(SCXX "CC") | ||
set(SFC "ftn") | ||
set(SUPPORTS_CXX "TRUE") | ||
set(CXX_LINKER "FORTRAN") | ||
string(APPEND CXX_LIBS " -lstdc++") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.