Repository navigation
Build the libtorch CI variants with C++20 (#1476) - #1485
Merged
Merged
Conversation
torch 2.14 headers stop with "C++20 or later compatible compiler is required", so configure's libtorch and libmetatomic checks fail under PLUMED's default C++17 and the seven pytorch/metatomic regtests are skipped. See plumed#1476.
C++20 no longer accepts a template-id as the name of a constructor (StringBuilderTmp<N>(const StringBuilderTmp<N>&)), and GCC 11 and 12 reject it with --enable-cxx=20. The injected class name is valid in every standard.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1476. As @Zhang-pchao found there, the torch 2.14 headers require C++20, so under PLUMED's default C++17
configurecannot enable libtorch/libmetatomic and the sevenpytorch/andmetatomic/regtests are skipped. That turns-coverage-mpi-and-doc-mpi-red throughPLUMED_ALL_TESTS=yes.--enable-cxx=20in the CI step that enables libmetatomic/libtorch.ASMJIT_NONCOPYABLE(StringBuilderTmp<N>)and two similar uses. Using the injected class name works in every standard. Three lines.master). Under C++20 the Intel compiler rejects anomp simdpragma over a loop that copiesstd::vectors; PathMSDBase: drop four omp simd pragmas that cannot vectorize #1437 removed that pragma together with three others that could not vectorize.I checked locally that these are the only C++20-specific errors: I syntax-checked every source file with clang + libstdc++ 12 + OpenMP under C++17 and under C++20, and did a full GCC 11 build under C++20.
Target release
I would like my code to appear in release v2.10
Type of contribution
Copyright
Tests
Tested first on my fork, run 38074095509. The whole run is green, including
-coverage-mpi-and-doc-mpi-(the two jobs #1476 turned red) as well as-intel-and-nvhpc-mpi-. On-mpi-: 784 tests performed, 0 not applicable, 0 errors, with all sevenpytorch/andmetatomic/regtests run.