-
Notifications
You must be signed in to change notification settings - Fork 60
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
Simplify build system using scikit build #467
base: master
Are you sure you want to change the base?
Simplify build system using scikit build #467
Conversation
This commit removed code obsoleted by c12b82e (MNT: Updated setup.py)
The packages required to successfully develop and create binary distributions are added to dev-requirements.txt
This commit introduces a new dependencies to "scikit-built" and CMake. scikit-build is a drop-in replacement to setuptools.setup function allowing to easily compile and package extensions (C/C++/Cython) by bridging CMake and setuptools. See http://scikit-build.org CMake is is an open-source, cross-platform family of tools designed to build, test and package software. See https://cmake.org Currently, scikit-build and CMake have to be explicitly installed on the system. Since CMake wheels (allowing to pip install CMake) will be published shortly, initial will be simplified. How does it work ? In addition to simplifying setup.py, three new files have been added: <root> | |---- CMakeLists.txt (1) . . . |--- src | |--- CMakeLists.txt (2) . . |--- skbeam | |---core . | |---accumulators . . . |--------- CMakeLists.txt (3) The first CMakeLists.txt specifies requirements for * Python interpreter, * the associated python libraries * and a "PythonExtension" modules containing convenience CMake functions allowing to easily build extension by encapsulating system introspection and platform specific logic. and include the subdirectory associated with the two other CMakeLists.txt. The second CMakeLists.txt is specific to "ctrans" extension and it specifies: * requirement for NumPy * optional dependency on OpenMP. If it is not found on a given platform, nothing is changed, the macro _OPENMP will NOT be defined and a regular implementation will be compiled in. Then, it declares: * a library, associate pytho extension specific properties * and finally add an install rule specifying where in the package hierarchy the extension should be installed. Finally, the third CMakeLists.txt is specific to the "histogram" extension and it specifies: * requirements for NumPy Then, it adds "cythonizing" target for the pyx file using the CMake function "add_cython_target", and proceed to the declaration of the extension like it was done in the previous case. Et voila,
2ed0dce
to
2269ebb
Compare
Thanks for dropping in @jcfr. We'll look at this carefully soon. |
Great. In the coming day, will also have a pip installable |
@jcfr thanks for doing this during pydata carolinas. Sorry I never had a chance to look at this. How should this change with newer scikit-build? |
@ericdill Glad you are having a look at the PR 👍 I will rebase and update the PR in the next few days. |
@jcfr ok great! Thanks for taking some time to help us out with a better build system 👍 |
By any chance, can this PR be revived? I am looking into a better building of the C-extension for Windows, this seems to be a right direction. |
@ericdill Here is a PR integrating scikit-build to the project, the commit message associated with 2ed0dce should be helpful to understand the changes.
To try it out:
0.3.0
)./setup.py build
or./setup.py bdist_wheel