Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

jcfr
Copy link

@jcfr jcfr commented Sep 16, 2016

@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:

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,
@jcfr jcfr force-pushed the simplify-build-system-using-scikit-build branch from 2ed0dce to 2269ebb Compare September 16, 2016 08:31
@danielballan
Copy link
Member

Thanks for dropping in @jcfr. We'll look at this carefully soon.

@jcfr
Copy link
Author

jcfr commented Sep 21, 2016

Great. In the coming day, will also have a pip installable cmake that should make things even easier

@ericdill
Copy link
Member

ericdill commented Jan 9, 2017

@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?

@jcfr
Copy link
Author

jcfr commented Jan 9, 2017

@ericdill Glad you are having a look at the PR 👍 I will rebase and update the PR in the next few days.

@ericdill
Copy link
Member

ericdill commented Jan 9, 2017

@jcfr ok great! Thanks for taking some time to help us out with a better build system 👍

@mrakitin
Copy link
Member

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
Copy link
Member

@jcfr @thewtex think either of y'all would have cycles to help @mrakitin push on scikit-build here?

@thewtex
Copy link

thewtex commented Aug 31, 2019

Short on cycles at the moment, but happy to help where are I can.

@mrakitin It is worthwhile rebasing, re-trying a build, and checking the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy