[MPICH] mpich2 1.0.3, 32 bits build problem on Redhat ES4, amd64

Martin Siegert siegert at sfu.ca
Thu Aug 17 13:41:45 CDT 2006


Hi Tan,

On Thu, Aug 17, 2006 at 11:14:30AM -0700, chong tan wrote:
> thank martin, 
> that magically worked, any explanation ?
> 
> tan

Your approach was at least missing something like

LDFLAGS="-m32"

however, libtool is particularly bad in supporting LDFLAGS - it has
its onw ideas which LDFLAGS should be passed on to the link stage
and which ones should not be. Usually I end up running configure
first and then edit the generated "libtool" files where I change
the compiler_flags=... setting (which is empty by default) to
(in your case) compiler_flags="-m32". MPICH2 is actually fairly
easy in that respect as it uses libtool only in two directories.
Nevertheless, it is easier just to define a new compiler "gcc -m32"
which will work for the compile and link stage.

Martin

> --- Martin Siegert <siegert at sfu.ca> wrote:
> 
> > Hi tan,
> > 
> > On Wed, Aug 16, 2006 at 05:21:58PM -0700, chong tan
> > wrote:
> > > using gcc 4.0.2.  The 64bits build works fine.
> > > 
> > > I am using 2 csh files to do the build, first is a
> > > debug build, which works OK :
> > > 
> > > -----
> > > #!/bin/csh -f
> > > setenv CFLAGS "-g -m32"
> > > setenv CC gcc
> > > setenv CXX g++
> > > setenv CXXFLAGS "-g -m32"
> > > ./configure -prefix=/usr/local/mpich --enable-cxx
> > > --disable-f77 --disable-f90
> > > make
> > > make install
> > > ------
> > > 
> > > The second, which is the optimized , with no
> > checking:
> > > ---------
> > > #!/bin/csh -f
> > > setenv CFLAGS "-O2 -m32"
> > > setenv CC gcc
> > > setenv CXX g++
> > > setenv CXXFLAGS "-O2 -m32"
> > > ./configure -prefix=/usr/local/mpich_opt
> > --enable-fast
> > > --enable-cxx --disable-f77 --disabl
> > > e-f90
> > > make
> > > make install
> > > --------
> > > 
> > > when the library is, libmpichcxx.a, is linked with
> > an
> > > 32 bit application (co,piled -m32), the one built
> > with
> > > '--enable-fast' causes :
> > > 
> > > -/usr/bin/ld: skipping incompatible
> > > /usr/local/mpich_opt/lib/libmpichcxx.a when
> > searching
> > > f
> > > or -lmpichcxx
> > > /usr/bin/ld: cannot find -lmpichcxx
> > > collect2: ld returned 1 exit status
> > > 
> > > appearantly the library is built 64bit even with
> > > "-m32".  
> > > the difference between the 2 scripts are '-g' and
> > > '-O2', and this '--enable-fast'.  
> > > 
> > > Any suggestion ?
> > 
> > Try
> > 
> > setenv CFLAGS "-O2"
> > setenv CC "gcc -m32"
> > setenv CXX "g++ -m32"
> > setenv CXXFLAGS "-O2"
> > 
> > Cheers,
> > Martin
> > 
> > -- 
> > Martin Siegert
> > Head, HPC at SFU
> > WestGrid Site Lead
> > Academic Computing Services                phone:
> > (604) 291-4691
> > Simon Fraser University                    fax:  
> > (604) 291-4242
> > Burnaby, British Columbia                  email:
> > siegert at sfu.ca
> > Canada  V5A 1S6




More information about the mpich-discuss mailing list