Skip to content

Conversation

vvilpas
Copy link
Contributor

@vvilpas vvilpas commented Mar 4, 2020

Summary

Introduce Conan as a package manager for C++

Details and comments

Conan is a package manager for C++ (https://conan.io/). The idea is to use Conan to manage all external dependencies so that a user compiling doesn't have to worry about having the right library installed in their system.
The commands to build will be the same so no modifications to the build process (besides having conan installed).

Right now, depending on options at build time, we can use these packages:

nlohmann_json
spdlog
openblas
tbb
muparserx
thrust
omp (Apple)

The first four are already available as packages in conan repositories and can be used right now. The last three, on the other hand, has to be uploaded to conan-center and approved by conan to be used, so right now the build WILL FAIL. I'll initiate that process as soon as possible.

There are some other dependencies that cannot be set up through Conan, like CUDA that has to be installed beforehand or other system libraries like threads and dl.

Things to do:

  • Upload packages to Conan-center.
  • Check ABI compatibility issues in RHEL 6&7

In the future we will check the possibility of including the toolchain as a dependency.

Fixes #325

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2020

CLA assistant check
All committers have signed the CLA.

@vvilpas
Copy link
Contributor Author

vvilpas commented Mar 9, 2020

I have created the pull-requests to include muparserx and llvm-openmp in conan-center:

I am still waiting to be included in the early access program. That would trigger the CI on those pull requests and allow to do the final merge.
I'll do the pull-request for the Thrust recipe once the llvm-openmp one is approved and merged, as it will be needed for testing the recipe. It is already finished and uploaded to github (https://github.com/vvilpas/conan-center-index/tree/thrust/recipes/thrust)

@vvilpas
Copy link
Contributor Author

vvilpas commented Apr 1, 2020

After some weeks I've been accepted in the Early Access Program and both Muparserx and llvm-openmp have passed the CI builds. So, right now we are waiting them to do the merge.
As soon as that happens I'll do the pull request for Thrust and once it is approved and merged we can go on with this pull request.

@vvilpas
Copy link
Contributor Author

vvilpas commented Apr 7, 2020

Muparserx is already a recipe in Conan!
llvm-openmp is already approved and has a green flag in CI, but still waiting for someone to merge.

@vvilpas
Copy link
Contributor Author

vvilpas commented Apr 23, 2020

I have already done the pull-request to merge the recipe for Thrust. It is under review.

Regarding llvm-openmp, although the PR was approved and ready to be merged, Conan people were concerned about introducing a package belonging to a framework (llvm in this case). They are deciding wether they merge this PR or they use another approach. They'll tell us something soon.

@vvilpas vvilpas force-pushed the conan branch 2 times, most recently from cb0698f to d2bc334 Compare May 12, 2020 10:42
@vvilpas
Copy link
Contributor Author

vvilpas commented May 12, 2020

This is now ready for review. Every recipe is in conan-center now. I have also added catch2 dependency for C++ testing.

@vvilpas vvilpas changed the title [WIP] Add Conan package manager to the buildsystem Add Conan package manager to the buildsystem May 12, 2020
atilag
atilag previously approved these changes May 21, 2020
Copy link
Member

@atilag atilag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT!
The changes look good. (recent numpy problem aside)
I'm gonna test this manually.

@atilag atilag merged commit 0524506 into Qiskit:master May 27, 2020
@chriseclectic chriseclectic added the Changelog: New Feature Include in the Added section of the changelog label Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use CONAN package manager under the hood, so we can forget about dependencies
4 participants