Skip to content
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

Update to Boost 1.79 across the board #713

Merged
merged 4 commits into from
Jan 23, 2024
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
8 changes: 4 additions & 4 deletions .github/actions/ngen-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ runs:
id: cache-boost-dep
uses: actions/cache@v3
with:
path: boost_1_72_0
path: boost_1_79_0
key: unix-boost-dep

- name: Get Boost Dependency
if: steps.cache-boost-dep.outputs.cache-hit != 'true'
run: |
curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
tar xjf boost_1_72_0.tar.bz2
curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download
tar xjf boost_1_79_0.tar.bz2
shell: bash

- name: Cache Python Dependencies
Expand Down Expand Up @@ -168,7 +168,7 @@ runs:
- name: Cmake Initialization
id: cmake_init
run: |
export BOOST_ROOT="$(pwd)/boost_1_72_0"
export BOOST_ROOT="$(pwd)/boost_1_79_0"
export CFLAGS="-fsanitize=address -O1 -g -fno-omit-frame-pointer"
export CXXFLAGS="-fsanitize=address -O1 -g -fno-omit-frame-pointer -pedantic-errors"
. .venv/bin/activate
Expand Down
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,7 @@ add_compile_definitions(NGEN_SHARED_LIB_EXTENSION)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
if(NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT})
# Look for version-specific Boost directory if available (known from Github Actions VM docs)
if(DEFINED ENV{BOOST_ROOT_1_72_0})
set(BOOST_ROOT $ENV{BOOST_ROOT_1_72_0})
endif()
endif()
find_package(Boost 1.72.0 REQUIRED)
find_package(Boost 1.79.0 REQUIRED)

# -----------------------------------------------------------------------------
if(NGEN_WITH_SQLITE)
Expand Down
10 changes: 5 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ cd ngen
**Download the Boost Libraries:**

```shell
curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download \
&& tar -xjf boost_1_72_0.tar.bz2 \
&& rm boost_1_72_0.tar.bz2
curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download \
&& tar -xjf boost_1_79_0.tar.bz2 \
&& rm boost_1_79_0.tar.bz2
```

**Set the ENV for Boost and C compiler:**

```shell
set BOOST_ROOT="/boost_1_72_0"
set BOOST_ROOT="/boost_1_79_0"
set CXX=/usr/bin/g++
```

Expand Down Expand Up @@ -77,7 +77,7 @@ The following CMake command will configure the build:

```shell
cmake -DCMAKE_CXX_COMPILER=/usr/bin/g++ \
-DBOOST_ROOT=boost_1_72_0 \
-DBOOST_ROOT=boost_1_79_0 \
-B /build \
-S .
```
Expand Down
2 changes: 1 addition & 1 deletion doc/BUILDS_AND_CMAKE.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ In some cases - in particular **Google Test** - the build system will need to be

## Boost ENV Variable

The Boost libraries must be available for the project to compile. The details are discussed more in the [Dependencies](DEPENDENCIES.md) doc, but as a helpful hint, the **BOOST_ROOT** environmental variable can be set to the path of the applicable [Boost root directory](https://www.boost.org/doc/libs/1_72_0/more/getting_started/unix-variants.html#the-boost-distribution). The project's [CMakeLists.txt](../CMakeLists.txt) is written to check for this env variable and use it to set the Boost include directory.
The Boost libraries must be available for the project to compile. The details are discussed more in the [Dependencies](DEPENDENCIES.md) doc, but as a helpful hint, the **BOOST_ROOT** environmental variable can be set to the path of the applicable [Boost root directory](https://www.boost.org/doc/libs/1_79_0/more/getting_started/unix-variants.html#the-boost-distribution). The project's [CMakeLists.txt](../CMakeLists.txt) is written to check for this env variable and use it to set the Boost include directory.

Note that if the variable is not set, it may still be possible for CMake to find Boost, although a *status* message will be printed by CMake indicating **BOOST_ROOT** was not set.

Expand Down
12 changes: 5 additions & 7 deletions doc/DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
| [Google Test](#google-test) | submodule | `release-1.10.0` | |
| [C/C++ Compiler](#c-and-c-compiler) | external | see below | |
| [CMake](#cmake) | external | \>= `3.14` | |
| [Boost (Headers Only)](#boost-headers-only) | external | `1.72.0` | headers only library |
| [Boost (Headers Only)](#boost-headers-only) | external | `1.79.0` | headers only library |
| [Udunits libraries](https://www.unidata.ucar.edu/software/udunits) | external | >= 2.0 | Can be installed via package manager or from source |
| [MPI](https://www.mpi-forum.org) | external | No current implementation or version requirements | Required for [multi-process distributed execution](DISTRIBUTED_PROCESSING.md) |
| [Python 3 Libraries](#python-3-libraries) | external | \> `3.6.8` | Can be [excluded](#overriding-python-dependency). |
Expand Down Expand Up @@ -55,8 +55,6 @@ Additionally, C++ compilers needs to be compatible (ideally officially *tested*

Based on [this page](https://gcc.gnu.org/projects/cxx-status.html#cxx14), the C++ 14 support requirement probably equates to a version of GCC \>= version `5.0.0`.

Note also that the [Boost.Geometry](https://www.boost.org/doc/libs/1_72_0/libs/geometry/doc/html/geometry/compilation.html) documentation for `1.72.0` lists GCC `5.0.0` as the latest *tested* compatible GCC version.

#### Clang

The Clang versioning scheme is a little convoluted. Using the official scheme, Clang 3.4 and later should support all C++ 14 features.
Expand All @@ -79,7 +77,7 @@ Currently, a version of CMake >= `3.14.0` is required.

## Boost (Headers Only)

Boost libraries are used by this project. In particular, [Boost.Geometry](https://www.boost.org/doc/libs/1_72_0/libs/geometry/doc/html/geometry/compilation.html) is used, but others are also.
Boost libraries are used by this project. In particular, [Boost.Geometry](https://www.boost.org/doc/libs/1_79_0/libs/geometry/doc/html/geometry/compilation.html) is used, but others are also.

Currently, only headers-only Boost libraries are utilized. As such, they are not exhaustively listed here since getting one essentially gets them all.

Expand All @@ -89,19 +87,19 @@ Since only headers-only libraries are needed, the Boost headers simply need to b

There are a variety of different ways to get the Boost headers locally. Various OS may have packages specifically to install them, though one should take note of whether such packages provide a version of Boost that meets this project's requirements.

Alternatively, the Boost distribution itself can be manually downloaded and unpacked, as described for both [Unix-variants](https://www.boost.org/doc/libs/1_72_0/more/getting_started/unix-variants.html) and [Windows](https://www.boost.org/doc/libs/1_72_0/more/getting_started/windows.html) on the Boost website.
Alternatively, the Boost distribution itself can be manually downloaded and unpacked, as described for both [Unix-variants](https://www.boost.org/doc/libs/1_79_0/more/getting_started/unix-variants.html) and [Windows](https://www.boost.org/doc/libs/1_79_0/more/getting_started/windows.html) on the Boost website.

#### Setting **BOOST_ROOT**

If necessary, the project's CMake config is able to use the value of the **BOOST_ROOT** environment variable to help it find Boost, assuming the variable is set. It is not always required, as CMake may be able to find Boost without this, depending on how Boost was "installed."

However, it will often be necessary to set **BOOST_ROOT** if Boost was manually set up by downloading the distribution.

The variable should be set to the value of the **boost root directory**, which is something like `<some_path>/boost_1_72_0`.
The variable should be set to the value of the **boost root directory**, which is something like `<some_path>/boost_1_79_0`.

### Version Requirements

At present, a version >= `1.72.0` is required.
At present, a version >= `1.79.0` is required.

## Udunits

Expand Down
6 changes: 3 additions & 3 deletions docker/CENTOS_4.8.5_NGEN_RUN.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ ENV CXX=/usr/bin/g++

RUN git submodule update --init --recursive -- test/googletest

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download

RUN tar -xjf boost_1_72_0.tar.bz2
RUN tar -xjf boost_1_79_0.tar.bz2

ENV BOOST_ROOT="boost_1_72_0"
ENV BOOST_ROOT="boost_1_79_0"

RUN cmake -B /ngen -S .

Expand Down
8 changes: 4 additions & 4 deletions docker/CENTOS_NGEN_RUN.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ RUN yum update -y \
&& dnf clean all \
&& rm -rf /var/cache/yum

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download \
&& tar -xjf boost_1_72_0.tar.bz2 \
&& rm boost_1_72_0.tar.bz2
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download \
&& tar -xjf boost_1_79_0.tar.bz2 \
&& rm boost_1_79_0.tar.bz2

ENV BOOST_ROOT="/boost_1_72_0"
ENV BOOST_ROOT="/boost_1_79_0"

ENV CXX=/usr/bin/g++

Expand Down
6 changes: 3 additions & 3 deletions docker/CENTOS_TEST.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ ENV CXX=/usr/bin/g++

RUN git submodule update --init --recursive -- test/googletest

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download

RUN tar -xjf boost_1_72_0.tar.bz2
RUN tar -xjf boost_1_79_0.tar.bz2

ENV BOOST_ROOT="boost_1_72_0"
ENV BOOST_ROOT="boost_1_79_0"

WORKDIR /ngen

Expand Down
6 changes: 3 additions & 3 deletions docker/CENTOS_latest_NGEN_RUN.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ ENV CXX=/usr/bin/g++

RUN git submodule update --init --recursive -- test/googletest

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download

RUN tar -xjf boost_1_72_0.tar.bz2
RUN tar -xjf boost_1_79_0.tar.bz2

ENV BOOST_ROOT="boost_1_72_0"
ENV BOOST_ROOT="boost_1_79_0"

WORKDIR /ngen

Expand Down
6 changes: 3 additions & 3 deletions docker/RHEL_TEST.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ ENV CXX=/usr/bin/g++

RUN git submodule update --init --recursive -- test/googletest

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download

RUN tar -xjf boost_1_72_0.tar.bz2
RUN tar -xjf boost_1_79_0.tar.bz2

ENV BOOST_ROOT="boost_1_72_0"
ENV BOOST_ROOT="boost_1_79_0"

WORKDIR /ngen

Expand Down
6 changes: 3 additions & 3 deletions docker/Ubuntu_20_10_Test_MPI.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ ENV CXX=/usr/bin/g++

RUN git submodule update --init --recursive -- test/googletest

RUN curl -L -o boost_1_72_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.72.0/boost_1_72_0.tar.bz2/download
RUN tar -xjf boost_1_72_0.tar.bz2
ENV BOOST_ROOT="boost_1_72_0"
RUN curl -L -o boost_1_79_0.tar.bz2 https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.bz2/download
RUN tar -xjf boost_1_79_0.tar.bz2
ENV BOOST_ROOT="boost_1_79_0"

RUN apt-get install -y libopenmpi-dev
RUN apt-get install -y openmpi-bin openmpi-common
Expand Down
2 changes: 1 addition & 1 deletion include/forcing/DataProvider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <string>
#include <vector>
#include <span.hpp>
#include <boost/core/span.hpp>

namespace data_access
{
Expand Down
2 changes: 1 addition & 1 deletion include/geopackage/ngen_sqlite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <sqlite3.h>

#include "span.hpp"
#include <boost/core/span.hpp>
#include "traits.hpp"

namespace ngen {
Expand Down
2 changes: 1 addition & 1 deletion include/utilities/EndianCopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define NGEN_ENDIANCOPY_H

#include <boost/endian.hpp>
#include "span.hpp"
#include <boost/core/span.hpp>

namespace utils {

Expand Down
48 changes: 0 additions & 48 deletions include/utilities/boostcore_data.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion include/utilities/mdarray/mdarray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <type_traits>
#include <vector>

#include <span.hpp>
#include <boost/core/span.hpp>

namespace ngen {

Expand Down
2 changes: 1 addition & 1 deletion include/utilities/mdframe/visitors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include "mdarray/mdarray.hpp"
#include <boost/variant.hpp>
#include <span.hpp>
#include <boost/core/span.hpp>
#include <traits.hpp>

namespace ngen {
Expand Down
Loading