Skip to content
Snippets Groups Projects

Update boost::filesystem to std::filesystem

Merged Dave Moxey requested to merge dmoxey/nektar:feature/c++17-filesystem into master
All threads resolved!

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

Merge request pipeline #6010 passed with warnings

Merge request pipeline passed with warnings for bf86dfba

Approval is optional

Merged by Jacques XingJacques Xing 1 year ago (Nov 22, 2023 11:27am UTC)

Merge details

  • Changes merged into master with c608d774 (commits were squashed).
  • Deleted the source branch.

Pipeline #6021 passed

Pipeline passed for c608d774 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Dave Moxey
  • Dave Moxey
  • Dave Moxey
  • Jacques Xing approved this merge request

    approved this merge request

  • There is a compilation error with FieldIOXml.cpp:

    /Users/gitlab/builds/RRbNNJtK/0/nektar/nektar/library/LibUtilities/BasicUtils/FieldIOXml.cpp:45:26: error: 'system' is not a class, namespace, or enumeration
    namespace berrc = boost::system::errc;

    I guess, because boost:filesystem has been removed, we need now to add #include <boost/system.hpp>

  • Dave Moxey added 1 commit

    added 1 commit

    • 01028636 - Remove boost::system:errc and replace wtih std::errc

    Compare with previous version

  • Dave Moxey mentioned in merge request !1427 (closed)

    mentioned in merge request !1427 (closed)

  • Dave Moxey added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Moxey added 1 commit

    added 1 commit

    • d1dec2e6 - [ci skip] change include order in FieldIOBenchmarker

    Compare with previous version

  • Dave Moxey added 7 commits

    added 7 commits

    • d1dec2e6...04978f8d - 2 commits from branch nektar:master
    • 2d4f84a7 - Update boost::filesystem to std::filesystem
    • 9298b90e - Update CHANGELOG
    • 9b8e2b69 - Remove boost::system:errc and replace wtih std::errc
    • a8c1028c - Fix incorrect LINK_PRIVATE
    • dc9fd51e - [ci skip] change include order in FieldIOBenchmarker

    Compare with previous version

  • Dave Moxey added 3 commits

    added 3 commits

    • dc9fd51e...63a42542 - 2 commits from branch nektar:master
    • 88f0511a - Merge remote-tracking branch 'upstream/master' into feature/c++17-filesystem

    Compare with previous version

  • Dave Moxey added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Moxey added 7 commits

    added 7 commits

    • 9176ad9d...451ce31f - 6 commits from branch nektar:master
    • 2a142d42 - Merge remote-tracking branch 'upstream/master' into feature/c++17-filesystem

    Compare with previous version

  • Jacques Xing requested review from @CFD-Xing

    requested review from @CFD-Xing

  • Jacques Xing added 3 commits

    added 3 commits

    Compare with previous version

  • Jacques Xing approved this merge request

    approved this merge request

  • Jacques Xing approved this merge request

    approved this merge request

  • Dave Moxey added 1 commit

    added 1 commit

    Compare with previous version

  • Dave Moxey added 1 commit

    added 1 commit

    Compare with previous version

  • Author Owner

    @CFD-Xing I think we might have crossed paths but think I managed to fix most things with this now - there was a small bug with useoptfile vs. use-opt-file. Let's see if this manages to pass the pipeline now.

  • Jacques Xing resolved all threads

    resolved all threads

  • merged

  • Jacques Xing mentioned in commit c608d774

    mentioned in commit c608d774

  • Please register or sign in to reply
    Loading