-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from ecmwf-ifs/naan-dir-reorder
Directory reorganisation
- Loading branch information
Showing
52 changed files
with
631 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# (C) Copyright 2022- ECMWF. | ||
# (C) Copyright 2022- Meteo-France. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
############################################################################## | ||
#.rst: | ||
# | ||
# field_api_add_object_library | ||
# ============================ | ||
# | ||
# Create an object library from a given set of objects and/or sources. :: | ||
# | ||
# field_api_add_object_library( LIBNAME <name> | ||
# OBJECTS <object-libraries> | ||
# SRCS <sourcefiles> | ||
# DEFINITIONS <compile-definitions> | ||
# LIBARIES <libraries> ) | ||
# | ||
# Note that an object library is not a full cmake target, for example | ||
# object libraries never lead to a .so/.a file. | ||
# | ||
# Input variables | ||
# --------------- | ||
# | ||
# :LIBNAME: Library name. | ||
# :OBJECTS: Object libraries to include. Only target | ||
# objects will be included, other link-time | ||
# information is not propagated. | ||
# :SRCS: Sources to compile. | ||
# :DEFINITIONS: Preprocessor definitions. | ||
# :LIBRARIES: Libraries to link against. | ||
# | ||
############################################################################## | ||
|
||
macro(field_api_add_object_library) | ||
|
||
set( options ) | ||
set( oneValueArgs LIBNAME ) | ||
set( multiValueArgs OBJECTS SRCS DEFINITIONS LIBRARIES ) | ||
|
||
cmake_parse_arguments( _PAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) | ||
|
||
ecbuild_add_library( | ||
TARGET ${_PAR_LIBNAME} | ||
TYPE OBJECT | ||
OBJECTS ${_PAR_OBJECTS} | ||
SOURCES ${_PAR_SRCS} | ||
DEFINITIONS | ||
${_PAR_DEFINITIONS} | ||
$<$<NOT:${fiat_FOUND}>:${FIELD_API_DEFINITIONS}> | ||
$<${fiat_FOUND}:WITH_FIAT> | ||
PRIVATE_LIBS | ||
${_PAR_LIBRARIES} | ||
$<${HAVE_ACC}:OpenACC::OpenACC_Fortran> | ||
$<${fiat_FOUND}:fiat> | ||
$<${fiat_FOUND}:parkind_${DEFAULT_PRECISION}> | ||
OpenMP::OpenMP_Fortran | ||
) | ||
|
||
target_include_directories( ${_PAR_LIBNAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} | ||
INTERFACE $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include/${_PAR_LIBNAME}> ) | ||
|
||
set_property(TARGET ${_PAR_LIBNAME} PROPERTY C_STANDARD 99) | ||
set_target_properties( ${_PAR_LIBNAME} PROPERTIES Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/include/${_PAR_LIBNAME} ) | ||
target_link_options( ${_PAR_LIBNAME} PRIVATE $<${HAVE_CUDA}:-cuda> ) | ||
|
||
# set install location for .mod files | ||
install(DIRECTORY ${CMAKE_BINARY_DIR}/include/${_PAR_LIBNAME} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) | ||
|
||
endmacro() |
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,52 @@ | ||
# (C) Copyright 2022- ECMWF. | ||
# (C) Copyright 2022- Meteo-France. | ||
# | ||
# This software is licensed under the terms of the Apache Licence Version 2.0 | ||
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
# In applying this licence, ECMWF does not waive the privileges and immunities | ||
# granted to it by virtue of its status as an intergovernmental organisation | ||
# nor does it submit to any jurisdiction. | ||
|
||
############################################################################## | ||
#.rst: | ||
# | ||
# field_api_expand_fypp_ranksuff | ||
# ============================== | ||
# | ||
# Preprocess a given set of .fypp files. :: | ||
# | ||
# field_api_expand_fypp( PYTHON_MODULE_DIR <python-util-module-dir> | ||
# SOURCE_DIR <source-directory> | ||
# INPUT_SRCS <fypp files> | ||
# OUTPUT_SRCS <processed F90 files> ) | ||
# | ||
# Input variables | ||
# --------------- | ||
# | ||
# :PYTHON_MODULE_DIR: Directory containing fieldType.py python module. | ||
# :SOURCE_DIR: Directory containing .fypp files to be processed. | ||
# :INPUT_SRCS: List of .fypp files to be processed. | ||
# :OUTPUT_SRCS: List of processed .F90 files. | ||
# | ||
############################################################################## | ||
|
||
macro( field_api_expand_fypp ) | ||
|
||
set( options ) | ||
set( oneValueArgs PYTHON_MODULE_DIR SOURCE_DIR ) | ||
set( multiValueArgs INPUT_SRCS OUTPUT_SRCS ) | ||
|
||
cmake_parse_arguments( _PAR "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} ) | ||
|
||
foreach (SRC ${_PAR_INPUT_SRCS} ) | ||
|
||
add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SRC}.F90 | ||
COMMAND ${FYPP} -m os ${fypp_defines} -M ${_PAR_PYTHON_MODULE_DIR} -m fieldType ${_PAR_SOURCE_DIR}/${SRC}.fypp > ${CMAKE_CURRENT_BINARY_DIR}/${SRC}.F90 | ||
DEPENDS ${_PAR_SOURCE_DIR}/${SRC}.fypp | ||
VERBATIM) | ||
|
||
list(APPEND ${_PAR_OUTPUT_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/${SRC}.F90) | ||
|
||
endforeach () | ||
|
||
endmacro() |
Oops, something went wrong.