thanks for reply.<br><br>Goal is to generate mpif90 using mpich-1.2.7p1 using gfortran which will generate executable from our fortran code.<br><br>source files to be compiled are .f and .f90 files.<br><br>f2c flag is given because mp[if90 was not getting generated. no other reason. we want mpif90.<br>
<br>Now we have tried giving only FC=gfortran and no other flag of option except prefix, but still it is not generating mpif90 nor mpif77.<br><br>mpif90 generated  by using [export F90=fortran;F90FLAGS="-ff2c".] options if tries to compile our code, it throws error <br>
<br><br><path to mpif90>/mpif90 -f90=gfortran -Wl -o ../output_code.x set.o inp.o otp.o bvsol.o user_kg.o mpi_util.o mpi_communication.o mpi_memalloc.o driver.o rxn.o advdi_1d_finitediff_mf.o  aq_lib.o \<br>        -L/ioapi/Linux2_x86_64gfort -lioapi -L/np_cs/netcdf/INSTALL/lib -lnetcdf -L/usr/lib64/<br>
 -lgomp /np_cs/lapack/lapack-3.2.1/lapack_LINUX.a /np_cs/lapack/lapack-3.2.1/blas_LINUX.a<br>/build/lib/libmpich.a(farg.o): In function `mpir_iargc__':<br>farg.f:(.text+0x6): undefined reference to `f__xargc'<br>/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>make: *** [../output_code.x] Error 1<br><br>-akshar<br><br><br><br><br><br><div class="gmail_quote">On Tue, Sep 13, 2011 at 8:52 PM, Gus Correa <span dir="ltr"><<a href="mailto:gus@ldeo.columbia.edu">gus@ldeo.columbia.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Pavan and Akshar<br>
<br>
I see, it's MPICH-1.<br>
May I ask why?<br>
<br>
Would a workaround perhaps be to build only mpif77 (no mpif90),<br>
replace 'use mpi' by '#include "mpif.h"' in the application code,<br>
and recompile it with mpif77?<br>
<br>
I wonder if -ff2c works at all with Fortran90.<br>
(See man page detail below.)<br>
<br>
Anyway, I remember that there were complaints of runtime<br>
errors (P4 errors) with mpich-1,<br>
reported on this and other mailing lists,<br>
when running on current Linux kernels.<br>
Even with simple codes like the cpi example.<br>
Using MPICH-1 may be an uphill battle.<br>
<br>
I hope this helps,<br>
Gus Correa<br>
<br>
>From man gfortran (4.1.2):<br>
<br>
       -ff2c<br>
           Generate code designed to be compatible with code generated by g77 and f2c.<br>
<br>
           The calling conventions used by g77 (originally implemented in f2c) require functions that return type default "REAL" to actually return the C type<br>
           "double", and functions that return type "COMPLEX" to return the values via an extra argument in the calling sequence that points to where to store the<br>
           return value.  Under the default GNU calling conventions, such functions simply return their results as they would in GNU C -- default "REAL" functions<br>
           return the C type "float", and "COMPLEX" functions return the GNU C type "complex".  Additionally, this option implies the -fsecond-underscore option,<br>
           unless -fno-second-underscore is explicitly requested.<br>
<br>
           This does not affect the generation of code that interfaces with the libgfortran library.<br>
<br>
           Caution: It is not a good idea to mix Fortran code compiled with "-ff2c" with code compiled with the default "-fno-f2c" calling conventions as, calling<br>
           "COMPLEX" or default "REAL" functions between program parts which were compiled with different calling conventions will break at execution time.<br>
<br>
           Caution: This will break code which passes intrinsic functions of type default "REAL" or "COMPLEX" as actual arguments, as the library implementations<br>
           use the -fno-f2c calling conventions.<div><div></div><div class="h5"><br>
<br>
<br>
<br>
Pavan Balaji wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Gus: He doesn't want to use MPICH2. He's using MPICH-1.<br>
<br>
        -- Pavan<br>
<br>
On 09/13/2011 09:51 AM, Gus Correa wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Akshar<br>
<br>
Maybe the F90FLAGS="-ff2c" flag is causing the problem?<br>
What if you remove it and use gfortran for F77 and FC?<br>
<br>
<br>
Also, my 'configure -help' (a bit old, MPICH2 1.3.2p1)<br>
mentions FC, not F90, as the environment variable to be set.<br>
<br>
For what it is worth, MPICH2 builds fine for us, with<br>
gcc, g++ and gfortran (for F77 and FC).<br>
<br>
My two cents,<br>
Gus Correa<br>
<br>
akshar bhosale wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
    If i specify F77 anf F90 as gfortran, it doesn't create mpif90 and<br>
mpif77 at all.<br>
Please see attached config log<br>
If i specify F90=gfortran and F90FLAGS="-ff2c", the it creates mpif90<br>
and mpif77 but is generating below issue.<br>
Kindly help.<br>
-akshar<br>
<br>
On Tue, Sep 13, 2011 at 9:46 AM, Rajeev Thakur<<a href="mailto:thakur@mcs.anl.gov" target="_blank">thakur@mcs.anl.gov</a><br>
<mailto:<a href="mailto:thakur@mcs.anl.gov" target="_blank">thakur@mcs.anl.gov</a>>>  wrote:<br>
<br>
     In the configure step, if you specify both F77 and F90 as gfortran,<br>
     it should work.<br>
<br>
     Rajeev<br>
<br>
     On Sep 12, 2011, at 9:49 PM, akshar bhosale wrote:<br>
<br>
      >  Hi,<br>
      >  thanks.<br>
      >  but, in case of mpicc, it can be ignored, but in case of mpif90,<br>
     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,<br>
     world!".'<br>
      ><br>
      >      wtime = MPI_Wtime ( ) - wtime<br>
      >      write ( *, '(a)' ) ' '<br>
      >      write ( *, '(a,g14.6,a)' ) '  Elapsed wall clock time = ',<br>
     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>
      >  /scratch1/np_cs/trial1/build/<u></u>lib/libmpich.a(farg.o): In function<br>
     `mpir_iargc__':<br>
      >  farg.f:(.text+0x6): undefined reference to `f__xargc'<br>
      >  /scratch1/np_cs/trial1/build/<u></u>lib/libmpich.a(farg.o): In function<br>
     `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<br>
     <<a href="mailto:thakur@mcs.anl.gov" target="_blank">thakur@mcs.anl.gov</a><mailto:<a href="mailto:thakur@mcs.anl.gov" target="_blank">tha<u></u>kur@mcs.anl.gov</a>>>  wrote:<br>
      >  Ignore that. Compile a real program as mpicc foo.c.<br>
      ><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<br>
     get following error with undefined reference to main. options given<br>
     while configuring the same are :<br>
      >  >  export F90=fortran;F90FLAGS="-ff2c".<br>
      >  >  but error of undefined reference to main is observed in every<br>
     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<br>
     --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared<br>
     --enable-threads=posix --enable-checking=release --with-system-zlib<br>
     --enable-__cxa_atexit --disable-libunwind-exceptions<br>
     --enable-libgcj-multifile<br>
     --enable-languages=c,c++,objc,<u></u>obj-c++,java,fortran,ada<br>
     --enable-java-awt=gtk --disable-dssi --disable-plugin<br>
     --with-java-home=/usr/lib/jvm/<u></u>java-1.4.2-gcj-1.4.2.0/jre<br>
     --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-<u></u>redhat-linux/4.1.2/collect2<br>
     --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker<br>
     /lib64/ld-linux-x86-64.so.2<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crt1.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crti.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/crtbegin.o<br>
     -L/scratch1/np_cs/trial2/<u></u>build/lib<br>
     -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/<u></u>lib/em64t</a><<a href="http://10.2.2.025/lib/em64t" target="_blank">http://10.2.2.025/<u></u>lib/em64t</a>><br>
     -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/<u></u>lib/em64t</a><<a href="http://10.2.2.025/lib/em64t" target="_blank">http://10.2.2.025/<u></u>lib/em64t</a>><br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2<br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2<br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64<br>
     -L/lib/../lib64 -L/usr/lib/../lib64 -lmpich -lpthread -lrt -lgcc<br>
     --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s<br>
     --no-as-needed /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/crtend.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crtn.o<br>
      >  ><br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crt1.o: In<br>
     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/<u></u>build/lib -v<br>
     -lmpichf90 -lmpich -lpthread -lrt -lgfortranbegin -lgfortran -lm<br>
     -shared-libgcc<br>
      >  >  Using built-in specs.<br>
      >  >  Target: x86_64-redhat-linux<br>
      >  >  Configured with: ../configure --prefix=/usr<br>
     --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared<br>
     --enable-threads=posix --enable-checking=release --with-system-zlib<br>
     --enable-__cxa_atexit --disable-libunwind-exceptions<br>
     --enable-libgcj-multifile<br>
     --enable-languages=c,c++,objc,<u></u>obj-c++,java,fortran,ada<br>
     --enable-java-awt=gtk --disable-dssi --disable-plugin<br>
     --with-java-home=/usr/lib/jvm/<u></u>java-1.4.2-gcj-1.4.2.0/jre<br>
     --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-<u></u>redhat-linux/4.1.2/collect2<br>
     --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker<br>
     /lib64/ld-linux-x86-64.so.2<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crt1.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crti.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/crtbegin.o<br>
     -L/scratch1/np_cs/trial2/<u></u>build/lib<br>
     -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/<u></u>lib/em64t</a><<a href="http://10.2.2.025/lib/em64t" target="_blank">http://10.2.2.025/<u></u>lib/em64t</a>><br>
     -L/opt/intel/mkl/<a href="http://10.2.2.025/lib/em64t" target="_blank">10.2.2.025/<u></u>lib/em64t</a><<a href="http://10.2.2.025/lib/em64t" target="_blank">http://10.2.2.025/<u></u>lib/em64t</a>><br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2<br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2<br>
     -L/usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64<br>
     -L/lib/../lib64 -L/usr/lib/../lib64 -lmpichf90 -lmpich -lpthread<br>
     -lrt -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/crtend.o<br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/../../../../lib64/<u></u>crtn.o<br>
      >  ><br>
     /usr/lib/gcc/x86_64-redhat-<u></u>linux/4.1.2/libgfortranbegin.<u></u>a(fmain.o):<br>
     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<br>
     <<a href="mailto:wgropp@illinois.edu" target="_blank">wgropp@illinois.edu</a><mailto:<a href="mailto:wgropp@illinois.edu" target="_blank">wg<u></u>ropp@illinois.edu</a>>>  wrote:<br>
      >  >  You can use gfortran for F77 and F90.  If your requirement is<br>
     to use gfortran for F77 and a different fortran for F90, then they<br>
     will need to use consistent linker names, calling conventions, data<br>
     sizes, and libraries.  The config.log file will have details on why<br>
     configure decided that the Fortran 77 and Fortran 90 compilers were<br>
     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<br>
     flags as : CC=gcc;F90=fortran;F77=<u></u>gfortran; and tried to configure,<br>
     it throws error as configure: error: Fortran 90 and Fortran 77<br>
     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>
      >  >  ______________________________<u></u>_________________<br>
      >  >  mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
     <mailto:<a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.<u></u>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/<u></u>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>
      >  >  ______________________________<u></u>_________________<br>
      >  >  mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
     <mailto:<a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.<u></u>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/<u></u>mailman/listinfo/mpich-discuss</a><br>
      ><br>
      >  ______________________________<u></u>_________________<br>
      >  mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
     <mailto:<a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.<u></u>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/<u></u>mailman/listinfo/mpich-discuss</a><br>
      ><br>
      >  ______________________________<u></u>_________________<br>
      >  mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
     <mailto:<a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.<u></u>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/<u></u>mailman/listinfo/mpich-discuss</a><br>
<br>
     ______________________________<u></u>_________________<br>
     mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.gov</a><br>
     <mailto:<a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">mpich-discuss@mcs.anl.<u></u>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/<u></u>mailman/listinfo/mpich-discuss</a><br>
<br>
<br>
<br>
------------------------------<u></u>------------------------------<u></u>------------<br>
<br>
______________________________<u></u>_________________<br>
mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">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/<u></u>mailman/listinfo/mpich-discuss</a><br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">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/<u></u>mailman/listinfo/mpich-discuss</a><br>
</blockquote>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
mpich-discuss mailing list     <a href="mailto:mpich-discuss@mcs.anl.gov" target="_blank">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/<u></u>mailman/listinfo/mpich-discuss</a><br>
</div></div></blockquote></div><br>