[mpich-discuss] issues when writing a simple makefile to build MPI programs

Anthony Chan chan at mcs.anl.gov
Sat Jun 25 10:51:39 CDT 2011


Clara,

Pavan is right.  You should send us all the log files as stated in the README
as it will generally speed up our response time.  Reading config.log takes
longer..., in your case, the config.log alone suggests your gfortran fails
to link with -m32.

configure:10277: checking whether Fortran 77 compiler accepts option -O2
configure:10326: gfortran -o conftest -m32    conftest.f   > pac_test1.log 2>&1
configure:10326: $? = 1
configure: failed program was:
|       program main
| 
|       end
configure:10476: result: no
........
........
configure:10755: gfortran -o conftest -m32 -v conftest.f
Using built-in specs.
Target: x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 
........
GNU assembler version 2.21.0 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.21.0.20110327
 /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/collect2 --build-id --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -z relro -o conftest /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../lib32/crt1.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../lib32/crti.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/32/crtbegin.o -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/32 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../lib32 -L/lib/../../lib32 -L/usr/lib/../../lib32 -L/usr/lib/x86_64-linux-gnu/../../lib32 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2 -L/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../.. -L/usr/lib/x86_64-linux-gnu /tmp/ccgx7uRn.o -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/32/crtend.o /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../lib32/crtn.o
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libgfortran.so when searching for -lgfortran
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libgfortran.a when searching for -lgfortran
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status

The linker can't find 32bit gfortran library, possibly because you don't have 32bit gfortran support.

