[parsec-users] Compiling blackscholes-tbb with -static

Christian Bienia cbienia at CS.Princeton.EDU
Fri Apr 16 17:51:00 EDT 2010


It's surprisingly difficult to convince gcc to create static binaries. I had
to compile my own version of gcc with shared libraries completely disabled.
You might also have to make the shared versions of some libraries
unavailable. Then rebuild everything and gcc will have no choice other than
creating a static version.


-----Original Message-----
From: parsec-users-bounces at lists.cs.princeton.edu
[mailto:parsec-users-bounces at lists.cs.princeton.edu] On Behalf Of Vivek Rane
Sent: Friday, April 16, 2010 5:26 PM
To: parsec-users at lists.cs.princeton.edu
Subject: [parsec-users] Compiling blackscholes-tbb with -static

Since our simulator in its current state only accepts static binaries,  
I'm trying to compile blackscholes-tbb statically  
(blackscholes-pthreads compiles successfully, but we're trying to  
study the behavior of tbb). I get the following error:

g++  -fPIC -o libtbbmalloc_debug.so.2 tbbmalloc.o  tbb_misc_malloc.o  
MemoryAllocator.o  -ldl -lpthread -lrt  -shared  
-Wl,-soname=libtbbmalloc_debug.so.2 -m64 -L/usr/lib64 -L/usr/lib  
-lpthread -static  
-tbb/lib -fPIC -fPIC  
/usr/lib64/gcc/x86_64-suse-linux/4.3/crtbeginT.o: relocation  
R_X86_64_32 against `__DTOR_END__' can not be used when making a  
shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.3/crtbeginT.o: could not read  
symbols: Bad value
collect2: ld returned 1 exit status

Since I'm already using -fPIC for the compilation, does this mean that  
I need to recompile crtbeginT.o with -fPIC? In that case, is there a  
workaround (I do not have permissions to crtbeginT.o)?

Thanks for your help.

- Vivek

parsec-users mailing list
parsec-users at lists.cs.princeton.edu

More information about the parsec-users mailing list