Skip to content
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

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

BrianHarrisonAMD
Copy link
Contributor

@BrianHarrisonAMD BrianHarrisonAMD commented Jul 21, 2024

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++.

@@ -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)
Copy link
Collaborator

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?

Copy link
Contributor

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.

Copy link
Contributor

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).

Copy link
Contributor Author

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 junliume merged commit 97ec508 into develop Jul 22, 2024
2 of 3 checks passed
@junliume junliume deleted the bharriso/fix-gcc8-std-filesystem branch July 22, 2024 06:55
@atamazov
Copy link
Contributor

@junliume Just in case - this PR looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants