Skip to content

AIOUSB driver library cmake failed with Fedora FC30 #12

Description

@kkray7

Try to build Fedora FC30 AIOUSB driver library for USB-DIO-96, and got the following error.

Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp

Run Build Command(s):/bin/gmake cmTC_bd08a/fast && /bin/gmake -f CMakeFiles/cmTC_bd08a.dir/build.make CMakeFiles/cmTC_bd08a.dir/build
gmake[1]: Entering directory '/home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_bd08a.dir/src.c.o
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_bd08a.dir/src.c.o -c /home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_bd08a
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_bd08a.dir/link.txt --verbose=1
/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_bd08a.dir/src.c.o -o cmTC_bd08a
/bin/ld: CMakeFiles/cmTC_bd08a.dir/src.c.o: in function main': src.c:(.text+0x2d): undefined reference to pthread_create'
/bin/ld: src.c:(.text+0x39): undefined reference to pthread_detach' /bin/ld: src.c:(.text+0x45): undefined reference to pthread_cancel'
/bin/ld: src.c:(.text+0x56): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_bd08a.dir/build.make:107: cmTC_bd08a] Error 1
gmake[1]: Leaving directory '/home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_bd08a/fast] Error 2

Source file was:
#include <pthread.h>

void* test_func(void* data)
{
return data;
}

int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);

return 0;
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp

Run Build Command(s):/bin/gmake cmTC_94be0/fast && /bin/gmake -f CMakeFiles/cmTC_94be0.dir/build.make CMakeFiles/cmTC_94be0.dir/build
gmake[1]: Entering directory '/home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_94be0.dir/CheckFunctionExists.c.o
/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_94be0.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
Linking C executable cmTC_94be0
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_94be0.dir/link.txt --verbose=1
/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_94be0.dir/CheckFunctionExists.c.o -o cmTC_94be0 -lpthreads
/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_94be0.dir/build.make:107: cmTC_94be0] Error 1
gmake[1]: Leaving directory '/home/build/temp/AIOUSB-master/AIOUSB/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:141: cmTC_94be0/fast] Error 2

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