Skip to content

Commit

Permalink
Upgrade - C++ 17 and gcc 7 minimum (#526)
Browse files Browse the repository at this point in the history
Summary:
Move to C++ 17. Require gcc >= 7. Upgrade CI baselines to use gcc-7.

Pull Request resolved: flashlight/flashlight#526

Test Plan: Manual build and test + CI

Reviewed By: vineelpratap

Differential Revision: D27606016

Pulled By: jacobkahn

fbshipit-source-id: 5a88e087529ca9d0fa868292678012fc572668af
  • Loading branch information
jacobkahn authored and facebook-github-bot committed Apr 7, 2021
1 parent 36919bd commit 329d8c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if(CCACHE_PROGRAM)
endif()

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Default directories for installation
Expand Down Expand Up @@ -93,6 +93,9 @@ set(FL_BUILD_BINARY_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/bin")
# CUDA/nvcc setup
if (FL_USE_CUDA)
enable_language(CUDA)
# The CUDA standard is still C++14 to enable interopability with
# slightly older and still well-supported versions of CUDA/nvcc
# (e.g. CUDA < 11).
set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
include(${CMAKE_MODULE_PATH}/CUDAUtils.cmake)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ D.backward(); // populates A.grad() along with gradients for B, C, and D.

### Requirements
At minimum, compilation requires:
- A C++ compiler with good C++14 support (e.g. gcc/g++ >= 5)
- A C++ compiler with good C++17 support (e.g. gcc/g++ >= 7)
- [CMake](https://cmake.org/) — version 3.10 or later, and ``make``
- A Linux-based operating system.

Expand Down Expand Up @@ -432,7 +432,7 @@ The following CMake configuration links Flashlight and sets include directories:

```cmake
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(myProject project.cpp)
Expand Down

0 comments on commit 329d8c5

Please sign in to comment.