Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
This repository was archived by the owner on Jan 3, 2023. It is now read-only.

src.c:(.text+0x46): undefined reference to `pthread_create' #4955

Description

@L-coder148

When I run cmake ../ -DNGRAPH_PYTHON_BUILD_ENABLE=ON -DNGRAPH_ONNX_IMPORT_ENABLE=ON -DNGRAPH_USE_PREBUILT_LLVM=ON on ubuntu20.04,it occurs the error.
image
and the CMakeError.log is as following

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /mnt/e/GitHub/ngraph/build/CMakeFiles/CMakeTmp


Run Build Command(s):/usr/bin/make cmTC_e72d9/fast && /usr/bin/make  -f CMakeFiles/cmTC_e72d9.dir/build.make CMakeFiles/cmTC_e72d9.dir/build
make[1]: Entering directory '/mnt/e/GitHub/ngraph/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e72d9.dir/src.c.o
/usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD -fPIE -o CMakeFiles/cmTC_e72d9.dir/src.c.o -c /mnt/e/GitHub/ngraph/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_e72d9
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e72d9.dir/link.txt --verbose=1
/usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD  -pie -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now  CMakeFiles/cmTC_e72d9.dir/src.c.o -o cmTC_e72d9 
/usr/bin/ld: CMakeFiles/cmTC_e72d9.dir/src.c.o: in function `main':
src.c:(.text+0x46): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x52): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x5e): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x6f): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
make[1]: *** [CMakeFiles/cmTC_e72d9.dir/build.make:106: cmTC_e72d9] Error 1
make[1]: Leaving directory '/mnt/e/GitHub/ngraph/build/CMakeFiles/CMakeTmp'
make: *** [Makefile:140: cmTC_e72d9/fast] Error 2

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions