Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.82 KB

Readme_cpp_stl.md

File metadata and controls

29 lines (22 loc) · 1.82 KB

C++ standard library compatibility

Ffilesystem relies on the C++ standard library (STL) for its implementation as do most C++ programs. STL is a critical part of the C++ programming environment. Computing platforms provide STL in distinct ways:

Where allowed by the complier/linker/libc++, one can specify the libc++ library like:

cmake -B build -DCMAKE_CXX_FLAGS="-stdlib=libc++"

On Linux systems, STL is provided by default by the GNU libstdc++ library for many (almost all popular) distributions. Other Linux distributions such as Chimera Linux use LLVM libc++.

The STL version might need additional flags to be specified in the build system. For example, on Linux with Intel oneAPI or NVHPC compilers, libstdc++ is the default STL. If the STL version is older, linker flags such as -lstdc++fs -lstdc++ might be needed. A good way to detect this need is by checking the STL version by CMake try_run or similar, and applying the flags conditionally. This is done in Ffilesystem cmake/compilers.cmake script.