-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GCC8 linking issues with stdc++fs #3126
Conversation
@@ -768,6 +768,10 @@ rocm_set_soversion(MIOpen ${MIOpen_SOVERSION}) | |||
|
|||
clang_tidy_check(MIOpen) | |||
|
|||
if(HAS_LIB_STD_FILESYSTEM) | |||
target_link_libraries(MIOpen PRIVATE stdc++fs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to be only necessary at some legacy Linux distros and GCC 8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right. We could put conditionals on the compiler being GCC
and version being < 8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, we can't do that because our compiler is clang++
. Rather this conditional has to go on something else, e.g., a version of libstdc++
, which I don't know how to detect, so HAS_LIB_STD_FILESYSTEM
is a good enough choice till then because it should only exist on older systems (I hope).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's some extra details:
I think this will be fine on newer systems, and we are utilizing the solution from the original PR:
@junliume Just in case - this PR looks good to me. |
stdc++fs linking was missing for libMIOpen.so, (but present for tests, and other locations), which was leading to filesystem segfault issues when running libMIOpen.so built with gcc8 on environments with a newer gcc/libstdc++.