Skip to content

Update boost::filesystem to std::filesystem

Dave Moxey requested to merge dmoxey/nektar:feature/c++17-filesystem into master

Issue/feature addressed

This MR enables C++17 filesystem and removes the use of boost::filesystem.

Proposed solution

The FileSystem.{h,cpp} files have been removed and replaced with a single Filesystem.hpp header. This gives a consistent definition of the std::filesystem namespace (see below for specific details related to gcc).

Implementation

std::filesystem is available from gcc 6+ and clang-9 onwards. However, for gcc 6-8, linking against libstdc++fs library is required. The CMake configuration has therefore been adjusted to use this. Filesystem.hpp also enables support for older gcc versions since the original namespace is std::experimental::filesystem in these versions.

Other than this, very little has changed with respect to the boost::filesystem implementations, and the most recent MRs to remove deprecated functions has made this change very straightforward for the most part.

Tests

Suggested reviewers

@CFD-Xing @ccantwel

Notes

Please add any other information that could be useful for reviewers.

Checklist

  • Functions and classes, or changes to them, are documented.
  • [ ] User guide/documentation is updated.
  • Changelog is updated.
  • [ ] Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines).
  • License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).

Merge request reports

Loading