Skip to content

Commit

Permalink
setting up meson build for pixell
Browse files Browse the repository at this point in the history
  • Loading branch information
iparask committed May 28, 2024
1 parent cc0a46f commit 3fcd1ce
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 0 deletions.
33 changes: 33 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
project(
'pixell',
'c', 'cpp', 'fortran',
meson_version: '>= 1.1.0',
default_options: [
'c_std=c99',
],
)

c_compiler = meson.get_compiler('c')
cpp_compiler = meson.get_compiler('cpp')
add_languages('fortran', native: false)
f_compiler = meson.get_compiler('fortran')
system_os = host_machine.system()

# Check compiler is recent enough (see "Toolchain Roadmap" for details)
if system_os == 'windows'
error('Pixell does not support Windows')
endif

add_project_arguments(['-fopenmp', '-Wno-strict-aliasing', '-g', '-Ofast', '-fPIC'], language: ['c', 'cpp'])
add_project_link_arguments(['-fopenmp', '-g', '-fPIC', '-fno-lto'], language: ['c', 'cpp'])
add_project_arguments(['-O3', '-fPIC'], language: 'fortran')


# https://mesonbuild.com/Python-module.html
py_mod = import('python')
# NOTE: with Meson >=0.64.0 we can add `pure: false` here and remove that line
# everywhere else, see https://github.com/mesonbuild/meson/pull/10783.
py3 = py_mod.find_installation()
py3_dep = py3.dependency()

subdir('pixell')
83 changes: 83 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[build-system]
requires = [
"cython >= 3.0.2",
"meson >= 1.1.0",
"meson-python >= 0.14.0",
"versioneer[toml]"
]
build-backend = "mesonpy"

[project]
name = "pixell"
dynamic = ["version"]
description = "pixell"
readme = "README.rst"
license = "BSD license"
maintainers = [
{ name = "Simons Observatory Collaboration Analysis Library Task Force", email = "[email protected]" },
]
requires-python = ">=3.7,<3.12"
dependencies = ["numpy>=1.20.0",
"astropy>=2.0",
"setuptools>=39",
"h5py>=2.7",
"scipy>=1.0",
"python_dateutil>=2.7",
"cython<3.0.4",
"healpy>=1.13",
"matplotlib>=2.0",
"pyyaml>=5.0",
"Pillow>=5.3.0",
"pytest-cov>=2.6",
"coveralls>=1.5",
"pytest>=4.6",
"ducc0>=0.33.0",
"numba>=0.54.0"]
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
"Programming Language :: Python :: 2",
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
]

[project.optional-dependencies]
test = ["pip>=9.0",
"bumpversion>=0.5",
"wheel>=0.30",
"watchdog>=0.8",
"flake8>=3.5",
"coverage>=4.5",
"Sphinx>=1.7",
"twine>=1.10",
"numpy>=1.20",
"astropy>=2.0",
"setuptools>=39.2",
"h5py>=2.7,<=2.10",
"scipy>=1.0",
"python_dateutil>=2.7",
"cython<3.0.4",
"matplotlib>=2.0",
"pyyaml>=5.0",
"pytest-cov>=2.6",
"coveralls>=1.5",
"pytest>=4.6"
]

[project.urls]
"Documentation" = "https://pixell.readthedocs.io/en/latest/"
"Source" = "https://github.com/simonsobs/pixell/"
"Issue Tracker" = "https://github.com/simonsobs/pixell/issues"

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "pixell/_version.py"
versionfile_build = "pixell/_version.py"
tag_prefix = "v"
parentdir_prefix = "pixell-"

0 comments on commit 3fcd1ce

Please sign in to comment.