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

AIOUSB driver library cmake failed with Fedora FC30 #12

Open
kkray7 opened this issue Oct 20, 2021 · 1 comment
Open

AIOUSB driver library cmake failed with Fedora FC30 #12

kkray7 opened this issue Oct 20, 2021 · 1 comment

Comments

@kkray7
Copy link

kkray7 commented Oct 20, 2021

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

@jdolanIV
Copy link
Contributor

jdolanIV commented Nov 10, 2021

Sorry for the delay. I had this sorted as low priority rather than direct question for some reason. Did you get help through one of our other channels?
This should build FC30

sudo dnf groupinstall "Development Tools" "Development Libraries"
git clone https://www.github.com/accesio/AIOUSB.git
sudo dnf install cmake gcc-c++ libusb-devel
cd AIOUSB/AIOUSB
mkdir build
cd build
cmake ..
make

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

No branches or pull requests

2 participants