QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
97 stars 44 forks source link

Improve user experience #500

Open rturrado opened 9 months ago

rturrado commented 9 months ago

Current build line looks something like:

conan build . -s:h compiler.cppstd=23 -s:h openql/*:build_type=Release -o openql/*:build_tests=True -o openql/*:disable_unitary=True -b missing

As a result of the conversation for this issue that I opened, I've found out that we could turn it into something like:

conan build . -pr=conan/profiles/tests-release -b missing

Explanation (see also here):

  1. If you set CMAKE_CXX_STANDARD in your project, you don't need to pass the compiler version as a command line parameter. I've noticed we were not doing that in OpenQL.
  2. There is a way of not working with command line options at all, but defining them in a profile. For example, we could provide a conan/profiles folder together with the code, including a set of predefined profiles, e.g. tests-release, which would look something like:
include(default)

[settings]
openql/*:build_type=Release
[options]
openql/*:asan_enabled=False
openql/*:build_tests=True
openql/*:disable_unitary=True

And then just compile with conan build . -pr=conan/profiles/tests-release.

Or, these profiles may be copied to the ~./conan2/profiles folder, e.g. for this case, with a name such as openql-tests-release, and then build with conan build . -pr=openql-tests-release.