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

[WIP] : QISKIT installer based on setuptools and Cython #412

Closed
wants to merge 18 commits into from
Closed

[WIP] : QISKIT installer based on setuptools and Cython #412

wants to merge 18 commits into from

Conversation

nonhermitian
Copy link
Contributor

@nonhermitian nonhermitian commented Apr 18, 2018

Provides a standard installation and build chain via setuptools.

Description

C++ code is compiled via Cython, and linked to the NumPy BLAS libraries automatically. Support for Windows, and Visual Studio 2015 (the only supported build chain on Windows) comes for free. The c++ simulators no longer need a PIPE call, and are now called like any other Python object.

Motivation and Context

Using make is not a standard way of building Python packages. Instead, this Pull implements the standard python setup.py install. Building the c++ extensions locally, for running unit tests, requires doing python setup.py build_ext --inplace, and the resulting binary is built in qiskit.cython. Wheels building is also a simple call: python setup.py bdist_wheel. Going forward, there is a clear path to integration with conda-forge.

This also helps to remedy issues such as #393, #340.

Benefits over current make process:

  • Standard Python package build process; supports building on Windows, in the supported manner, seamlessly.
  • Allows for linking c++ code to BLAS from NumPy; Intel MKL or openBLAS binding for free. Easy testing against multiple BLAS libraries.
  • C++ extensions linked and called as standard Python modules.
  • C++ exceptions raised to Python exceptions.
  • C++ code can be unit tested via Python.
  • Removes the hard-coding of conda in the install process.
  • Easy pushing to Pypi and conda-forge.

How Has This Been Tested?

So far tested on OSX: Apple clang, HB clang, HB gcc

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • [] I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@nonhermitian
Copy link
Contributor Author

Note that this will not pass until Travis is reconfigured for new install process.

@atilag atilag added the on hold Can not fix yet label Apr 18, 2018
Add pylint command
Setup now does: testing, pep8, profile, and coverage.
@nonhermitian
Copy link
Contributor Author

setup.py now has commands for test, lint, pep8, profile and coverage.

@nonhermitian
Copy link
Contributor Author

Travis now works with the following build matrix:

Python 3.5:

  • gxx-5

Python 3.6

  • pyflakes, pep8
  • gxx-5
  • clang
  • openBLAS
  • OSX, xcode 9.2

The builds are tested against the latest Anaconda version of all the libraries. Currently pyflakes and pep8 fail since the source has some errors in it, e.g.

https://travis-ci.org/nonhermitian/arrogant_seahorse/jobs/369224424

@nonhermitian
Copy link
Contributor Author

This has been moved to its own repo so that integration testing is easier to do:

https://github.com/nonhermitian/arrogant_seahorse

@atilag
Copy link
Member

atilag commented Jun 5, 2018

We are going to restore setup.py file, so anyone can use it directly without having to run cmake first. But cmake tool is still centric to our build system, so the setup.py file will rely on it.

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

Successfully merging this pull request may close these issues.

3 participants