forked from numba/numba
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nothing fancy, do not allow dots.
- Loading branch information
Showing
5 changed files
with
89 additions
and
2 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
18 changes: 18 additions & 0 deletions
18
numba/tests/pycc_distutils_usecase/nested/source_module.py
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,18 @@ | ||
import numpy as np | ||
|
||
from numba.pycc import CC | ||
|
||
|
||
cc = CC('pycc_compiled_module') | ||
|
||
_const = 42 | ||
|
||
# This ones references a global variable at compile time | ||
@cc.export('get_const', 'i8()') | ||
def get_const(): | ||
return _const | ||
|
||
# This one needs NRT and an environment | ||
@cc.export('ones', 'f8[:](i4)') | ||
def ones(n): | ||
return np.ones(n) |
15 changes: 15 additions & 0 deletions
15
numba/tests/pycc_distutils_usecase/setup_distutils_nested.py
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,15 @@ | ||
from distutils.core import setup | ||
|
||
from nested.source_module import cc | ||
|
||
from numba.pycc.platform import _patch_exec_command | ||
|
||
|
||
def run_setup(): | ||
# Avoid sporadic crashes on Windows due to MSVCRT spawnve() | ||
_patch_exec_command() | ||
setup(ext_modules=[cc.distutils_extension()]) | ||
|
||
|
||
if __name__ == '__main__': | ||
run_setup() |
15 changes: 15 additions & 0 deletions
15
numba/tests/pycc_distutils_usecase/setup_setuptools_nested.py
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,15 @@ | ||
from setuptools import setup | ||
|
||
from nested.source_module import cc | ||
|
||
from numba.pycc.platform import _patch_exec_command | ||
|
||
|
||
def run_setup(): | ||
# Avoid sporadic crashes on Windows due to MSVCRT spawnve() | ||
_patch_exec_command() | ||
setup(ext_modules=[cc.distutils_extension()]) | ||
|
||
|
||
if __name__ == '__main__': | ||
run_setup() |
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