Hi,<br>thanks.<br>but, in case of mpicc, it can be ignored, but in case of mpif90, it is still an issue.<br>e.g. hello_mpi.f90 program <br>####################<br>program main<br> use mpi<br>!<br>! implicit none<br>!<br>
integer error<br> integer id<br> integer p<br> real ( kind = 8 ) wtime<br>!<br>! Initialize MPI.<br>!<br> call MPI_Init ( error )<br>!<br>! Get the number of processes.<br>!<br> call MPI_Comm_size ( MPI_COMM_WORLD, p, error )<br>
<br>!<br>! Get the individual process ID.<br>!<br> call MPI_Comm_rank ( MPI_COMM_WORLD, id, error )<br>!<br>! Print a message.<br>!<br> if ( id == 0 ) then<br><br> wtime = MPI_Wtime ( )<br><br> write ( *, '(a)' ) ' '<br>
write ( *, '(a)' ) 'HELLO_MPI - Master process:'<br> write ( *, '(a)' ) ' FORTRAN90/MPI version'<br> write ( *, '(a)' ) ' '<br> write ( *, '(a)' ) ' An MPI test program.'<br>
write ( *, '(a)' ) ' '<br> write ( *, '(a,i8)' ) ' The number of processes is ', p<br> write ( *, '(a)' ) ' '<br><br> end if<br><br> write ( *, '(a)' ) ' '<br>
write ( *, '(a,i8,a)' ) ' Process ', id, ' says "Hello, world!"'<br><br> if ( id == 0 ) then<br><br> write ( *, '(a)' ) ' '<br> write ( *, '(a)' ) 'HELLO_MPI - Master process:'<br>
write ( *, '(a)' ) ' Normal end of execution: "Goodbye, world!".'<br><br> wtime = MPI_Wtime ( ) - wtime<br> write ( *, '(a)' ) ' '<br> write ( *, '(a,g14.6,a)' ) ' Elapsed wall clock time = ', wtime, ' seconds.'<br>
<br> end if<br> !<br> ! Shut down MPI.<br> !<br> call MPI_Finalize ( error )<br><br> stop<br> end<br>############################<br> <br>$ ../../../build/bin/mpif90 hello_mpi.f90 <br><div class="gmail_quote">/scratch1/np_cs/trial1/build/lib/libmpich.a(farg.o): In function `mpir_iargc__':<br>
farg.f:(.text+0x6): undefined reference to `f__xargc'<br>/scratch1/np_cs/trial1/build/lib/libmpich.a(farg.o): In function `mpir_getarg__':<br>farg.f:(.text+0x38): undefined reference to `getarg_'<br>collect2: ld returned 1 exit status<br>
<br><br><br><br><br><br><br><br><br><br><br><br>On Mon, Sep 12, 2011 at 9:42 AM, Rajeev Thakur <span dir="ltr"><<a href="mailto:thakur@mcs.anl.gov">thakur@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Ignore that. Compile a real program as mpicc foo.c.<br>
<div><div></div><div class="h5"><br>
On Sep 11, 2011, at 8:38 PM, akshar bhosale wrote:<br>
<br>
> Hi,<br>
> thank you for reply.<br>
><br>
> I tried to install it make it using following options now and i get following error with undefined reference to main. options given while configuring the same are :<br>
> export F90=fortran;F90FLAGS="-ff2c".<br>
> but error of undefined reference to main is observed in every executable like :<br>
><br>
> ./mpicc -v<br>
> mpicc for 1.2.7 (release) of : 2005/06/22 16:33:49<br>
> Using built-in specs.<br>
> Target: x86_64-redhat-linux<br>
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux<br>
> Thread model: posix<br>
> gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)<br>
> /usr/libexec/gcc/x86_64-redhat-linux/4.1.2/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbegin.o -L/scratch1/np_cs/trial2/build/lib -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/lib/em64t</a> -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/lib/em64t</a> -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lmpich -lpthread -lrt -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o<br>
> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':<br>
> (.text+0x20): undefined reference to `main'<br>
> collect2: ld returned 1 exit status<br>
><br>
> ./mpif90 -v<br>
> mpif90 for 1.2.7 (release) of : 2005/06/22 16:33:49<br>
> Driving: gfortran -L/scratch1/np_cs/trial2/build/lib -v -lmpichf90 -lmpich -lpthread -lrt -lgfortranbegin -lgfortran -lm -shared-libgcc<br>
> Using built-in specs.<br>
> Target: x86_64-redhat-linux<br>
> Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --disable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux<br>
> Thread model: posix<br>
> gcc version 4.1.2 20080704 (Red Hat 4.1.2-50)<br>
> /usr/libexec/gcc/x86_64-redhat-linux/4.1.2/collect2 --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbegin.o -L/scratch1/np_cs/trial2/build/lib -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/lib/em64t</a> -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/lib/em64t</a> -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -lmpichf90 -lmpich -lpthread -lrt -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtend.o /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crtn.o<br>
> /usr/lib/gcc/x86_64-redhat-linux/4.1.2/libgfortranbegin.a(fmain.o): In function `main':<br>
> (.text+0xa): undefined reference to `MAIN__'<br>
> collect2: ld returned 1 exit status<br>
><br>
> Am i missing somethin?<br>
> thank you<br>
> -akshar<br>
><br>
> On Mon, Sep 12, 2011 at 1:24 AM, William Gropp <<a href="mailto:wgropp@illinois.edu">wgropp@illinois.edu</a>> wrote:<br>
> You can use gfortran for F77 and F90. If your requirement is to use gfortran for F77 and a different fortran for F90, then they will need to use consistent linker names, calling conventions, data sizes, and libraries. The config.log file will have details on why configure decided that the Fortran 77 and Fortran 90 compilers were not compatible.<br>
><br>
> Bill<br>
><br>
><br>
> On Sep 9, 2011, at 4:28 PM, akshar bhosale wrote:<br>
><br>
> hi,<br>
> we have requirement of mpich-1.2.7 with gfortran. We have fiven flags as : CC=gcc;F90=fortran;F77=gfortran; and tried to configure, it throws error as configure: error: Fortran 90 and Fortran 77 compilers are not compatible..<br>
> We have to do it using gfortran only. os is rhel5.1 64 bit<br>
> what extran flags settings we have to do?<br>
><br>
> -akshar<br>
> _______________________________________________<br>
> mpich-discuss mailing list <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
><br>
> William Gropp<br>
> Director, Parallel Computing Institute<br>
> Deputy Director for Research<br>
> Institute for Advanced Computing Applications and Technologies<br>
> Paul and Cynthia Saylor Professor of Computer Science<br>
> University of Illinois Urbana-Champaign<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> mpich-discuss mailing list <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
> To manage subscription options or unsubscribe:<br>
> <a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
<br>
_______________________________________________<br>
mpich-discuss mailing list <a href="mailto:mpich-discuss@mcs.anl.gov">mpich-discuss@mcs.anl.gov</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss" target="_blank">https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss</a><br>
</div></div></blockquote></div><br>