Skip to content

Commit

Permalink
docs: Bump C++11 to C++14 as current required (#700)
Browse files Browse the repository at this point in the history
Related to #677
  • Loading branch information
mloskot authored Jun 27, 2022
1 parent 2faf52f commit 5c3cfc7
Show file tree
Hide file tree
Showing 30 changed files with 131 additions and 61 deletions.
54 changes: 28 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ please follow the workflow explained in this document.

## Prerequisites

- C++11 compiler
- C++14 compiler
- Build and run-time dependencies for tests and examples:
- Boost.Filesystem
- Boost.Test
Expand Down Expand Up @@ -359,25 +359,25 @@ Run core tests only specifying location of directory with tests:
```shell
cd libs/gil
b2 cxxstd=11 test/core
b2 cxxstd=14 test/core
```
Run all tests for selected extension (from Boost root directory, as alternative):
```shell
b2 cxxstd=11 libs/gil/test/extension/dynamic_image
b2 cxxstd=11 libs/gil/test/extension/io
b2 cxxstd=11 libs/gil/test/extension/numeric
b2 cxxstd=11 libs/gil/test/extension/toolbox
b2 cxxstd=14 libs/gil/test/extension/dynamic_image
b2 cxxstd=14 libs/gil/test/extension/io
b2 cxxstd=14 libs/gil/test/extension/numeric
b2 cxxstd=14 libs/gil/test/extension/toolbox
```
Run I/O extension tests bundled in target called `simple`:
```shell
b2 cxxstd=11 libs/gil/test/io//simple
b2 cxxstd=14 libs/gil/test/io//simple
```
**TIP:** Pass `b2` feature `cxxstd=11,14,17,2a` to request compilation for
**TIP:** Pass `b2` feature `cxxstd=14,17,2a` to request compilation for
multiple C++ standard versions in single build run.
### Using CMake
Expand Down Expand Up @@ -405,17 +405,17 @@ The provided CMake configuration allows a couple of ways to develop Boost.GIL:
For CMake, you only need to build Boost libraries required by Boost.Test library
which is used to run GIL tests. Since the `CMAKE_CXX_STANDARD` option in the current
[CMakeLists.txt](CMakeLists.txt) defaults to C++11, pass the default `cxxstd=11` to `b2`:
[CMakeLists.txt](CMakeLists.txt) defaults to C++14, pass the default `cxxstd=14` to `b2`:
```shell
./b2 headers
./b2 variant=debug,release cxxstd=11 --with-filesystem stage
./b2 variant=debug,release cxxstd=14 --with-filesystem stage
```
or, depending on specific requirements, more complete build:
```shell
./b2 variant=debug,release address-model=32,64 cxxstd=11 --layout=versioned --with-filesystem stage
./b2 variant=debug,release address-model=32,64 cxxstd=14 --layout=versioned --with-filesystem stage
```
If you wish to build tests using different C++ standard version, then adjust the `cxxstd` accordingly.
Expand Down Expand Up @@ -447,50 +447,52 @@ Here is an example of such lightweight workflow in Linux environment (Debian-bas
- Configure build with CMake
```shell
mkdir _build
cd _build/
cmake ..
cmake -S . -B _build -DBoost_ADDITIONAL_VERSIONS=1.80 -DBoost_COMPILER=-gcc11 -DBoost_ARCHITECTURE=-x64
```
**TIP:** By default, tests and [examples](example/README.md) are compiled using
the minimum required C++11.
Specify `-DCMAKE_CXX_STANDARD=14|17|20` to use newer version.
By default, tests and [examples](example/README.md) are compiled using
the minimum required C++14.
Specify `-DCMAKE_CXX_STANDARD=17|20` to use newer version.
For more CMake options available for GIL, check `option`-s defined
in the top-level `CMakeLists.txt`.
**TIP:** If CMake is failing to find Boost libraries, especially built
with `--layout=versioned`, you can try a few hacks:
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
add an architecture tag to the library file names in versioned build
The option added in CMake 3.13.0.
CMake is failing to find Boost libraries, especially built with `--layout=versioned`,
you can try a few hacks as displayed in the command above:
- option `-DBoost_COMPILER=-gcc5` or `-DBoost_COMPILER=-vc141` to help CMake earlier
than 3.13 match your compiler with toolset used in the Boost library file names
(i.e. `libboost_filesystem-gcc5-mt-x64-1_69` and not `-gcc55-`).
Fixed in CMake 3.13.0.
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
add an architecture tag to the library file names in versioned build
The option added in CMake 3.13.0.
- option `-DDBoost_ADDITIONAL_VERSIONS=<unreleased Boost version>` is especially usefull
when testing GIL with staged build of Boost from its `develop` branch.
- if CMake is still failing to find Boost, you may try `-DBoost_DEBUG=ON` to
get detailed diagnostics output from `FindBoost.cmake` module.
- List available CMake targets
```shell
cmake --build . --target help
cmake --build _build --target help
```
- Build selected target with CMake
```shell
cmake --build . --target gil_test_pixel
cmake --build _build --target gil_test_pixel
```
- List available CTest targets
```shell
cd __build
ctest --show-only | grep Test
```
- Run selected test with CTest
```shell
cd __build
ctest -R gil.tests.core.pixel
```
Expand Down Expand Up @@ -567,10 +569,10 @@ Thus, below a few basic guidelines are listed.
First and foremost, make sure you are familiar with the official
[Boost Library Requirements and Guidelines](https://www.boost.org/development/requirements.html).
Second, strive for writing idiomatic C++11, clean and elegant code.
Second, strive for writing idiomatic C++14, clean and elegant code.
**NOTE:** *The Boost.GIL source code does not necessary represent clean and elegant
code to look up to. The library has recently entered the transition to C++11.
code to look up to. The library has recently entered the transition to C++14.
Major refactoring overhaul is ongoing.*
Maintain structure your source code files according to the following guidelines:
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Documentation | GitHub Actions | AppVeyor | Azure Pipelines | Regression | Codec

Boost.GIL is a part of the [Boost C++ Libraries](http://github.com/boostorg).

The Boost Generic Image Library (GIL) is a **C++11** header-only library that abstracts image
The Boost Generic Image Library (GIL) is a **C++14** header-only library that abstracts image
representations from algorithms and allows writing code that can work on a
variety of images with performance similar to hand-writing for a specific image type.

Expand All @@ -52,11 +52,9 @@ See [example/cmake/README.md](example/cmake/README.md) for CMake configuration e

## Requirements

**NOTE:** The library source code is currently being modernized for C++11.

The Boost Generic Image Library (GIL) requires:

- C++11 compiler (GCC 4.9, clang 3.3, MSVC++ 14.0 (1900) or any later version)
- C++14 compiler (GCC 6, clang 3.9, MSVC++ 14.1 (1910) or any later version)
- Boost header-only libraries

Optionally, in order to build and run tests and examples:
Expand Down
2 changes: 1 addition & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Boost Generic Image Library
===========================

The Generic Image Library (GIL) is a C++11 header-only library that abstracts image
The Generic Image Library (GIL) is a C++14 header-only library that abstracts image
representations from algorithms and allows writing code that can work on
a variety of images with performance similar to hand-writing for a specific
image type.
Expand Down
6 changes: 2 additions & 4 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ Compiling
---------

The Boost.GIL library source code should successfully compile with any
compiler with complete C++11 support.
compiler with complete C++14 support.

.. note::

We are planning to drop support for require C++14 support in Boost 1.76 or later,
or selectively drop support for GCC 5 due to its issues with inheriting constructors,
see `discussion for PR #526 <https://github.com/boostorg/gil/pull/526>`_.
Boost.GIL requires C++14 compiler since ince Boost 1.80.

For the actual list of currently tested compilers, check results of the library CI
builds linked from the `README.md <https://github.com/boostorg/gil/blob/develop/README.md>`_
Expand Down
5 changes: 4 additions & 1 deletion example/adaptive_histogram_equalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Adaptive Histogram Equalization (AHE) capabilities in GIL are demonstrated by the program `adaptive_histogram_equalization`, compiled from the sources `example/adaptive_histogram_equalization.cpp`.

## Synopsis

`adaptive_histogram_equalization`

The program doesn't take any argument on the command line.
Expand All @@ -12,9 +13,11 @@ The program doesn't take any argument on the command line.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured.

### Execution requirements

- `adaptive_histogram_equalization` expects to find an image called `test_adaptive.png` in the current directory.

5 changes: 4 additions & 1 deletion example/adaptive_threshold.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Adaptive Thresholding capabilities in GIL are demonstrated by the program `adaptive_threshold`, compiled from the sources `example/adaptive_threshold.cpp`.

## Synopsis

`adaptive_threshold`

The program doesn't take any argument on the command line.
Expand All @@ -16,8 +17,10 @@ The program doesn't take any argument on the command line.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured.

### Execution requirements

- `adaptive_threshold` expects to find an image called `test_adaptive.png` in the current directory.
5 changes: 4 additions & 1 deletion example/affine.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Affine transformation capabilities in GIL are demonstrated by the program `affine`, compiled from the sources `example/affine.cpp`.

## Synopsis

`affine`

The program doesn't take any argument on the command line.
Expand All @@ -12,8 +13,10 @@ The program doesn't take any argument on the command line.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The JPEG library installed and configured.

### Execution requirements

- `affine` expects to find an image called `test.jpg` in the current directory.
5 changes: 4 additions & 1 deletion example/anisotropic_diffusion.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Anisotropic diffusion capabilities in GIL are demonstrated by the program `anisotropic_diffusion`, compiled from the sources `example/anisotropic_diffusion.cpp`.

## Synopsis

`anisoptropic_diffusion input.png output.png gray|rgb iterations kappa`
- The first parameter must be the full path to an existing image in the JPEG format for `anisoptropic_diffusion` to process
- The second parameter is the full path to the output image of `anisotropic_diffusion`. The directory will *not* be created and must exist.
Expand All @@ -15,8 +16,10 @@ Note that both the input and the ouput images must be in the PNG format.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured.

### Execution requirements

`anisotropic_diffusion` has no specific execution requirements.
5 changes: 4 additions & 1 deletion example/convolution.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Convolution capabilities in GIL are demonstrated by the program `convolution`, compiled from the sources `example/convolution.cpp`.

## Synopsis

`convolution`

The program doesn't take any argument on the command line.
Expand All @@ -12,8 +13,10 @@ The program doesn't take any argument on the command line.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The JPEG library installed and configured.

### Execution requirements

- `convolution` expects to find an image called `test.jpg` in the current directory.
5 changes: 4 additions & 1 deletion example/convolve2d.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
2d kernel convolution capabilities in GIL are demonstrated by the program `convolve2d`, compiled from the sources `example/convolve2d.cpp`.

## Synopsis

`convolve2d`

The program doesn't take any argument on the command line.
Expand All @@ -14,9 +15,11 @@ Note that the user is expected to press a key to end the program.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The JPEG library installed and configured
- The PNG library installed and configured.

### Execution requirements

- `convolve2d` expects to find an image called `src_view.png` in the current directory.
5 changes: 4 additions & 1 deletion example/dynamic_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Dynamic image manipulation capabilities in GIL are demonstrated by the program `dynamic_image`, compiled from the sources `example/dynamic_image.cpp`.

## Synopsis

`dynamic_image`

The program doesn't take any argument on the command line.
Expand All @@ -12,8 +13,10 @@ The program doesn't take any argument on the command line.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The JPEG library installed and configured

### Execution requirements

- `dynamic_image` expects to find an image called `test.jpg` in the current directory.
5 changes: 4 additions & 1 deletion example/harris.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Harris corner detection capabilities in GIL are demonstrated by the program `harris`, compiled from the sources `example/harris.cpp` and `hvstack.hpp`.

## Synopsis

`harris input.png window-size discriminant harris-threshold output.png`

- The first parameter must be the full path to an existing image in the PNG format for `harris` to process
Expand All @@ -14,8 +15,10 @@ Harris corner detection capabilities in GIL are demonstrated by the program `har
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured

### Execution requirements

- `harris` has no specific execution requirements.
2 changes: 1 addition & 1 deletion example/hessian.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Hessian feature detection capabilities in GIL are demonstrated by the program `h
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above
- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured

### Execution requirements
Expand Down
5 changes: 4 additions & 1 deletion example/histogram.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Histogram capabilities in GIL are demonstrated by the program `histogram`, compiled from the sources `example/histogram.cpp`.

## Synopsis

`histogram`

The program doesn't take any argument on the command line.
Expand All @@ -13,8 +14,10 @@ The program doesn't produce any output.
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured.

### Execution requirements

- `histogram` expects to find an image called `test_adaptive.png` in the current directory.
5 changes: 4 additions & 1 deletion example/histogram_equalization.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Histogram equalization capabilities in GIL are demonstrated by the program `histogram_equalization`, compiled from the sources `example/histogram_equalization.cpp`.

## Synopsis

`histogram_equalization`

The program doesn't take any argument on the command line.
Expand Down Expand Up @@ -58,8 +59,10 @@ and is a hypotenuse! Using trivial trigonometry we know that the length we are s
## Specific requirements

### Build requirements
- A C++ compiler compliant with C++11 or above

- A C++ compiler compliant with C++14 or above
- The PNG library installed and configured.

### Execution requirements

- `histogram_equalization` expects to find an image called `test_adaptive.png` in the current directory.
Loading

0 comments on commit 5c3cfc7

Please sign in to comment.