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

setup: use scikit-build for building cmatrices and cshape C extensions #311

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

Commits on Oct 5, 2018

  1. setup: use scikit-build for building cmatrices and cshape C extensions

    See #283
    
    This commit introduces new dependencies: "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 (see [1]) installed
    on the system. This could be done by simply doing:
    
      pip install -U scikit-build cmake
    
    How does it work ?
    ------------------
    
    In addition to simplifying setup.py, two new file have been added:
    
    <root>
      |
      |---- CMakeLists.txt                          (1)
      .
      .
      .
      |--- ...src
      |        |--- CMakeLists.txt                  (2)
      .
      .
    
    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 other CMakeLists.txt.
    
    The second CMakeLists.txt is specific to "cmatrices" and "cshape"
    extensions and it specifies:
    
    * requirement for NumPy
    
    Then, it declares:
    
    * libraries for each extension, associate python extension specific properties
    
    * and finally add an install rule specifying where in the package
      hierarchy the extension should be installed.
    
    Et voila,
    
    [1] Note that improvement to python packaging will be available shortly and
    it will be possible to include scikit-build and cmake directly in pyproject.toml
    See here for more details: https://www.python.org/dev/peps/pep-0518/
    jcfr authored and JoostJM committed Oct 5, 2018
    Configuration menu
    Copy the full SHA
    fb9ace9 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d29d41 View commit details
    Browse the repository at this point in the history