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

Merged versions from CY49T2 and CY49R1 for CY50 #171

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,20 @@ ecbuild_add_option( FEATURE TRANSI
DESCRIPTION "Compile TransI C-interface to trans"
CONDITION HAVE_DOUBLE_PRECISION )

ecbuild_add_option( FEATURE ETRANS
DEFAULT OFF
DESCRIPTION "Include Limited-Area-Model Transforms" )

ecbuild_add_option( FEATURE PROGRAMS
DEFAULT ON
DESCRIPTION "Build src/programs" )

ecbuild_add_option( FEATURE ECTRANS4PY
DEFAULT OFF
CONDITION HAVE_ETRANS
DESCRIPTION "Compile ectrans4py interface routines for python binding w/ ctypesForFortran" )


ectrans_find_lapack()

### Add sources and tests
Expand Down
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include AUTHORS
include CMakeLists.txt
include LICENSE
include README.md
include VERSION
recursive-include src *
recursive-include cmake *
recursive-include tests *
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.50
11 changes: 11 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[build-system]
requires = ["setuptools", "wheel", "scikit-build"]
build-backend = "setuptools.build_meta"

[project]
name = "ectrans4py"
dynamic = ["version"]
dependencies=["numpy", "ctypesForFortran<2.0.0"]

[tool.setuptools.dynamic]
version = {attr = "ectrans4py.__version__"}
25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import os
import ast
from skbuild import setup

_version_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")
with open(_version_file, "r") as f:
__version__ = f.read().strip()

setup(
name="ectrans4py",
version=__version__,
packages=['ectrans4py'],
cmake_minimum_required_version="3.13",
cmake_args=[
'-DENABLE_ETRANS=ON',
'-DENABLE_ECTRANS4PY=ON',
'-DENABLE_SINGLE_PRECISION=OFF',
'-DENABLE_PROGRAMS=OFF',
'-DENABLE_OMP=OFF',
],
package_dir={"": "src"},
cmake_install_dir="src/ectrans4py",
setup_requires=["scikit-build", "setuptools"],
install_requires=["numpy", "ctypesforfortran==1.1.3"],
)
10 changes: 9 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@
# nor does it submit to any jurisdiction.

add_subdirectory( trans )
add_subdirectory( programs )
if(HAVE_PROGRAMS)
add_subdirectory( programs )
endif()
if( HAVE_TRANSI )
add_subdirectory(transi)
endif()
if( HAVE_ETRANS )
add_subdirectory(etrans)
endif()
if(HAVE_ECTRANS4PY)
add_subdirectory(ectrans4py)
endif()
20 changes: 20 additions & 0 deletions src/ectrans4py/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if(HAVE_ETRANS)
# (using CMAKE_CURRENT_SOURCE_DIR is necessary because sources are in a different directory than the target library (trans_${prec}))
ecbuild_list_add_pattern(
LIST ectrans4py_src
GLOB ${CMAKE_CURRENT_SOURCE_DIR}/*.F90
QUIET
)

set(HAVE_dp ${HAVE_DOUBLE_PRECISION})
set(prec dp)

if(HAVE_${prec})
# Add sources
target_sources(trans_${prec} PRIVATE ${ectrans4py_src})
endif()

else()
ecbuild_critical("To activate the ectrans Python interface, you must enable the ETRANS option.")
endif()

Loading