Home | Docs | Forums | Lists | Bugs | Planet | Store | GMN | Get Gentoo!
Not eligible to see or edit group visibility for this bug.
View Bug Activity | Format For Printing | XML | Clone This Bug
Hi, I have been trying to compile VTK-5 on amd64 (see bug #123178), but the compilation fails when trying to link with libmpich.a: Linking CXX shared library ../bin/libvtkParallel.so /usr/lib/gcc/x86_64-pc-linux-gnu/4.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/X11R6/lib64/libmpich.a(isend.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC /usr/X11R6/lib64/libmpich.a: could not read symbols: Bad value collect2: ld returned 1 exit status When I build mpich with -fPIC I have no problems. This is only a problem on amd64, i386 works fine. Greetz, Sebastiaan
Created an attachment (id=94810) [details] 1.2.7_p1-fpic-fix.patch Fixed some Makefile.in files to build needed libs with -fPIC.
Created an attachment (id=94811) [details] mpich-1.2.7_p1.ebuild (modified)
This is not a bug in mpich. vtk tries to link the .a against the shared library, which is a no-go. vtk should either build static libs too or not link against mpich I guess. Either way, as vtk is not keyworded ~amd64 at all, this bug is not an issue for Gentoo, you should take it upstream.
(In reply to comment #3) > This is not a bug in mpich. vtk tries to link the .a against the shared > library, which is a no-go. vtk should either build static libs too or not link > against mpich I guess. Either way, as vtk is not keyworded ~amd64 at all, this > bug is not an issue for Gentoo, you should take it upstream. > I had the same issue and ended up solving it both by compiling mpich with -fPIC (both FFLAGS and CFLAGS) and making some symbols static in src/misc2/darray.c. I won't claim my solutions is the "correct" because the gory details of position independent code are far too boring to thoroughly understand, but I did end up with libmpich.so, while the ebuild in portage fails to produce it (the @#$* mpich makefile fails silently). An modified ebuild and patch will be attached shortly. Also, I added a sharedlib use flag, so if you use my ebuild, don't forget to compile with that. Finally, I'm getting (and fixing) the same problem on both x86 and amd64, so I don't think it's limited to amd64.
Created an attachment (id=151252) [details] Mpich ebuild that fixed lack of shared libraries Patches mpich bug on some symbols that should be static, adds -fPIC to CFLAGS and FFLAGS, and fixes sharedlibdir in /etc/mpich/mpichlib.conf
Created an attachment (id=151254) [details] fixes failure to create libmpich.so.1.0 Makes MPIOI_Type_block and MPIOI_Type_cyclic static. Without this, mpich files to make libmpich.so.1.0. Worse yet, the makefile doesn't bother to exit with error, so make thinks everything is hunky dory. Let this be a lesson to all you makers out there: always '&&', never ';'