Link stdc++fs for older gcc versions #2508
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes this issue.
According to filesystem library documentation, gcc versions older than 9.1 and clang prior to 9.0 need filesystem library to be explicitly linked. This PR adds the compiler option when it is necessary.
When trying to reproduce the compilation failure, I realized gcc-8.4 does not need the additional compiler option. However, to be consistent with the official documentation, I add the compiler flag for versions older than 9.1.
How Has This Been Tested?
Current Github Ubuntu images do not have gcc-8 installed by default. When I manually installed gcc-8.4, VTR was built without any problem. It seems that it is only gcc-8.3 and older version sthat need the link flag. I reproduced the compilation error on my local machine by building gcc-8.3 from source. Adding the compiler flag fixed the error. CI tests show that the flag is not applied for newer gcc versions.
Types of changes
Checklist: