Update boost::filesystem to std::filesystem
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
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
Activity
changed milestone to %v5.5.0
added library label
- Resolved by Jacques Xing
- Resolved by Jacques Xing
- Resolved by Jacques Xing
- Resolved by Jacques Xing
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>
added 1 commit
- 01028636 - Remove boost::system:errc and replace wtih std::errc
mentioned in merge request !1427 (closed)
added 1 commit
- d1dec2e6 - [ci skip] change include order in FieldIOBenchmarker
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
Toggle commit list-
d1dec2e6...04978f8d - 2 commits from branch
added 3 commits
-
dc9fd51e...63a42542 - 2 commits from branch
nektar:master
- 88f0511a - Merge remote-tracking branch 'upstream/master' into feature/c++17-filesystem
-
dc9fd51e...63a42542 - 2 commits from branch
added 7 commits
-
9176ad9d...451ce31f - 6 commits from branch
nektar:master
- 2a142d42 - Merge remote-tracking branch 'upstream/master' into feature/c++17-filesystem
-
9176ad9d...451ce31f - 6 commits from branch
requested review from @CFD-Xing
added 3 commits
-
2a142d42...d361c5c5 - 2 commits from branch
nektar:master
- 78ff236a - Merge branch 'master' into 'feature/c++17-filesystem'
-
2a142d42...d361c5c5 - 2 commits from branch
@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.mentioned in commit c608d774