Re: [Csnd-dev] Another build failure

john <[email protected]>
Newsgroups gmane.comp.audio.csound.devel
Message-ID <[email protected]>
More informaion

/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: 
CMakeFi
les/cmTC_35b89.dir/src.c.o: in function `main':
src.c:(.text+0x27): undefined reference to `pthread_create'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: 
src.c:(
.text+0x34): undefined reference to `pthread_detach'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: 
src.c:(
.text+0x41): undefined reference to `pthread_cancel'
/usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: 
src.c:(
.text+0x53): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/cmTC_35b89.dir/build.make:100: cmTC_35b89] Error 
1
gmake[2]: Leaving directory '/home/jpff/cs7/cs77/CMakeFiles/CMakeTmp'
gmake[1]: *** [Makefile:127: cmTC_35b89/fast] Error 2
gmake[1]: Leaving directory '/home/jpff/cs7/cs77/CMakeFiles/CMakeTmp'

Source file was:
#include <pthread.h>

static 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;
}

Looks as if  -lpthreads is missing.

I will try reokig that PR

On Fri, 5 Jan 2024, Stephen Kyne wrote:

> I guess it's possibly related to this PR that went
> in: https://github.com/csound/csound/pull/1791/files
> 
> We don't have any suse linux CI so it's not checked. Maybe check if some of
> these former changes resolve the problem? The PR should be the correct way
> to do it but it's possible there is some other issue.
> 
> Stephen
> 
> ____________________________________________________________________________
> From: Csound-developers <[email protected]> on behalf of John ff
> <[email protected]>
> Sent: Friday 5 January 2024 22:07
> To: [email protected] <[email protected]>
> Subject: [Csnd-dev] Another build failure  
> As ever it could be me but I do not think I was looking at this code
> 
> [ 73%] Linking C executable ../csound
> /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
> CMakeFiles/csound-bin.dir/csound/sched.c.o: undefined reference to symbol
> 'pthread_detach@@GLIBC_2.2.5'
> /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:
> /lib64/libpthread.so.0: error adding symbols: DSO missing from command line
> collect2: error: ld returned 1 exit status
> make[2]: *** [Frontends/CMakeFiles/csound-bin.dir/build.make:115: csound]
> Error 1
> make[1]: *** [CMakeFiles/Makefile2:1230:
> Frontends/CMakeFiles/csound-bin.dir/all] Error 2
> make: *** [Makefile:166: all] Error 2
> 
> ==John ffitch
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.