Skip to content

Commit

Permalink
breaking: drop C++ 11
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz authored Aug 20, 2024
1 parent d77c075 commit 4e73831
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 4e73831

Please sign in to comment.