-
Notifications
You must be signed in to change notification settings - Fork 64
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
Merge feature/capgen into main 2021/08/12 #391
Merged
climbfuji
merged 172 commits into
NCAR:main
from
climbfuji:merge_feature_capgen_into_main_20210812
Aug 18, 2021
Merged
Changes from 163 commits
Commits
Show all changes
172 commits
Select commit
Hold shift + click to select a range
de57a40
init my_co and use in run
cacraigucar f5bfebc
removed some unnecessary files from the build
fvitt f5bf5b1
Merge pull request #1 from fvitt/cac_devel
cacraigucar 9090172
works but verbose
cacraigucar 57cfbee
cleanup and still using scm
cacraigucar edf9c3a
one more commit
cacraigucar e8280c9
add MICM as model
cacraigucar d7a5e05
add scripts/ccpp_prebuild_config_MICM.py
cacraigucar 09d17dd
simple1
cacraigucar 34cd5aa
change from micm to ibox for driver code
cacraigucar 697e8af
Added kinetics
cacraigucar 313893e
Remove ccpp_physics and replace with MICM_chemistry
cacraigucar a2bf736
Merge branch 'xx2' into cac_devel
cacraigucar 8846206
change type_def filenames
cacraigucar 8bab3c4
remove mimc_type_def file
cacraigucar db2f9c7
additional script cleanup
cacraigucar a35bb09
renamed ibox_type_defs file to ibox_var_defs
cacraigucar cbed34b
updates to support Stacy's Object-Oriented code
cacraigucar faf5dee
Updated to MusicBox
cacraigucar 4363810
Using MusicBox_host directory
cacraigucar e4cfe16
kinetics_module is now named "kinetics_module.F90"
fvitt 5a2a20c
Merge pull request #2 from fvitt/kinetics
cacraigucar ddc2a32
Renamed the host model variable file
cacraigucar d4ed074
Adding Kessler
cacraigucar 59c0091
Update to ccpp-framework V2
cacraigucar 153c38e
Merge remote-tracking branch 'origin/cleanup_ccpp-frame006'
cacraigucar 57933fc
Update to CCPP V2
cacraigucar 68497e1
Add k_rateConst_terminator
cacraigucar e40ee27
Allow both 3component and terminator chemistry to be run
cacraigucar 4fe54af
Using chemistry_driver as interface to CCPP
cacraigucar cfd4eee
Move json reading to MICM library
cacraigucar 0bf217d
Bring in TUV
fvitt 22b2c26
Merge pull request #3 from fvitt/tuv_ccpp-frame015
cacraigucar 665d12d
Cleanup
cacraigucar 5058dd2
add mass scheme code
fvitt 93eb876
Merge pull request #4 from fvitt/mass_ccpp-frame017
cacraigucar ce2d500
Moved generated code and partial creation of user-defined
cacraigucar 194ab0a
Generate caps for MOZART and Rosenbrock chem drivers; misc cleanup
fvitt e1de664
Merge pull request #5 from fvitt/ccpp-frame019_solver
cacraigucar 7ac530b
Single script works for all MusicBox runs
cacraigucar 40a6605
First pass at working ccpp_capgen using version 2 metadata
5a5b3fe
Working on restoring scalar ref code
2784eea
Fix parsing Fortran files with blank lines at top
0d7e1cd
Still working on array references as local names
efc7281
Fix checking of Fortran references
11629a5
Separate schemes for TUV photolysis
fvitt 3671411
Add DDT use statements
82d2211
Merge pull request #6 from fvitt/tuv_refactor
cacraigucar 63cf591
Generate unique names for group dummy arguments with duplicate local …
33d58fc
Allow comment at end of type def line
a82d17a
First pass at a tool to create a prototype metadata table from a Fort…
fe08262
Fix some python3 issues, also start work on size as a dimension
406c82d
Improved ccpp_fortran_to_metadata interface and dimension size check.
4beed39
Fix bug where errflg does not cause return
35ae517
Fix Fortran compare by fixing find_local_name
f539aed
Change vertical_level_x to vertical_interface_x
266937a
Improve intent error message
e541b84
- Add README.md with instructions on how to run ccpp_capgen.py and th…
796976a
- Add sample_files directory to hold test files
8952f05
- Addd new sample files and tests for
6a3ad18
Add instructions to get test coverage.
2cb82d8
Address Steve Goldhaber's comments:
5779731
Add failing test for missing 'intent'
8f3dfb2
Use title list without converting to string to avoid corruption
88a78df
Remove "/" and ".." from path names.
054f98d
Merge pull request #234 from JulieSchramm/feature/capgen
78593ad
Fix problem with intent mismatch when host is passing horizontal_loop…
0257381
Add use statements for DDTs passed as host model arguments.
31944d6
Fix missing intent test (improved but changed error message)
f07cc9d
Allow validate_xml_file to take path to schema location
549e1c1
Merge pull request #237 from gold2718/new_metadata_parser
759aa32
Add Metadata Table unit tests for:
be4c1a4
- Shortened sample test files by removing entries after the error
e54a136
- Add test for bad ccpp-arg-table header in first table
99b5e23
Add expected error message.
178906c
Merge pull request #253 from JulieSchramm/feature/capgen
bad3f9e
Fix and check full python 3 functionality.
c7f1d8c
Fix test exception message
c5534f4
Merge pull request #258 from gold2718/new_metadata_parser
815f089
Improvement in standard name documentation
86880f5
Start on datafile module
fa6fce0
Minor additions
f4cf769
small progress
eda2b1f
Restored capfiles.txt functionality, on to schemes and the rest
979d188
Fix issue with missing host-name and issue with capgen test
47ac41b
Updated SDF schema to allow for process_split, time_split, and subcol…
803ae9a
Add process keyword to scheme table header. Fix bugs
e671c02
Fix more cases of intent mismatch
0dceace
Working on adding schemes to datatable
ce380a9
Added schemes to datatable and process-list to reports
0808a98
Added module list report generator
b864e16
Merge pull request #265 from gold2718/capgen
0405c76
Removed standard names dictionary, moved to ESCOMP/CCPPStandardNames …
79847f9
Wrote tests for inspection routines which found errors in inspection …
2f36195
More interface test and improved python interface
8fc9afe
python2 fix and pylint improvements
70e2b1f
Merge pull request #273 from gold2718/capgen
175527a
Merge remote-tracking branch 'upstream/capgen' into enter_units
cacraigucar 3fd210e
fix enter_units to be one word
cacraigucar 67b90cc
remove extraneous files
cacraigucar 7492b04
Merge pull request #31 from cacraigucar/enter_units
gold2718 9e0b8d6
Fix documentation
06675fd
Fix documentation
cacraigucar 1574e3e
Fix documentation
42921c0
Fix typo in error message
612652f
Fix missing use statement and add regression test
d325efd
Fix missing use statement
1949d4b
Merge pull request #286 from gold2718/capgen
07580d7
Initial commit of unit testing for capgen parse_scheme_files function.
48e4713
Merge pull request #300 from JulieSchramm/feature/capgen
climbfuji 9ca5299
Modifications to capgen unit tests to get the perfect rating:
722c4b6
Merge pull request #302 from JulieSchramm/feature/capgen
e3e6b20
- Test that a missing metadata header is correctly detected
d472520
- Add pylint command to README.md file
d6b1293
Merge pull request #304 from JulieSchramm/feature/capgen
climbfuji 9e52e26
- Add test for correct detection of a variable that remains in the su…
2620368
Merge pull request #315 from JulieSchramm/feature/capgen
climbfuji d0e782d
Add 4 more pre-processor directive unit tests to test_metadata_scheme…
f56c96c
Fix arrayspec error message when Fortran has more items than metadata…
1124fce
Merge pull request #320 from JulieSchramm/feature/capgen
climbfuji 79d333a
Merge pull request #321 from gold2718/capgen
climbfuji ff34ca3
Updates to test_metadata_scheme_file.py:
e7c07b3
Remove dependencies= from *.meta files in sample_scheme_files directory.
af28719
Merge pull request #323 from JulieSchramm/feature/capgen
climbfuji 25eb54d
Update 20 tests in test_metadata_table.py and the coresponding *.meta…
a6cb08d
Merge pull request #331 from JulieSchramm/feature/capgen
climbfuji 014edd6
Add more tests for ccpp-table-properties:
900203d
Set up failing test_dependencies_rel_path test that fails with
f4305a7
Correctly handle multiple instances of dependencies keyword in table …
climbfuji 5da79a0
Adjust tests and error messages, some pylint improvements
d61afca
Merge pull request #334 from gold2718/capgen
7af7ed1
Merge branch 'feature/capgen' of https://github.com/NCAR/ccpp-framewo…
93c9d8e
Fix test to correctly detect all dependencies read in from 2 separate…
58f2cb9
Add test for missing units attribute.
91939e3
Rename two tests for clarity, modify test_metadata_table.py accordingly:
e895687
Merge pull request #335 from JulieSchramm/feature/capgen
climbfuji 6fd9bdd
Added ability to handle directories and wildcards
667dd62
Only overwrite modified files
ea752e3
Merge pull request #339 from gold2718/capgen
f8acc34
Replace old .travis.yml with new version to run capgen unit tests.
765efbc
Fix path in pylint test
4d33670
Remove python versions 3.4 and 3.5 that return an error
8284e94
Add more developers to notification list for success/failure.
64e0814
Merge pull request #340 from JulieSchramm/feature/capgen
ligiabernardet 322cade
Start on advected species implementation and test
2ddedbe
Merge pull request #347 from gold2718/capgen
dbb89fd
Implementation of metadata-based constituent interface to host models.
57c1b6a
Fixes for python 2 compatibility
4506718
Merge pull request #355 from gold2718/capgen
88c5616
python 2 support fix
363097a
Unit attribute cannot be empty
climbfuji fe0ba12
Add doc test for missing units attribute
climbfuji 7660e1b
Remove @grantfirl and @llpcarson from CODEOWNERS for feature/capgen b…
climbfuji f3bcd08
Merge pull request #374 from gold2718/capgen
3d5e8b9
Merge branch 'feature/capgen' of https://github.com/ncar/ccpp-framewo…
climbfuji da8a725
Merge pull request #375 from climbfuji/do_not_allow_empty_units
climbfuji 572ef3e
Changed ddt_type metadata keyword to just type.
ab99876
Fix typo in method doc string
da063f9
Merge pull request #383 from gold2718/capgen
010e47d
Merge branch 'feature/capgen' of https://github.com/NCAR/ccpp-framewo…
climbfuji 0e1230e
Clean up, revert unintended changes
climbfuji 7c8b9cc
More cleanup, move workarounds from capgen scripts to ccpp_prebuild s…
climbfuji 24e6f72
Update .github/workflows/python.yaml and tests/test_metadata_parser.p…
climbfuji 6d9ca4a
Fix parsing of dependencies
eb4f5be
Merge pull request #395 from gold2718/capgen
climbfuji e91b2a4
Merge branch 'feature/capgen' of https://github.com/NCAR/ccpp-framewo…
climbfuji 53aa9dc
Update of scripts/metadata_table.py and scripts/parse_tools/parse_che…
climbfuji a307587
Remove another legacy block of code in scripts/metavar.py
climbfuji 13ec708
Update example metadata table in documentation in scripts/metadata_ta…
climbfuji eebebe6
Update true/false logic and add active attribute in scripts/metavar.py
climbfuji 47ec077
Merge pull request #396 from climbfuji/active_attribute_true_false_me…
climbfuji 0e09eef
Merge branch 'feature/capgen' of https://github.com/NCAR/ccpp-framewo…
climbfuji File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### Summary of Issue: | ||
### Expected behavior and actual behavior: | ||
### Steps to reproduce the problem (should include model description file(s) or link to publi c repository): | ||
### What is the changeset ID of the code, and the machine you are using: | ||
### have you modified the code? If so, it must be committed and available for testing: | ||
### Screen output or log file showing the error message and context: |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[ 50 character, one line summary ] | ||
|
||
[ Description of the changes in this commit. It should be enough | ||
information for someone not following this development to understand. | ||
Lines should be wrapped at about 72 characters. ] | ||
|
||
User interface changes?: [ No/Yes ] | ||
[ If yes, describe what changed, and steps taken to ensure backward compatibilty ] | ||
|
||
Fixes: [Github issue #s] And brief description of each issue. | ||
|
||
Testing: | ||
test removed: | ||
unit tests: | ||
system tests: | ||
manual testing: | ||
|
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
language: python | ||
|
||
python: | ||
- "2.7" | ||
- "3.6" | ||
- "3.7" | ||
|
||
branches: | ||
only: | ||
- feature/capgen | ||
|
||
install: | ||
- pip install pylint | ||
|
||
script: | ||
- env PYTHONPATH=scripts:${PYTHONPATH} pylint --rcfile ./test/.pylintrc ./test/unit_tests/test_metadata_table.py | ||
- env PYTHONPATH=scripts:${PYTHONPATH} pylint --rcfile ./test/.pylintrc ./test/unit_tests/test_metadata_scheme_file.py | ||
- python test/unit_tests/test_metadata_table.py | ||
- python test/unit_tests/test_metadata_scheme_file.py | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
# - [email protected] | ||
- [email protected] | ||
# - [email protected] | ||
on_success: always # default: change | ||
on_failure: always # default: always |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
build |
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 |
---|---|---|
@@ -0,0 +1,189 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
PROJECT(HelloWorld) | ||
ENABLE_LANGUAGE(Fortran) | ||
|
||
include(CMakeForceCompiler) | ||
|
||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules) | ||
|
||
#----------------------------------------------------------------------------- | ||
# | ||
# Create list of SCHEME_FILES, HOST_FILES, and SUITE_FILES | ||
# Paths should be relative to CMAKE_SOURCE_DIR (this file's directory) | ||
# | ||
#----------------------------------------------------------------------------- | ||
SET(SCHEME_FILES "hello_scheme_files.txt") | ||
FILE(STRINGS ${SCHEME_FILES} SCHEME_FILENAMES) | ||
LIST(APPEND HOST_FILES "hello_world_mod") | ||
LIST(APPEND SUITE_FILES "hello_world_suite.xml") | ||
# HOST is the name of the executable we will build. | ||
SET(HOST "${CMAKE_PROJECT_NAME}") | ||
# HOST_PROGRAM is the name of the program source files (Fortran and metadata) | ||
SET(HOST_PROGRAM "hello_world_host") | ||
|
||
#----------------------------------------------------------------------------- | ||
# | ||
# Set where the CCPP Framework lives | ||
# | ||
#----------------------------------------------------------------------------- | ||
get_filename_component(HELLO_ROOT "${CMAKE_SOURCE_DIR}" DIRECTORY) | ||
get_filename_component(CCPP_ROOT "${HELLO_ROOT}" DIRECTORY) | ||
|
||
#----------------------------------------------------------------------------- | ||
############################################################################## | ||
# | ||
# End of project-specific input | ||
# | ||
############################################################################## | ||
#----------------------------------------------------------------------------- | ||
|
||
# By default, no verbose output | ||
SET(VERBOSITY 0 CACHE STRING "Verbosity level of output (default: 0)") | ||
# By default, generated caps go in ccpp subdir | ||
SET(CCPP_CAP_FILES "${CMAKE_BINARY_DIR}/ccpp" CACHE | ||
STRING "Location of CCPP-generated cap files") | ||
|
||
SET(CCPP_FRAMEWORK ${CCPP_ROOT}/scripts) | ||
|
||
# Use rpaths on MacOSX | ||
set(CMAKE_MACOSX_RPATH 1) | ||
|
||
#----------------------------------------------------------------------------- | ||
# Set a default build type if none was specified | ||
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
#message(STATUS "Setting build type to 'Debug' as none was specified.") | ||
#set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) | ||
message(STATUS "Setting build type to 'Release' as none was specified.") | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE) | ||
|
||
# Set the possible values of build type for cmake-gui | ||
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" | ||
"MinSizeRel" "RelWithDebInfo") | ||
endif() | ||
|
||
ADD_COMPILE_OPTIONS(-O0) | ||
|
||
# CMake 3 version: ADD_EXECUTABLE(${HOST} ${HOST_PROGRAM}.F90) | ||
if (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") | ||
# gfortran | ||
# MESSAGE("gfortran being used.") | ||
ADD_COMPILE_OPTIONS(-fcheck=all) | ||
ADD_COMPILE_OPTIONS(-fbacktrace) | ||
ADD_COMPILE_OPTIONS(-ffpe-trap=zero) | ||
ADD_COMPILE_OPTIONS(-finit-real=nan) | ||
ADD_COMPILE_OPTIONS(-ggdb) | ||
ADD_COMPILE_OPTIONS(-ffree-line-length-none) | ||
ADD_COMPILE_OPTIONS(-cpp) | ||
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "Intel") | ||
# ifort | ||
# MESSAGE("ifort being used.") | ||
#ADD_COMPILE_OPTIONS(-check all) | ||
ADD_COMPILE_OPTIONS(-fpe0) | ||
ADD_COMPILE_OPTIONS(-warn) | ||
ADD_COMPILE_OPTIONS(-traceback) | ||
ADD_COMPILE_OPTIONS(-debug extended) | ||
ADD_COMPILE_OPTIONS(-fpp) | ||
elseif (${CMAKE_Fortran_COMPILER_ID} MATCHES "PGI") | ||
# pgf90 | ||
# MESSAGE("pgf90 being used.") | ||
ADD_COMPILE_OPTIONS(-g) | ||
ADD_COMPILE_OPTIONS(-Mipa=noconst) | ||
ADD_COMPILE_OPTIONS(-traceback) | ||
ADD_COMPILE_OPTIONS(-Mfree) | ||
ADD_COMPILE_OPTIONS(-Mfptrap) | ||
ADD_COMPILE_OPTIONS(-Mpreprocess) | ||
else (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") | ||
message (FATAL_ERROR "This program has only been compiled with gfortran, pgf90 and ifort. If another compiler is needed, the appropriate flags must be added in ${CMAKE_SOURCE_DIR}/CMakeLists.txt") | ||
endif (${CMAKE_Fortran_COMPILER_ID} MATCHES "GNU") | ||
|
||
#----------------------------------------------------------------------------- | ||
# CMake Modules | ||
# Set the CMake module path | ||
list(APPEND CMAKE_MODULE_PATH "${CCPP_FRAMEWORK}/cmake") | ||
#----------------------------------------------------------------------------- | ||
# Set OpenMP flags for C/C++/Fortran | ||
if (OPENMP) | ||
include(detect_openmp) | ||
detect_openmp() | ||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") | ||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") | ||
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") | ||
message(STATUS "Enable OpenMP support for C/C++/Fortran compiler") | ||
else(OPENMP) | ||
message (STATUS "Disable OpenMP support for C/C++/Fortran compiler") | ||
endif() | ||
|
||
# Create metadata and source file lists | ||
FOREACH(FILE ${SCHEME_FILENAMES}) | ||
# add absolute pathnames to library list | ||
string(REPLACE ".meta" ".F90" TEMP "${FILE}") | ||
get_filename_component(ABS_PATH "${TEMP}" ABSOLUTE) | ||
list(APPEND LIBRARY_LIST ${ABS_PATH}) | ||
# CMake 3 version: target_sources(${HOST} PUBLIC ${ABS_PATH}) | ||
ENDFOREACH(FILE) | ||
|
||
FOREACH(FILE ${HOST_FILES}) | ||
LIST(APPEND HOST_METADATA "${FILE}.meta") | ||
# add absolute pathnames to library list | ||
get_filename_component(ABS_PATH "${FILE}.F90" ABSOLUTE) | ||
LIST(APPEND HOST_SOURCE "${ABS_PATH}") | ||
ENDFOREACH(FILE) | ||
list(APPEND LIBRARY_LIST ${HOST_SOURCE}) | ||
# CMake 3 version: target_sources(${HOST} PUBLIC ${HOST_SOURCE}) | ||
string(REPLACE ";" ".meta," HOST_METADATA "${HOST_FILES}") | ||
set(HOST_METADATA "${HOST_PROGRAM}.meta,${HOST_METADATA}.meta") | ||
|
||
# Run ccpp_capgen | ||
set(CAPGEN_CMD "${CCPP_FRAMEWORK}/ccpp_capgen.py") | ||
list(APPEND CAPGEN_CMD "--host-files") | ||
list(APPEND CAPGEN_CMD "${HOST_METADATA}") | ||
list(APPEND CAPGEN_CMD "--scheme-files") | ||
list(APPEND CAPGEN_CMD "${SCHEME_FILES}") | ||
list(APPEND CAPGEN_CMD "--suites") | ||
list(APPEND CAPGEN_CMD "${SUITE_FILES}") | ||
list(APPEND CAPGEN_CMD "--output-root") | ||
list(APPEND CAPGEN_CMD "${CCPP_CAP_FILES}") | ||
list(APPEND CAPGEN_CMD "--host-name") | ||
list(APPEND CAPGEN_CMD "${HOST}") | ||
while (VERBOSITY GREATER 0) | ||
list(APPEND CAPGEN_CMD "--verbose") | ||
MATH(EXPR VERBOSITY "${VERBOSITY} - 1") | ||
endwhile () | ||
string(REPLACE ";" " " CAPGEN_STRING "${CAPGEN_CMD}") | ||
MESSAGE(STATUS "Running: ${CAPGEN_STRING}") | ||
EXECUTE_PROCESS(COMMAND ${CAPGEN_CMD} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} | ||
OUTPUT_VARIABLE CAPGEN_OUT ERROR_VARIABLE CAPGEN_OUT RESULT_VARIABLE RES) | ||
MESSAGE(STATUS "${CAPGEN_OUT}") | ||
if (RES EQUAL 0) | ||
MESSAGE(STATUS "CCPP cap generation completed") | ||
else(RES EQUAL 0) | ||
MESSAGE(FATAL_ERROR "CCPP cap generation FAILED: result = ${RES}") | ||
endif(RES EQUAL 0) | ||
|
||
# Retrieve the list of files from datatable.xml and set to CCPP_CAPS | ||
set(DTABLE_CMD "${CCPP_FRAMEWORK}/ccpp_datafile.py") | ||
list(APPEND DTABLE_CMD "${CCPP_CAP_FILES}/datatable.xml") | ||
list(APPEND DTABLE_CMD "--ccpp-files") | ||
list(APPEND DTABLE_CMD "--separator=\\;") | ||
string(REPLACE ";" " " DTABLE_STRING "${DTABLE_CMD}") | ||
MESSAGE(STATUS "Running: ${DTABLE_STRING}") | ||
EXECUTE_PROCESS(COMMAND ${DTABLE_CMD} OUTPUT_VARIABLE CCPP_CAPS | ||
RESULT_VARIABLE RES | ||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE) | ||
if (RES EQUAL 0) | ||
MESSAGE(STATUS "CCPP cap files retrieved") | ||
else(RES EQUAL 0) | ||
MESSAGE(FATAL_ERROR "CCPP cap file retrieval FAILED: result = ${RES}") | ||
endif(RES EQUAL 0) | ||
FOREACH(FILE ${CCPP_CAPS}) | ||
list(APPEND LIBRARY_LIST ${FILE}) | ||
ENDFOREACH(FILE) | ||
# CMake 3 version: target_sources(${HOST} PUBLIC ${CCPP_CAPS}) | ||
add_library(HELLOLIB OBJECT ${LIBRARY_LIST}) | ||
ADD_EXECUTABLE(${HOST} ${HOST_PROGRAM}.F90 $<TARGET_OBJECTS:HELLOLIB>) | ||
|
||
INCLUDE_DIRECTORIES(${CCPP_CAP_FILES}) | ||
|
||
set_target_properties(${HOST} PROPERTIES | ||
COMPILE_FLAGS "${CMAKE_Fortran_FLAGS}" | ||
LINK_FLAGS "${CMAKE_Fortran_FLAGS}") |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# | ||
# Makefile for HelloWorld example | ||
# | ||
|
||
FC = gfortran | ||
|
||
# My dirs | ||
BLDDIR := $(shell pwd -P) | ||
MKFILE_PATH := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) | ||
ROOT = $(shell dirname $(shell dirname $(MKFILE_PATH))) | ||
CAPGEN := $(ROOT)/scripts/ccpp_capgen.py | ||
CAPGEN_ARGS := --host-files $(MKFILE_PATH)/hello_world_host.meta,$(MKFILE_PATH)/hello_world_mod.meta | ||
CAPGEN_ARGS += --scheme-files $(MKFILE_PATH)/hello_scheme.meta,$(MKFILE_PATH)/temp_adjust.meta | ||
CAPGEN_ARGS += --suites $(MKFILE_PATH)/hello_world_suite.xml | ||
CAPGEN_ARGS += --generate-host-cap --host-name HelloWorld | ||
#CAPGEN_ARGS += --verbose --verbose | ||
SRCS_META := $(MKFILE_PATH)/hello_world_host.meta | ||
SRCS_META += $(MKFILE_PATH)/hello_world_mod.meta | ||
SRCS_META += $(MKFILE_PATH)/hello_scheme.meta | ||
SRCS_META += $(MKFILE_PATH)/temp_adjust.meta | ||
SRCS_XML := $(MKFILE_PATH)/hello_world_suite.xml | ||
|
||
INCFLAG = -I | ||
INCPATH += $(INCFLAG)$(BLDDIR) $(INCFLAG)$(MKFILE_PATH) | ||
FCFLAGS += -g | ||
|
||
# SOURCE FILES | ||
SRCS_F90 = $(MKFILE_PATH)/hello_scheme.F90 $(MKFILE_PATH)/hello_world_host.F90 | ||
SRCS_F90 += $(MKFILE_PATH)/hello_world_mod.F90 | ||
SRCS_F90 += $(MKFILE_PATH)/temp_adjust.F90 | ||
OBJS_F90 = hello_scheme.o temp_adjust.o hello_world_mod.o hello_world_host.o | ||
|
||
# Do we have generated CAP files? | ||
$(eval CAPOBJS=$(shell if [ -f caplocal.txt ]; then cat caplocal.txt; fi)) | ||
|
||
.PHONY: all | ||
all: HelloWorld | ||
|
||
# Generate CCPP cap files | ||
capfiles.txt: $(SRCS_META) $(SRCS_XML) | ||
$(CAPGEN) $(CAPGEN_ARGS) | ||
|
||
.PHONY: capobjs | ||
capobjs: capfiles.txt | ||
$(shell $(MKFILE_PATH)/mkcaplocal.sh $(BLDDIR)/capfiles.txt) | ||
$(eval CAPOBJS=$(shell cat caplocal.txt)) | ||
|
||
# Human written | ||
HelloWorld: capobjs $(CAPOBJS) $(OBJS_F90) | ||
$(FC) $(FCFLAGS) -o $@ $(CAPOBJS) $(OBJS_F90) | ||
|
||
hello_scheme.o: ccpp_kinds.o $(MKFILE_PATH)/hello_scheme.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) $(MKFILE_PATH)/hello_scheme.F90 | ||
|
||
temp_adjust.o: ccpp_kinds.o $(MKFILE_PATH)/temp_adjust.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) $(MKFILE_PATH)/temp_adjust.F90 | ||
|
||
hello_world_mod.o: ccpp_kinds.o $(MKFILE_PATH)/hello_world_mod.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) $(MKFILE_PATH)/hello_world_mod.F90 | ||
|
||
hello_world_host.o: HelloWorld_ccpp_cap.o ccpp_kinds.o | ||
hello_world_host.o: $(MKFILE_PATH)/hello_world_host.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) $(MKFILE_PATH)/hello_world_host.F90 | ||
|
||
# CCPP generated | ||
ccpp_kinds.F90: capobjs | ||
|
||
HelloWorld_ccpp_cap.F90: capobjs | ||
|
||
ccpp_hello_world_suite_cap.F90: capobjs | ||
|
||
ccpp_kinds.o: ccpp_kinds.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) ccpp_kinds.F90 | ||
|
||
HelloWorld_ccpp_cap.o: ccpp_kinds.o | ||
HelloWorld_ccpp_cap.o: hello_world_mod.o ccpp_hello_world_suite_cap.o | ||
HelloWorld_ccpp_cap.o: HelloWorld_ccpp_cap.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) HelloWorld_ccpp_cap.F90 | ||
|
||
ccpp_hello_world_suite_cap.o: ccpp_kinds.o ccpp_hello_world_suite_cap.F90 | ||
$(FC) -c $(INCPATH) $(FCFLAGS) ccpp_hello_world_suite_cap.F90 | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f $(shell if [ -f capfiles.txt ]; then cat capfiles.txt; fi) | ||
rm -f *.o *.mod HelloWorld capfiles.txt caplocal.txt | ||
rm -rf HelloWorld.dSYM |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When do we get to drop Python 2 support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use Python 2 anymore. I think this can be upgraded safely to Python 3 in a follow-up PR.