-
Notifications
You must be signed in to change notification settings - Fork 39
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
Update GCC version and move to C++20 #295
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #295 +/- ##
==========================================
- Coverage 99.44% 99.42% -0.02%
==========================================
Files 30 30
Lines 3410 3300 -110
==========================================
- Hits 3391 3281 -110
Misses 19 19
Continue to review full report at Codecov.
|
Moving to GCC10 is smooth (but going to 11 must be harder due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @chaeyeunpark
I have a few questions/comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @chaeyeunpark! Are you going to commit these changes (move to C++20 and gcc-10) for the coming release?
@@ -66,11 +64,12 @@ endif() | |||
################################################################################ | |||
|
|||
add_executable(compile_time_tests compile_time_tests.cpp) | |||
target_link_libraries(compile_time_tests lightning_gates lightning_utils lightning_simulator) | |||
target_link_libraries(compile_time_tests lightning_compile_options lightning_gates lightning_utils lightning_simulator) | |||
|
|||
set(TEST_SOURCES CreateAllWires.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may also update check_kernels_are_available
in TestAvailableKernels.hpp
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work @chaeyeunpark
I've nothing to add. I'm happy to approve.
@@ -310,7 +312,7 @@ jobs: | |||
- name: Install lightning.qubit device | |||
run: | | |||
cd main | |||
python setup.py build_ext --define="ENABLE_KOKKOS=ON" | |||
python setup.py build_ext -i --define="ENABLE_KOKKOS=ON;CMAKE_CXX_COMPILER=$(which g++-$GCC_VERSION)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I didn't know we could cascade them like this!
# Check GCC version | ||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0) | ||
message(FATAL_ERROR "GCC version must be at least 10.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @chaeyeunpark! Happy to approve.
Thanks @mlxd and @maliasadi! I am still sure that there are some more parts in the codebase that need to be converted into C++20, which may be addressed in subsequent PRs. |
Before submitting
Please complete the following checklist when submitting a PR:
All new features must include a unit test.
If you've fixed a bug or added code that should be tested, add a test to the
tests
directory!All new functions and code must be clearly commented and documented.
If you do make documentation changes, make sure that the docs build and
render correctly by running
make docs
.Ensure that the test suite passes, by running
make test
.Add a new entry to the
.github/CHANGELOG.md
file, summarizing thechange, and including a link back to the PR.
Ensure that code is properly formatted by running
make format
.When all the above are checked, delete everything above the dashed
line and fill in the pull request template.
Context:
Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues: