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

Compile bug: undefined reference to std::filesystem #10978

Open
Clauszy opened this issue Dec 26, 2024 · 3 comments
Open

Compile bug: undefined reference to std::filesystem #10978

Clauszy opened this issue Dec 26, 2024 · 3 comments

Comments

@Clauszy
Copy link

Clauszy commented Dec 26, 2024

Git commit

9ba399d

Operating systems

Linux

GGML backends

CPU

Problem description & steps to reproduce

When compiling with gcc8 in Linux, a linking error occurred.
undefined reference to std::filesystem

First Bad Commit

No response

Relevant log output

/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `vtable for std::filesystem::__cxx11::filesystem_error'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator*() const'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `typeinfo for std::filesystem::__cxx11::filesystem_error'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::path::_M_find_extension() const'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::filesystem_error::~filesystem_error()'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::path::_M_split_cmpts()'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::directory_iterator::operator++()'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::directory_iterator::directory_iterator(std::filesystem::__cxx11::path const&, std::filesystem::directory_options, std::error_code*)'
/usr/bin/ld: ../../ggml/src/libggml.so: undefined reference to `std::filesystem::__cxx11::filesystem_error::_M_gen_what()'
Clauszy added a commit to Clauszy/llama.cpp that referenced this issue Dec 26, 2024
Clauszy added a commit to Clauszy/llama.cpp that referenced this issue Dec 26, 2024
Clauszy added a commit to Clauszy/llama.cpp that referenced this issue Dec 26, 2024
@paolovic
Copy link

paolovic commented Jan 7, 2025

had the same issue, resolved by updating gcc to 14

@Levelangel
Copy link

Levelangel commented Jan 14, 2025

use gcc8 with cmake
after running cmake -B build -S .
edit file build/ggml/src/CMakeLists.txt and add link_libraries(stdc++fs) to it
issue resolved

@ldhhello
Copy link

I did cmake -B build -S . but I cannot find file build/ggml/src/CMakeLists.txt.
I'm using Rocky linux 8.10 and GCC version 8.5.0.
I want to resolve this issue without updating my GCC. please help me

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

No branches or pull requests

4 participants