Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 126774 - sys-cluster/mpich-1.2.7_p1 AMD64 -fPIC
Summary: sys-cluster/mpich-1.2.7_p1 AMD64 -fPIC
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal
Assignee: AMD64 Project
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks: 130381
  Show dependency tree
 
Reported: 2006-03-19 03:05 UTC by Sebastiaan
Modified: 2008-04-28 16:46 UTC (History)
5 users (show)

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


Attachments
1.2.7_p1-fpic-fix.patch (1.2.7_p1-fpic-fix.patch,4.30 KB, patch)
2006-08-21 16:25 UTC, Ahmed Ammar (RETIRED)
Details | Diff
mpich-1.2.7_p1.ebuild (modified) (mpich-1.2.7_p1.ebuild,4.05 KB, text/plain)
2006-08-21 16:26 UTC, Ahmed Ammar (RETIRED)
Details
Mpich ebuild that fixed lack of shared libraries (mpich-1.2.7_p1.ebuild,4.39 KB, text/plain)
2008-04-28 16:43 UTC, Adam Carheden
Details
fixes failure to create libmpich.so.1.0 (1.2.7_p1-fix-sharedlib-breakage.patch,786 bytes, patch)
2008-04-28 16:46 UTC, Adam Carheden
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastiaan 2006-03-19 03:05:10 UTC
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
Comment 1 Ahmed Ammar (RETIRED) gentoo-dev 2006-08-21 16:25:21 UTC
Created attachment 94810 [details, diff]
1.2.7_p1-fpic-fix.patch

Fixed some Makefile.in files to build needed libs with -fPIC.
Comment 2 Ahmed Ammar (RETIRED) gentoo-dev 2006-08-21 16:26:24 UTC
Created attachment 94811 [details]
mpich-1.2.7_p1.ebuild (modified)
Comment 3 Simon Stelling (RETIRED) gentoo-dev 2006-09-02 06:00:27 UTC
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.
Comment 4 Adam Carheden 2008-04-28 16:39:55 UTC
(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.
Comment 5 Adam Carheden 2008-04-28 16:43:09 UTC
Created attachment 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
Comment 6 Adam Carheden 2008-04-28 16:46:34 UTC
Created attachment 151254 [details, diff]
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 ';'