Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/conda_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.7"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache conda
uses: actions/cache@v1
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/resources/conda_build_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@ dependencies:
- conda-build
- conda-verify
- anaconda-client
- meson
- meson-python


15 changes: 7 additions & 8 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% set name = "quagmire" %}
{% set data = load_setup_py_data() %}
{% set version = "0.9.7b0" %}

package:
name: "{{ name|lower }}"
version: {{ data.get('version') }}
version: {{ version }}

source:
path: ..
Expand All @@ -15,12 +15,13 @@ requirements:
- {{ compiler('fortran') }}
- make
- pkg-config
- setuptools
- meson-python
- numpy >=1.16
host:
- python
- petsc4py
- h5py
- meson-python
run:
- python
- numpy
Expand All @@ -42,17 +43,15 @@ test:
- tests

commands:
- pytest




# - pytest - TODO fix all tests. Now now just leave test_2 in
- pytest tests/test_2_mesh_variables.py

about:
home: "https://github.com/underworldcode/quagmire"

extra:
recipe-maintainers:
- jgiordani
- lmoresi
- brmather
- rbeucher
76 changes: 76 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
project( 'quagmire',
'fortran', 'c',
version:'0.9.7b0',
license:'GPLv3',
meson_version: '>=0.64.0',
default_options : ['warning_level=2', 'python.install_env=auto'])

# make some environment variables
proj_name = meson.project_name()
py_mod = import('python')
py = py_mod.find_installation(pure: false)
py_dep = py.dependency()

# gather numpy and fortran include dirs
incdir_numpy = run_command(py,
['-c', 'import os; os.chdir(".."); import numpy; print(numpy.get_include())'],
check : true
).stdout().strip()

incdir_f2py = run_command(py,
['-c', 'import os; os.chdir(".."); import numpy.f2py; print(numpy.f2py.get_include())'],
check : true
).stdout().strip()

inc_np = include_directories(incdir_numpy, incdir_f2py)

# Dictionary of sources for each extension.
# Here we index each extension by name.
# use pre existing pyf files as module headers
qextensions = {
'_fortran': {
'src':'src/trimesh.f90',
'fsig':'src/quagmire.pyf',
'extra_files': ''
},
}

# # Create extension modules
foreach mod : qextensions.keys()
mdict = qextensions.get(mod)
sources = mdict.get('src')
target = mdict.get('fsig')
largs = mdict.get('extra_files')

#message('Building extension module: ' + mod)
#message(sources)
ext_source = custom_target(mod,
input : target, # .f so no F90 wrappers
output : [mod+'module.c', mod+'-f2pywrappers.f'],
command : [py, '-m', 'numpy.f2py', '@INPUT@']

# this causes mysterious errors - not sure why
#command : [py, '-m', 'numpy.f2py', '@INPUT@', '-m', mod, '--lower']
)

# compile wrapper to shared object and install to python site-packages
py.extension_module(mod,
[sources, ext_source],
incdir_f2py / 'fortranobject.c',
link_args: largs, ### DOUBLE CHECK THIS
include_directories: inc_np,
dependencies : py_dep,
subdir: proj_name,
install : true
)

message('Extension module: ' + mod + ' to be built and installed')
endforeach

install_subdir('./quagmire/', install_dir: py.get_install_dir())

## Install other data or resources (like LICENSE or README)
#py.install_sources('../LICENSE', subdir: proj_name)
#py.install_sources('./badlands/__init__.py', subdir: proj_name)
#py.install_sources('./badlands/model.py', subdir: proj_name)
#install_subdir('./badlands/', install_dir: py.get_install_dir())
34 changes: 32 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
[build-system]
requires = ["setuptools >= 40.6.0", "numpy >= 1.16"]
build-backend = "setuptools.build_meta"
requires = ["wheel", "numpy >= 1.26", 'meson', 'meson-python']
build-backend = "mesonpy"

[project]
name = "quagmire"
authors = [
{name = "Ben Mather", email = "[email protected]"},
{name = "Julian Giordani", email = "[email protected]"},
]
version = "0.9.7b1"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENCE"}
description = "Python surface process framework on highly scalable unstructured meshes"
dependencies = [
'numpy>=1.16.0',
'scipy>=1.0.0',
'stripy>=1.2',
'petsc4py',
'mpi4py',
'h5py',
'pint'
]
classifiers = [
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7"
]


Binary file removed quagmire/_fortran.cpython-39-darwin.so
Binary file not shown.
45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

Loading