A.Chan
----- Original Message -----
> See attached please.
> 
> On Sat, Jun 25, 2011 at 11:03 AM, Pavan Balaji <balaji at mcs.anl.gov>
> wrote:
> 
> >
> > Can you please send all the log files requested in the README? It's
> > very
> > hard to help you otherwise.
> >
> >
> > On 06/25/2011 10:01 AM, clara wrote:
> >
> >> Please see attached, thanks.
> >> Btw, can you tell me which options need be set (the process manager
> >> is
> >> selected gforker) if I don't want the generated mpicc to use "-lopa
> >> -lmpl -lrt"?
> >> About the above libraries, opa means "OpenPA", which is to provide
> >> atomics library. mpl means what? Is it "message passing library"?
> >> If so,
> >> why can I only see C files about env, string and mem operations in
> >> src/mpl/src?
> >>
> >> - Clara
> >>
> >> On Sat, Jun 25, 2011 at 10:44 AM, Pavan Balaji <balaji at mcs.anl.gov
> >> <mailto:balaji at mcs.anl.gov>> wrote:
> >>
> >>
> >>    I don't see the error in the log you sent. Please send us the
> >>    log
> >>    files as described in the README.
> >>
> >>      -- Pavan
> >>
> >>
> >>    On 06/25/2011 09:40 AM, clara wrote:
> >>
> >>        Attached please find the output info when I ran configure
> >>        with -m32
> >>        option. Because I am building 64-bit libraries, the log
> >>        files
> >>        cannot be
> >>        obtained now.
> >>
> >>        - Clara
> >>
> >>        On Sat, Jun 25, 2011 at 10:28 AM, Pavan Balaji
> >>        <balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>>
> >>        wrote:
> >>
> >>
> >>            Can you send us the log files are described in the
> >>            README?
> >>        Please
> >>            compress them as they can be huge.
> >>
> >>              -- Pavan
> >>
> >>
> >>            On 06/25/2011 09:12 AM, clara wrote:
> >>
> >>                Thanks, but now I get the below error:
> >>                configure: error: Could not determine a way to link
> >>                a
> >>        Fortran
> >>                test program!
> >>
> >>
> >>                On Sat, Jun 25, 2011 at 9:59 AM, Pavan Balaji
> >>        <balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>>>
> >>        wrote:
> >>
> >>
> >>                    It's "CFLAGS", not "CFLAG".
> >>
> >>                      -- Pavan
> >>
> >>
> >>                    On 06/25/2011 08:42 AM, clara wrote:
> >>
> >>                        I executed the following command:
> >>                        ./configure
> >>        --prefix=/mnt/lux/git/pios/xc/**______mpich2-32
> >>                        --with-pm=gforker
> >>                        --disable-faster CFLAG=-m32 CXXFLAGS=-m32
> >>        FFLAGS=-m32
> >>                FCFLAGS=-m32
> >>
> >>                        and got the below errors:
> >>                        configure: error: **** Incompatible Fortran
> >>                        and C
> >>                Object File
> >>                        Types! ****
> >>                        F77 Object File Type produced by "gfortran
> >>                        -m32
> >>        " is : : ELF
> >>                        32-bit LSB
> >>                        relocatable, Intel 80386, version 1 (SYSV),
> >>                        not
> >>        stripped.
> >>                          C Object File Type produced by "gcc -O2"
> >>        is : :
> >>                ELF 64-bit LSB
> >>                        relocatable, x86-64, version 1 (SYSV), not
> >> stripped.
> >>
> >>                        Is there any simple way setting -m32 in
> >>                        order to
> >>        build
> >>                32-bit
> >>                        libraries
> >>                        on 64-bit system?
> >>
> >>                        - Clara
> >>
> >>                        On Fri, Jun 24, 2011 at 11:53 AM, Anthony
> >>                        Chan
> >>        <chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>>>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>
> >>        <mailto:chan at mcs.anl.gov <mailto:chan at mcs.anl.gov>>>>>
> >>        wrote:
> >>
> >>
> >>                            You need to rebuild mpich2 for 32bit.
> >>                            Set
> >>                            CFLAGS/CXXFLAGS/FFLAGS/FCFLAGS
> >>                            to -m32 (assume your system has the
> >>                            32bit
> >>        support).
> >>
> >>                            BTW, your install of 1.2.1p1 mpich2 is
> >>                            old,
> >>        please
> >>                upgrade
> >>                        if possible
> >>                            (the latest stable release is 1.4)
> >>
> >>                            A.Chan
> >>
> >>                            ----- Original Message -----
> >>         > I think the default installed mpich2 in 64-bit ubuntu is
> >>         > in
> >>                        x86_64
> >>         > mode.
> >>         > When I try to compile/link an MPI program in 32-bit mode,
> >>                        there is an
> >>         > error
> >>         > below:
> >>         > /usr/lib/libmpich.so: file not recognized: File format
> >>         > not
> >>                        recognized
> >>         >
> >>         > How can I configure the compile/link flags? Do I need to
> >>         > rebuild
> >>         > mpich2 to
> >>         > get a 32-bit libraries? Or is there any 32-bit libraries
> >>                        coexisted
> >>         > with
> >>         > 64-bit libraries? Thanks.
> >>         >
> >>         > Below is the output version information of the default
> >>         > installed
> >>         > MPICH2:
> >>         > MPICH2 Version: 1.2.1p1
> >>         > MPICH2 Release date: Unknown, built on Tue Apr 27
> >>         > 15:06:31
> >>                        UTC 2010
> >>         > MPICH2 Device: ch3:nemesis
> >>         > MPICH2 configure: --build=x86_64-linux-gnu --prefix=/usr
> >>         > --includedir=${prefix}/include
> >>         > --mandir=${prefix}/share/man
> >>         > --infodir=${prefix}/share/info --sysconfdir=/etc
> >>                        --localstatedir=/var
> >>         > --libexecdir=${prefix}/lib/___**___mpich2
> >> --disable-maintainer-mode
> >>         > --disable-dependency-tracking --disable-silent-rules
> >>         > --srcdir=.
> >>         > --enable-sharedlibs=gcc --prefix=/usr --enable-f90
> >>         > --sysconfdir=/etc/mpich2
> >>         > --includedir=/usr/include/____**__mpich2
> >>                --docdir=/usr/share/doc/mpich2
> >>         > MPICH2 CC: gcc -g -O2 -g -Wall -O2 -O2
> >>         > MPICH2 CXX: c++ -g -O2 -g -Wall -O2 -O2
> >>         > MPICH2 F77: gfortran -g -O2 -O2
> >>         > MPICH2 F90: f95 -O2
> >>         >
> >>         > - Clara
> >>         >
> >>         > On Fri, Jun 24, 2011 at 12:08 AM, Pavan Balaji
> >>        <balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>
> >>        <mailto:balaji at mcs.anl.gov <mailto:balaji at mcs.anl.gov>>>>**>
> >>
> >>
> >>         > wrote:
> >>         >
> >>         > > Clara,
> >>         > >
> >>         > >
> >>         > > On 06/23/2011 10:53 PM, clara wrote:
> >>         > >
> >>         > >> If I only use shared memory communication among
> >>         > >> processes on
> >> a
> >>         > >> single
> >>         > >> node, how can I configure the mpich2.1.4 (except
> >>                            --with-pm=gforker)
> >>         > >> in
> >>         > >> order to link libraries as little as possible?
> >>         > >>
> >>         > >
> >>         > > Shared memory communication support comes by default in
> >>                        MPICH2. You
> >>         > > don't
> >>         > > need to pass any special configure options; not even
> >>         > > --with-pm=gforker.
> >>         > > Unfortunately, all libraries are still required to be
> >>                        linked with
> >>         > > even when
> >>         > > only shared memory support is needed.
> >>         > >
> >>         > >  -- Pavan
> >>         > >
> >>         > >
> >>         > > --
> >>         > > Pavan Balaji
> >>         > > http://www.mcs.anl.gov/~balaji
> >>         > >
> >>         >
> >>         > ______________________________**_______________________
> >>         > mpich-discuss mailing list
> >>         > mpich-discuss at mcs.anl.gov
> >>         > <mailto:mpich-discuss at mcs.anl.**gov<mpich-discuss at mcs.anl.gov>
> >> >
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>
> >>        <mailto:mpich-discuss at mcs.anl.
> >>        <mailto:mpich-discuss at mcs.anl.**>____gov
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>>
> >>        <mailto:mpich-discuss at mcs.anl
> >>        <mailto:mpich-discuss at mcs.anl>**.
> >>        <mailto:mpich-discuss at mcs.anl
> >>        <mailto:mpich-discuss at mcs.anl>**.__>____gov
> >>        <mailto:mpich-discuss at mcs.anl.
> >>        <mailto:mpich-discuss at mcs.anl.**>____gov
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>
> >> >>>>
> >>
> >>         >
> >>        https://lists.mcs.anl.gov/____**__mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/______mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >> >
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>__>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss>
> >> **>__>__>
> >>
> >>          ______________________________**_______________________
> >>                            mpich-discuss mailing list
> >>        mpich-discuss at mcs.anl.gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov<mpich-discuss at mcs.anl.gov>
> >> >
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>
> >>        <mailto:mpich-discuss at mcs.anl.
> >>        <mailto:mpich-discuss at mcs.anl.**>____gov
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>>
> >>        <mailto:mpich-discuss at mcs.anl
> >>        <mailto:mpich-discuss at mcs.anl>**.
> >>        <mailto:mpich-discuss at mcs.anl
> >>        <mailto:mpich-discuss at mcs.anl>**.__>____gov
> >>        <mailto:mpich-discuss at mcs.anl.
> >>        <mailto:mpich-discuss at mcs.anl.**>____gov
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>
> >> >>>>
> >>
> >>        https://lists.mcs.anl.gov/____**__mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/______mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >> >
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>__>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss>
> >> **>__>__>
> >>
> >>
> >>
> >>
> >>
> >>          ______________________________**_______________________
> >>                        mpich-discuss mailing list
> >>        mpich-discuss at mcs.anl.gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov<mpich-discuss at mcs.anl.gov>
> >> >
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>
> >>        <mailto:mpich-discuss at mcs.anl.
> >>        <mailto:mpich-discuss at mcs.anl.**>____gov
> >>        <mailto:mpich-discuss at mcs.anl.**__gov
> >>        <mailto:mpich-discuss at mcs.anl.**gov
> >>        <mpich-discuss at mcs.anl.gov>>>>
> >>        https://lists.mcs.anl.gov/____**__mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/______mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >> >
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>__>
> >>        <https://lists.mcs.anl.gov/___**_mailman/listinfo/mpich-**discuss<https://lists.mcs.anl.gov/____mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >> **>
> >>        <https://lists.mcs.anl.gov/__**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/__mailman/listinfo/mpich-discuss>
> >>        <https://lists.mcs.anl.gov/**mailman/listinfo/mpich-discuss<https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss>
> >> **>__>__>
> >>
> >>
> >>                    --
> >>                    Pavan Balaji
> >>        http://www.mcs.anl.gov/~balaji
> >>
> >>
> >>
> >>            --
> >>            Pavan Balaji
> >>        http://www.mcs.anl.gov/~balaji
> >>
> >>
> >>
> >>    --
> >>    Pavan Balaji
> >>    http://www.mcs.anl.gov/~balaji
> >>
> >>
> >>
> > --
> > Pavan Balaji
> > http://www.mcs.anl.gov/~balaji
> >
> 
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss


More information about the mpich-discuss mailing list