-
Notifications
You must be signed in to change notification settings - Fork 53
[WIP] More Emscripten/pyiode Python #1201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,6 +35,18 @@ def run(self): | |
| for ext in self.extensions: | ||
| self.build_extension(ext) | ||
|
|
||
| def get_ext_filename(self, ext_name): | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Overwritten temporarily since it looks like the Wheel packaging still does not pick up the |
||
| r"""Convert the name of an extension (eg. "foo.bar") into the name | ||
| of the file from which it will be loaded (eg. "foo/bar.so", or | ||
| "foo\bar.pyd"). | ||
| """ | ||
| from distutils.sysconfig import get_config_var | ||
| ext_path = ext_name.split('.') | ||
| ext_suffix = os.getenv('SETUPTOOLS_EXT_SUFFIX', None) | ||
| if ext_suffix is None: | ||
| ext_suffix = get_config_var('EXT_SUFFIX') | ||
| return os.path.join(*ext_path) + ext_suffix | ||
|
|
||
| def build_extension(self, ext): | ||
| extdir = os.path.abspath(os.path.dirname( | ||
| self.get_ext_fullpath(ext.name) | ||
|
|
@@ -44,10 +56,9 @@ def build_extension(self, ext): | |
| extdir += os.path.sep | ||
|
|
||
| cmake_args = [ | ||
| '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + | ||
| os.path.join(extdir, "openpmd_api"), | ||
| # '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + extdir, | ||
| '-DCMAKE_PYTHON_OUTPUT_DIRECTORY=' + extdir, | ||
| '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, | ||
| # '-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=' + os.path.join(extdir, "../"), | ||
| '-DCMAKE_PYTHON_OUTPUT_DIRECTORY=' + os.path.join(extdir, "../"), | ||
| '-DPython_EXECUTABLE=' + sys.executable, | ||
| '-DopenPMD_USE_PYTHON:BOOL=ON', | ||
| # variants | ||
|
|
@@ -87,9 +98,7 @@ def build_extension(self, ext): | |
| if platform.system() == "Windows": | ||
| cmake_args += [ | ||
| '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format( | ||
| cfg.upper(), | ||
| os.path.join(extdir, "openpmd_api") | ||
| ) | ||
| cfg.upper(), extdir) | ||
| ] | ||
| if sys.maxsize > 2**32: | ||
| cmake_args += ['-A', 'x64'] | ||
|
|
@@ -186,7 +195,7 @@ def build_extension(self, ext): | |
| 'Source': 'https://github.com/openPMD/openPMD-api', | ||
| 'Tracker': 'https://github.com/openPMD/openPMD-api/issues', | ||
| }, | ||
| ext_modules=[CMakeExtension('openpmd_api_cxx')], | ||
| ext_modules=[CMakeExtension('openpmd_api.openpmd_api_cxx')], | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Playing with declaring the full sub-module here does not help either with the install pick-up-to-wheel issue. |
||
| cmdclass=dict(build_ext=CMakeBuild), | ||
| # scripts=['openpmd-ls'], | ||
| zip_safe=False, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduces the env var SETUPTOOLS_EXT_SUFFIX (ref)