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

breaking: drop C++ 11 #4068

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/install/install-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ Check the compiler version on your machine
gcc --version
```

The compiler GCC 4.8 or later is supported in the DeePMD-kit.
By default, DeePMD-kit uses C++ 14, so the compiler needs to support C++ 14 (GCC 5 or later).
The backend package may use a higher C++ standard version, and thus require a higher compiler version (for example, GCC 7 for C++ 17).

::::{tab-set}

Expand Down
4 changes: 4 additions & 0 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ macro(set_if_higher VARIABLE VALUE)
set(${VARIABLE} ${VALUE})
endif()
endmacro()
if(NOT DEEPMD_C_ROOT)
# we can still allow C++ 11 for programs linked to the C library
set_if_higher(CMAKE_CXX_STANDARD 14)
endif()

if(BUILD_TESTING)
enable_testing()
Expand Down
Loading