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 bug: missiong pthread link. #874

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

delldu
Copy link

@delldu delldu commented Jun 29, 2024

Test steps

  1. mkdir build
  2. cd build
  3. cmake -DGGML_CUDA=ON -DBUILD_SHARED_LIBS_DEFAULT=OFF -DCMAKE_CUDA_COMPILER=/usr/local/cuda-11.7/bin/nvcc ..
  4. make -j 12
    /usr/bin/ld: CMakeFiles/test-backend-ops.dir/test-backend-ops.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
    /usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status

@@ -426,6 +426,6 @@ set_property(TEST ${TEST_TARGET} PROPERTY ENVIRONMENT "LLVM_PROFILE_FILE=${TEST_

set(TEST_TARGET test-backend-ops)
add_executable(${TEST_TARGET} ${TEST_TARGET}.cpp)
target_link_libraries(${TEST_TARGET} PRIVATE ggml)
target_link_libraries(${TEST_TARGET} PRIVATE ggml pthread)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will not work on every OS, eg. it fails on windows. It's not clear why this is needed in your system - test-backend-ops does not use pthread, it uses the C++ standard library. If it is really necessary, this may need to be changed to use the Threads package instead.

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.

None yet

2 participants