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

ggml : fix undefined reference to std::filesystem(#10978) #10979

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Clauszy
Copy link

@Clauszy Clauszy commented Dec 26, 2024

add link library stdc++fs for ggml.

@github-actions github-actions bot added the ggml changes relating to the ggml tensor library for machine learning label Dec 26, 2024
Copy link
Collaborator

@max-krasnyansky max-krasnyansky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an issue with quite old GCC and Clang.
You should probably just upgrade at this point

ggml/src/CMakeLists.txt Outdated Show resolved Hide resolved
@@ -226,6 +226,9 @@ target_link_libraries(ggml PUBLIC ggml-base)

if (CMAKE_SYSTEM_NAME MATCHES "Linux")
target_link_libraries(ggml PRIVATE dl)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is needless for recent GCC:

Suggested change
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")

FYI: We need c++fs (not stdc++fs) for Clang < 8 ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8")).

@slaren
Copy link
Collaborator

slaren commented Dec 30, 2024

This issue is going to keep popping up as we start using std::filesystem in other components, e.g. #11013 uses it in the common library. I would suggest upgrading the version of gcc, and if that's absolutely not possible, find a workaround that does not require modifying the build files, e.g. maybe by setting LDFLAGS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ggml changes relating to the ggml tensor library for machine learning
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants