Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 172699 - sci-electronics/systemc-2.2_beta20060605 is TESTED on AMD64
Summary: sci-electronics/systemc-2.2_beta20060605 is TESTED on AMD64
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: The Soldering-Iron Brotherhood
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-29 18:57 UTC by Ahmed Ammar (RETIRED)
Modified: 2007-04-20 09:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ahmed Ammar (RETIRED) gentoo-dev 2007-03-29 18:57:36 UTC
Tested using some simple 1-bit adder code I had.

Please add ~amd64 keyword.
Comment 1 Christian Faulhammer (RETIRED) gentoo-dev 2007-04-10 07:33:42 UTC
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

Comment 2 Denis Dupeyron (RETIRED) gentoo-dev 2007-04-11 06:41:31 UTC
(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.
Comment 3 Christian Faulhammer (RETIRED) gentoo-dev 2007-04-11 06:53:59 UTC
(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

 
Comment 4 Ahmed Ammar (RETIRED) gentoo-dev 2007-04-11 14:52:36 UTC
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.
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2007-04-12 06:18:24 UTC
(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
Comment 6 Denis Dupeyron (RETIRED) gentoo-dev 2007-04-12 06:35:15 UTC
(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.
Comment 7 Christian Faulhammer (RETIRED) gentoo-dev 2007-04-12 07:09:05 UTC
> 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.
Comment 8 Denis Dupeyron (RETIRED) gentoo-dev 2007-04-12 09:21:10 UTC
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.
Comment 9 Denis Dupeyron (RETIRED) gentoo-dev 2007-04-20 09:32:57 UTC
(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.