Commit 0b13499b authored by Simon Perkins's avatar Simon Perkins

Build extension in python submodule

i.e in the following schema
ducc.ducc_0_1_0
parent b7a416e3
Pipeline #76288 canceled with stages
from ducc.ducc_0_1_0 import (fft,
healpix,
misc,
sht,
totalconvolve,
wgridder)
\ No newline at end of file
......@@ -6,8 +6,9 @@ from glob import iglob
from setuptools import setup, Extension
import pybind11
pkgname = 'ducc_0_1'
pkgname = 'ducc'
version = '0.1.0'
cppname = '_'.join((pkgname, version.replace('.', '_')))
def _get_files_by_suffix(directory, suffix):
path = directory
......@@ -24,7 +25,7 @@ extra_compile_args = ['--std=c++17', '-march=native', '-ffast-math', '-O3']
python_module_link_args = []
define_macros = [("PKGNAME", pkgname),
define_macros = [("PKGNAME", cppname),
("PKGVERSION", '"%s"' % version)]
if sys.platform == 'darwin':
......@@ -57,7 +58,10 @@ depfiles = (_get_files_by_suffix('.', 'h') +
_get_files_by_suffix('.', 'cc') +
['setup.py'])
extensions = [Extension(pkgname,
# ducc.ducc_0_1_0
extname = '.'.join((pkgname, cppname))
extensions = [Extension(extname,
language='c++',
sources=['python/ducc.cc'],
depends=depfiles,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment