[ET Trac] #2885: test for std::filesystem availability in Silo output likely broken

Roland Haas trac-noreply at einsteintoolkit.org
Wed Sep 3 14:22:17 CDT 2025


#2885: test for std::filesystem availability in Silo output likely broken

 Reporter: Roland Haas
   Status: new
Milestone: 
  Version: 
     Type: bug
 Priority: minor
Component: 

The test

```
#if defined __cpp_lib_filesystem && __cpp_lib_filesystem < 201703L
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#else
#include <filesystem>
namespace fs = std::filesystem;
#endif
```

\(or so\) in the Silo output routines is quite likely not performing as intended.

Namely

1. `__cpp_lib_filesystem` is defined either in `<version>` \(C\+\+20\) or in `<filesystem>` \(which is what we want to test for\)
2. if defined \(at least in g\+\+12\) it is set to the constant `201703L` anyway

  
References:  
\* [https://en.cppreference.com/w/cpp/feature\_test.html](https://en.cppreference.com/w/cpp/feature_test.html) \(though g\+\+ does provide a version file even in version of gcc that do not support C\+\+20 and also when C\+\+20 is not the language version used\)  
\* [https://stackoverflow.com/a/53365539](https://stackoverflow.com/a/53365539) which is somewhat more complex than we’d want, and also would require access to `<version>`.  
  
The current workaround exists b/c of old gcc versions \(7 apparently\) and also for some clusters where the \(AMD / clang / hip\) compiler is old.

‌

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2885/test-for-std-filesystem-availability-in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.einsteintoolkit.org/pipermail/trac/attachments/20250903/e123ef41/attachment.htm>


More information about the Trac mailing list