-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use meson build in place of numpy distutils (#12)
* first attempt at meson building * include mkl-devel in build requirements * change version * relax version a bit * use examples from numpy * update github workflow, reenable thread locks * update meson build file for mkl linkage parameters * remove print outs * remove setup.py file * install setuptools * add option to force sdl usage * do not fail fast on tests * move thread lock allocation * update some meta information * ignore pycharm files * be a bit more accurate about the argument types * Be a little safer about free the lock * split __dealloc__ into a dealloc and a __del__ method for safety * determine initialization status dynamically * make _initialized a function * just use if self.handle[i] * use mamba * cache the environment * fix indices and indptr * stop overwriting dtype * undo some types * more type resetting * unsetting some more * make call type a little more accurate * switch back to conda (with defaults) * reset some build scripts * switch back to mamba, but don't use mkl 2024 * ensure cleared cache * retry this * dynamic initialized (again) * be explicit about initializing handle and iparm * don't cache * generate c sources in tree for cython coverage * enable coverage build option * have meson conditionally generate c file in source directory when doing coverage. * add coverage configuration to pyproject.toml * remove all pytest-cov related options to pytest * fix coverage determination, split long lines * generate coverage.xml * fix command * add comments to meson build file * update distribution script * update gitignore * add a test for mkl=2024 * update test name * fix matrix variable name * add test for windows and mac on mkl 2024 * mkl-2024 is not on macos
- Loading branch information
Showing
16 changed files
with
462 additions
and
225 deletions.
There are no files selected for viewing
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 @@ | ||
node: $Format:%H$ | ||
node-date: $Format:%cI$ | ||
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ | ||
ref-names: $Format:%D$ |
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,11 @@ | ||
.git_archival.txt export-subst | ||
# Excluding files from an sdist generated by meson-python | ||
|
||
.azure-pipelines/* export-ignore | ||
.ci/* export-ignore | ||
tests/* export-ignore | ||
|
||
.flake8 export-ignore | ||
.git* export-ignore | ||
*.yml export-ignore | ||
*.yaml export-ignore |
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 |
---|---|---|
@@ -1,7 +1,12 @@ | ||
build | ||
dist | ||
coverage_html_report | ||
*.so | ||
pydiso.egg-info | ||
__pycache__ | ||
mkl_solver.c | ||
mkl_solver.c.dep | ||
.coverage | ||
coverage.xml | ||
|
||
.idea/ |
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
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,50 @@ | ||
project( | ||
'pydiso', | ||
'c', 'cython', | ||
# Note that the git commit hash cannot be added dynamically here | ||
# (it is dynamically generated though setuptools_scm) | ||
version: run_command('python', | ||
[ | ||
'-c', | ||
''' | ||
from setuptools_scm import get_version | ||
print(get_version())''' | ||
], | ||
check: true | ||
).stdout().strip(), | ||
|
||
license: 'MIT', | ||
meson_version: '>= 1.1.0', | ||
default_options: [ | ||
'buildtype=debugoptimized', | ||
'b_ndebug=if-release', | ||
], | ||
) | ||
|
||
# https://mesonbuild.com/Python-module.html | ||
py_mod = import('python') | ||
py = py_mod.find_installation(pure: false) | ||
py_dep = py.dependency() | ||
|
||
cc = meson.get_compiler('c') | ||
cy = meson.get_compiler('cython') | ||
# generator() doesn't accept compilers, only found programs - cast it. | ||
cython = find_program(cy.cmd_array()[0]) | ||
|
||
_global_c_args = cc.get_supported_arguments( | ||
'-Wno-unused-but-set-variable', | ||
'-Wno-unused-function', | ||
'-Wno-conversion', | ||
'-Wno-misleading-indentation', | ||
) | ||
add_project_arguments(_global_c_args, language : 'c') | ||
|
||
# We need -lm for all C code (assuming it uses math functions, which is safe to | ||
# assume for SciPy). For C++ it isn't needed, because libstdc++/libc++ is | ||
# guaranteed to depend on it. | ||
m_dep = cc.find_library('m', required : false) | ||
if m_dep.found() | ||
add_project_link_arguments('-lm', language : 'c') | ||
endif | ||
|
||
subdir('pydiso') |
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,10 @@ | ||
option('cy_coverage', type : 'boolean', value : false) | ||
|
||
option('use-sdl', type: 'boolean', value: true, | ||
description: 'Use the single dynamic library.') | ||
|
||
option('use-ilp64', type: 'boolean', value: false, | ||
description: 'Use ILP64 (64-bit integer) BLAS and LAPACK interfaces') | ||
|
||
option('mkl-threading', type: 'string', value: 'auto', | ||
description: 'MKL threading method, one of: `seq`, `iomp`, `gomp`, `tbb`') |
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,19 @@ | ||
__version__ = "0.0.3" | ||
__author__ = "SimPEG Team" | ||
__license__ = "MIT" | ||
__copyright__ = "2021, SimPEG Developers, http://simpeg.xyz" | ||
|
||
from importlib.metadata import version, PackageNotFoundError | ||
|
||
# Version | ||
try: | ||
# - Released versions just tags: 0.8.0 | ||
# - GitHub commits add .dev#+hash: 0.8.1.dev4+g2785721 | ||
# - Uncommitted changes add timestamp: 0.8.1.dev4+g2785721.d20191022 | ||
__version__ = version("pydiso") | ||
except PackageNotFoundError: | ||
# If it was not installed, then we don't know the version. We could throw a | ||
# warning here, but this case *should* be rare. discretize should be | ||
# installed properly! | ||
from datetime import datetime | ||
|
||
__version__ = "unknown-" + datetime.today().strftime("%Y%m%d") |
Oops, something went wrong.