|
From: Tom H. <to...@co...> - 2006-05-16 12:49:37
|
In message <446...@ra...>
Andy Howell <And...@ra...> wrote:
> I checked out the latest from SVN, but was not able build. It fails with:
>
> gcc -Wno-long-long -Wdeclaration-after-statement -o
> valgrind-listener -m64 -fomit-frame-pointer -O -g -Wmissing-prototypes
> -Winline -Wall -Wshadow -Wpointer-arith -Wstrict-prototypes
> -Wmissing-declarations valgrind_listener-valgrind-listener.o
> mpicc -g -O -fno-omit-frame-pointer -Wall -fpic -shared \
> -I../include \
> -m64 \
> -o libmpiwrap.so libmpiwrap.c
> /usr/bin/ld: /usr/lib64/libmpi.a(laminit.o): relocation R_X86_64_32S
> against `lam_mpi_comm_world' can not be used when making a shared
> object; recompile with -fPIC
> /usr/lib64/libmpi.a: could not read symbols: Bad value
>
> I tried changes the -fpic to -fPIC in auxprogs/Makefile.in and
> Makefile.am, but no luck.
It's libmpi.a that needs to be recompiled with -fPIC not callgrind.
The problem is that it is trying to link a static library into a
shared object and you can't do that on amd64 (unless you happen to
have compiled the code in the static library as PIC code for some
weird reason).
On x86 you shouldn't really do it but you can get away with it because
the dynamic linker will do the necessary relocations when the
resulting shared object is loaded. The amd64 dynamic linker doesn't
have that kludge so the linker stops you creating an object that
would require it.
So what you really need is a libmpi.so with PIC code in it ;-)
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|