Skip to content

CXX-3300 update build-from-source minimum supported compiler versions #1415

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

Merged
merged 5 commits into from
Jun 13, 2025
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
1 change: 1 addition & 0 deletions .evergreen/config_generator/components/compile_only.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def tasks():
run_on=distro.name,
patchable=patchable,
commands=commands,
disable=(True if distro_name == 'rhel7.9' else None), # DEVPROD-18187
)


Expand Down
2 changes: 2 additions & 0 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ tasks:
- name: compile-only-rhel7.9-gcc-cxx11-debug
run_on: rhel7.9-large
tags: [compile-only, rhel7.9, cxx11, gcc, debug]
disable: true
commands:
- command: expansions.update
params:
Expand All @@ -451,6 +452,7 @@ tasks:
- name: compile-only-rhel7.9-gcc-cxx14-debug
run_on: rhel7.9-large
tags: [compile-only, rhel7.9, cxx14, gcc, debug]
disable: true
commands:
- command: expansions.update
params:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Changes prior to 3.9.0 are documented as [release notes on GitHub](https://githu

- CMake 3.16.0 or newer is required when `ENABLE_TESTS=ON` for compatibility with the updated Catch2 library version (3.7.0 -> 3.8.1).
- Bump the minimum required C Driver version to [2.0.2](https://github.com/mongodb/mongo-c-driver/releases/tag/2.0.2).
- Minimum supported compiler versions to build from source are updated to the following:
- GCC 8.1 (from GCC 4.8.2).
- Users on RHEL 7 may consult Red Hat's ["Hello World - installing GCC on RHEL 7"](https://developers.redhat.com/HW/gcc-RHEL-7) or ["How to install GCC 8 and Clang/LLVM 6 on Red Hat Enterprise Linux 7"](https://developers.redhat.com/blog/2019/03/05/yum-install-gcc-8-clang-6) for instructions on how to obtain GCC 8 or newer.
- Clang 3.8 (from Clang 3.5).
- Apple Clang 13.1 with Xcode 13.4.1 (from Apple Clang 5.1 with Xcode 5.1).
- MSVC 19.0.24210 with Visual Studio 2015 Update 3 (from MSVC 19.0.23506 with Visual Studio 2015 Update 1).

## 4.1.0

Expand Down
28 changes: 20 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,32 @@ set(CMAKE_MODULE_PATH
option(BUILD_TESTING "When ENABLE_TESTS=ON, include test targets in the \"all\" target")

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.2")
message(FATAL_ERROR "Insufficient GCC version - GCC 4.8.2+ required")
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html
# https://gcc.gnu.org/projects/cxx-status.html
# https://gcc.gnu.org/releases.html
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.1")
message(FATAL_ERROR "GCC 8.1 or newer is required")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0.23506")
message(FATAL_ERROR "Insufficient Microsoft Visual C++ version - MSVC 2015 Update 1+ required")
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Internal_version_numbering
# https://learn.microsoft.com/en-us/cpp/overview/compiler-versions
# https://learn.microsoft.com/en-us/cpp/overview/visual-cpp-language-conformance
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.0.24210")
message(FATAL_ERROR "Visual Studio 13 2015 Update 3 or newer is required")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1")
message(FATAL_ERROR "Insufficient Apple clang version - XCode 5.1+ required")
# https://developer.apple.com/xcode/cpp/
# https://en.wikipedia.org/wiki/Xcode#Version_comparison_table
# https://trac.macports.org/wiki/XcodeVersionInfo
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13.1")
message(FATAL_ERROR "Xcode 13.4.1 or newer is required")
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5")
message(FATAL_ERROR "Insufficient clang version - clang 3.5+ required")
# https://releases.llvm.org/
# https://clang.llvm.org/cxx_status.html
# https://libcxx.llvm.org/#c-standards-conformance
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.8")
message(FATAL_ERROR "Clang 3.8 or newer is required")
endif()
else()
message(WARNING "Unknown compiler... recklessly proceeding without a version check")
Expand Down