Tested using some simple 1-bit adder code I had. Please add ~amd64 keyword.
I ran the test from http://dev.gentoo.org/~calchan/sci-electronics/tests/#doc_chap6 and got g++ -Wall -DSC_USE_PTHREADS -DSC_INCLUDE_FX -O3 -o fft fft.o main.o sink.o source.o -L/tmp/systemc-2.2.05jun06_beta/lib-linux64 -lsystemc -lm /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libsystemc.a(sc_cor_pthread.o): In function `sc_core::sc_cor_pkg_pthread::create(unsigned long, void (*)(void*), void*)': : undefined reference to `pthread_create' /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libsystemc.a(sc_cor_pthread.o): In function `sc_core::sc_cor_pkg_pthread::create(unsigned long, void (*)(void*), void*)': : undefined reference to `pthread_attr_setstacksize' collect2: ld returned 1 exit status make[4]: *** [fft] Error 1 make[4]: Leaving directory `/tmp/systemc-2.2.05jun06_beta/examples/sysc/fft/fft_flpt' make[3]: *** [check-am] Error 2 make[3]: Leaving directory `/tmp/systemc-2.2.05jun06_beta/examples/sysc/fft/fft_flpt' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/systemc-2.2.05jun06_beta/examples/sysc/fft' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/systemc-2.2.05jun06_beta/examples/sysc' make: *** [check-recursive] Error 1
(In reply to comment #1) > I ran the test from > > http://dev.gentoo.org/~calchan/sci-electronics/tests/#doc_chap6 > > and got > g++ -Wall -DSC_USE_PTHREADS -DSC_INCLUDE_FX -O3 -o fft fft.o main.o sink.o > source.o -L/tmp/systemc-2.2.05jun06_beta/lib-linux64 -lsystemc -lm > /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libsystemc.a(sc_cor_pthread.o): > In function `sc_core::sc_cor_pkg_pthread::create(unsigned long, void > (*)(void*), void*)': > : undefined reference to `pthread_create' > /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../lib64/libsystemc.a(sc_cor_pthread.o): > In function `sc_core::sc_cor_pkg_pthread::create(unsigned long, void > (*)(void*), void*)': > : undefined reference to `pthread_attr_setstacksize' > collect2: ld returned 1 exit status I don't have an amd64 machine, but I could use one last week for a few minutes and I did have the same issue. Unfortunately I won't be able to use it for more than this, so could you please have a look at it and try to isolate the source of the problem ? It looks to me like maybe some gthread/pthread conflict. That -DSC_USE_PTHREADS option to g++ certainly looks like a good lead to start investigating. Maybe the option needs to be removed, or the order of '-lsystemc -lm' needs to be inverted, or something. If you can't find out what it is, could you please check with somebody else in the amd64 team ? Thanks in advance, Denis.
(In reply to comment #2) > so could you please have a look at it and try to isolate the source > of the problem ? If you help me debug...yes. > It looks to me like maybe some gthread/pthread conflict. That -DSC_USE_PTHREADS > option to g++ certainly looks like a good lead to start investigating. Maybe > the option needs to be removed, or the order of '-lsystemc -lm' needs to be > inverted, or something. If you can't find out what it is, could you please > check with somebody else in the amd64 team ? Removing -DSC_USE_PTHREADS and inverting the order, gives me: g++ -Wall -DSC_INCLUDE_FX -O3 -o fft fft.o main.o sink.o source.o -L/tmp/systemc-2.2.05jun06_beta/lib-linux64 -lm -lsystemc /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsystemc collect2: ld returned 1 exit status
Ok the problem here is with the Makefile.in and Makefile.am files not including -lpthread. A quick fix; cd examples find . -type f -name 'Makefile.*' -print | while read filename do ( sed 's/\-lm/\-lm\ \-lpthread/i;' $filename > $filename.xxxx mv $filename.xxxx $filename ) done Regenerate the makefiles by re-running the ./configure script and it should all compile fine.
(In reply to comment #4) > Regenerate the makefiles by re-running the ./configure script and it should all > compile fine. Quick answer: No. :) make[4]: Entering directory `/tmp/systemc-2.2.05jun06_beta/examples/sysc/fft/fft_flpt' g++ -Wall -DSC_USE_PTHREADS -DSC_INCLUDE_FX -O3 -o fft fft.o main.o sink.o source.o -L/tmp/systemc-2.2.05jun06_beta/lib-linux64 -lsystemc -lm -lpthread -lpthread /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lsystemc collect2: ld returned 1 exit status make[4]: *** [fft] Error 1
(In reply to comment #5) > Quick answer: No. :) > > make[4]: Entering directory > `/tmp/systemc-2.2.05jun06_beta/examples/sysc/fft/fft_flpt' > g++ -Wall -DSC_USE_PTHREADS -DSC_INCLUDE_FX -O3 -o fft fft.o main.o sink.o > source.o -L/tmp/systemc-2.2.05jun06_beta/lib-linux64 -lsystemc -lm -lpthread > -lpthread > /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: > cannot find -lsystemc Christian, what you have here is that it can't find the systemc library, as if systemc wasn't installed. Are you sure you didn't unmerge it ? Denis.
> Christian, what you have here is that it can't find the systemc library, as if > systemc wasn't installed. Are you sure you didn't unmerge it ? OMFG....if we should ever meet in person you are allowed to kick my butt, for not properly reading error messages I post on bugs. It works! I keyworded it ~amd64 and maybe you could check if this is fixed upstream.
Thanks to both of you. I reopen this bug as a tracker to include the fix in the postinstall message and my test bench. Denis.
(In reply to comment #8) > Thanks to both of you. I reopen this bug as a tracker to include the fix in the > postinstall message and my test bench. Both are now fixed, closing this. Denis.