-
Notifications
You must be signed in to change notification settings - Fork 80
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 #184 from eli-schwartz/meson
Meson port
- Loading branch information
Showing
10 changed files
with
121 additions
and
92 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,44 @@ | ||
f2py = [py3, '-m', 'numpy.f2py', '@INPUT@', '--build-dir', '@OUTDIR@', '--lower'] | ||
|
||
sizeof_source = custom_target( | ||
input: 'sizeoffortran.f90', | ||
output: 'sizeof_fortran_tmodule.c', | ||
command: f2py + ['-m', 'sizeof_fortran_t'] | ||
) | ||
|
||
py3.extension_module( | ||
'sizeof_fortran_t', | ||
'sizeoffortran.f90', sizeof_source, | ||
dependencies: fortranobject_dep, | ||
install: true, | ||
subdir: 'f90wrap', | ||
) | ||
|
||
py3.extension_module( | ||
'arraydata', | ||
'arraydatamodule.c', | ||
dependencies: fortranobject_dep, | ||
install: true, | ||
subdir: 'f90wrap', | ||
) | ||
|
||
py3.install_sources( | ||
'codegen.py', | ||
'f90wrapgen.py', | ||
'fortran.py', | ||
'fortrantype.py', | ||
'__init__.py', | ||
'latex.py', | ||
'__main__.py', | ||
'parser.py', | ||
'pywrapgen.py', | ||
'runtime.py', | ||
'six.py', | ||
'transform.py', | ||
'scripts/f2py_f90wrap.py', | ||
'scripts/f90doc.py', | ||
'scripts/__init__.py', | ||
'scripts/main.py', | ||
subdir: 'f90wrap', | ||
preserve_path: true, | ||
) |
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,8 @@ | ||
#!/usr/bin/env python3 | ||
|
||
version = {} | ||
with open('f90wrap/__init__.py') as fp: | ||
exec(fp.read(), version) | ||
__version__ = version['__version__'] | ||
|
||
print(__version__) |
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,41 @@ | ||
# much of this file is derived from SciPy | ||
|
||
project('f90wrap', | ||
'c', | ||
version: run_command('get_version.py', check: true).stdout().strip(), | ||
meson_version: '>= 0.64.0', | ||
) | ||
|
||
# force rebuild to re-calculate the version if it changes | ||
import('fs').read('f90wrap/__init__.py') | ||
|
||
# Adding at project level causes many spurious -lgfortran flags. | ||
add_languages('fortran', native: false) | ||
|
||
py3 = import('python').find_installation(pure: false) | ||
py3_dep = py3.dependency() | ||
|
||
incdir_numpy = run_command( | ||
py3, '-c', | ||
'import numpy; print(numpy.get_include())', | ||
check: true, | ||
).stdout().strip() | ||
|
||
inc_np = include_directories(incdir_numpy) | ||
|
||
incdir_f2py = incdir_numpy / '..' / '..' / 'f2py' / 'src' | ||
inc_f2py = include_directories(incdir_f2py) | ||
fortranobject_c = incdir_f2py / 'fortranobject.c' | ||
|
||
# Share this object across multiple modules. | ||
fortranobject_lib = static_library('_fortranobject', | ||
fortranobject_c, | ||
dependencies: py3_dep, | ||
include_directories: [inc_np, inc_f2py], | ||
) | ||
fortranobject_dep = declare_dependency( | ||
link_with: fortranobject_lib, | ||
include_directories: [inc_np, inc_f2py], | ||
) | ||
|
||
subdir('f90wrap') |
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,22 @@ | ||
[build-system] | ||
# Minimum requirements for the build system to execute. | ||
requires = ["setuptools", "wheel", "oldest-supported-numpy"] | ||
build-backend = "setuptools.build_meta" | ||
requires = ["meson-python>=0.12.0", "oldest-supported-numpy"] | ||
build-backend = 'mesonpy' | ||
|
||
[project] | ||
name = "f90wrap" | ||
description = "Fortran to Python interface generator with derived type support" | ||
authors = [{name = "James Kermode", email = "james.kermode@gmail.com"}] | ||
python-requires = ">=3.6" | ||
urls = {Homepage = "https://github.com/jameskermode/f90wrap"} | ||
dependencies = ["numpy>=1.13,<1.24"] | ||
dynamic = ["version"] | ||
|
||
[project.readme] | ||
file = "README.md" | ||
content-type = "text/markdown" | ||
|
||
[project.scripts] | ||
f90doc = "f90wrap.scripts.f90doc:main" | ||
f90wrap = "f90wrap.scripts.main:main" | ||
f2py-f90wrap = "f90wrap.scripts.f2py_f90wrap:main" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 @@ | ||
# https://cibuildwheel.readthedocs.io/en/stable/faq/#macos-building-cpython-38-wheels-on-arm64 | ||
curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg | ||
sudo installer -pkg /tmp/Python38.pkg -target / | ||
sh "/Applications/Python 3.8/Install Certificates.command" |