Skip to content

Commit cad8271

Browse files
authored
Merge pull request #155 from alicevision/dev/c++14
Switch to c++14
2 parents ba0daba + 533cef0 commit cad8271

File tree

7 files changed

+28
-18
lines changed

7 files changed

+28
-18
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ SpaceInEmptyParentheses: false
4747
SpacesInContainerLiterals: false
4848
SpacesInParentheses: false
4949
SpacesInSquareBrackets: false
50-
Standard: "c++11"
50+
Standard: "c++14"
5151
IncludeCategories:
5252
- Regex: '^".*"'
5353
Priority: 1

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
## [1.0.0] - YYYY-MM-DD
1919

2020
- Support for OpenCV 3.4.9 [PR](https://github.com/alicevision/CCTag/pull/121)
21+
- Switch to C++14 standard [PR](https://github.com/alicevision/CCTag/pull/155)
2122

2223

2324
## 2019

CMakeLists.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ if(MSVC AND CMAKE_GENERATOR MATCHES "Ninja")
6565
list(APPEND CUDA_NVCC_FLAGS -Xcompiler ${CCTAG_MVSC_LINKER})
6666
endif()
6767

68-
set(CMAKE_CXX_STANDARD 11)
68+
set(CCTAG_CXX_STANDARD 14)
69+
set(CMAKE_CXX_STANDARD ${CCTAG_CXX_STANDARD})
6970
set(CMAKE_CXX_STANDARD_REQUIRED ON)
70-
set(CMAKE_CUDA_STANDARD 11)
71+
set(CMAKE_CUDA_STANDARD ${CCTAG_CXX_STANDARD})
7172
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
7273

7374

@@ -94,12 +95,6 @@ endif()
9495
# set the path where we can find the findXXX.cmake
9596
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
9697

97-
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
98-
# -Wno-c++11-narrowing to solve "non-type template argument evaluates to -1" error in boost::gil
99-
# -Wno-deprecated-register to avoid the noise of some older eigen versions
100-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-extensions -Wno-c++11-narrowing -Wno-deprecated-register")
101-
endif()
102-
10398
if(APPLE)
10499

105100
# avoid the cmake policy warning about @rpath in MacOSX
@@ -186,7 +181,7 @@ if(CCTAG_WITH_CUDA)
186181
LIST(APPEND CUDA_NVCC_FLAGS ${ARCH_FLAGS})
187182

188183
if(NOT MSVC)
189-
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-std=c++11")
184+
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-std=c++${CCTAG_CXX_STANDARD}")
190185
endif()
191186
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};--default-stream;per-thread")
192187

@@ -204,6 +199,12 @@ if(CCTAG_WITH_CUDA)
204199
endif()
205200
endif()
206201

202+
# This is needed on windows for the multi-threaded compilation, typically ninja and vcpkg
203+
# it avoids the error C1041: cannot open program database, write to the same .PDB file because of concurrent access
204+
if(MSVC)
205+
list(APPEND CUDA_NVCC_FLAGS "-Xcompiler" "-FS")
206+
endif()
207+
207208
if(CCTAG_NVCC_WARNINGS)
208209
list(APPEND CUDA_NVCC_FLAGS -Xptxas --warn-on-local-memory-usage)
209210
list(APPEND CUDA_NVCC_FLAGS -Xptxas --warn-on-spills)

INSTALL.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
Required tools:
77
* CMake >= 3.14 to build the code
88
* Git
9-
* C/C++ compiler (gcc >= 4.6 or visual studio or clang)
9+
* C/C++ compiler with C++14 support
10+
* see here: https://en.cppreference.com/w/cpp/compiler_support
11+
* TLDR gcc >= 5, clang >= 3.4, msvc >= 2017
1012

1113
Optional tool:
12-
* CUDA >= 7.0 (CUDA 7.5 is currently not recommended (see Note 1))
14+
* CUDA >= 9.0
1315
Note: On Windows, there are compatibility issues to build the GPU part due to conflicts between msvc/nvcc/thrust/eigen/boost.
1416

1517
### Getting the sources:

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,18 @@ Running
5050
-------
5151

5252
Once compiled, you might want to run the CCTag detection on a sample image:
53+
5354
```bash
5455
$ build/src/detection -n 3 -i sample/01.png
5556
```
5657
For the library interface, see [ICCTag.hpp](src/cctag/ICCTag.hpp).
5758

59+
Documentation
60+
-------------
61+
62+
The documentation can be found on the [Read the Docs page](https://cctag.readthedocs.io/en/doc-first/index.html)
63+
64+
5865
License
5966
-------
6067

doc/sphinx/source/install/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ Required tools:
6969

7070
* CMake >= 3.14 to build the code
7171
* Git
72-
* C/C++ compiler supporting the C++11 standard (gcc >= 4.6 or visual studio or clang)
72+
* C/C++ compiler supporting the C++14 standard (gcc >= 5, clang >= 3.4, msvc >= 2017)
7373

7474
Optional tool:
7575

76-
* CUDA >= 7.0 (CUDA 7.5 is currently not recommended)
76+
* CUDA >= 9.0
7777

7878

7979
.. note::

src/applications/CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
55
include(GNUInstallDirs)
66
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
77
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
8+
9+
set(CMAKE_CXX_STANDARD 14)
10+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
811
endif()
912

1013
# if this is used as a stand-alone project we need to tell whether to use PIC
@@ -62,10 +65,6 @@ else()
6265
message(STATUS "TBB already there")
6366
endif()
6467

65-
set(CMAKE_CXX_STANDARD 11)
66-
set(CMAKE_CXX_STANDARD_REQUIRED ON)
67-
68-
6968
set(CCTagRegression_cpp
7069
./regression/main.cpp
7170
./regression/TestLog.cpp

0 commit comments

Comments
 (0)