From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27932 invoked by alias); 11 Jun 2006 03:43:38 -0000 Received: (qmail 27923 invoked by uid 22791); 11 Jun 2006 03:43:37 -0000 X-Spam-Check-By: sourceware.org Received: from smtp109.sbc.mail.mud.yahoo.com (HELO smtp109.sbc.mail.mud.yahoo.com) (68.142.198.208) by sourceware.org (qpsmtpd/0.31) with SMTP; Sun, 11 Jun 2006 03:43:36 +0000 Received: (qmail 73380 invoked from network); 11 Jun 2006 03:43:31 -0000 Received: from unknown (HELO ?68.125.161.25?) (timothyprince@sbcglobal.net@68.125.161.25 with plain) by smtp109.sbc.mail.mud.yahoo.com with SMTP; 11 Jun 2006 03:43:30 -0000 Message-ID: <448B9161.9070609@sbcglobal.net> Date: Sun, 11 Jun 2006 03:43:00 -0000 From: Tim Prince Reply-To: tprince@myrealbox.com User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: sean yang CC: gcc-help@gcc.gnu.org Subject: Re: g77/gfortran incompatibilities---name mangling References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg00093.txt.bz2 sean yang wrote: > I saw a same question asked on the mailing list(date back to last year), > but it was not answered. > > Can I somehow make the code compiled by gfortran compatible to the code > compiled by g77? Because symbol name in lots of libraries are g77 > compitable. Here is a concrete example, > > I tried to compile the following mpi programs with g77(the fotran > compiler under the directory /usr/bin on my machine) and gfotran (the > fortran compiler I generated from gcc 4.0.2) > #/usr/bin/g77 -c test.f > #nm test.o > 00000029 T MAIN__ > U mpi_comm_rank__ > U mpi_comm_size__ > U mpi_finalize__ > U mpi_init__ > > > #/home/gcc402/bin/gfortran -c test.f > #nm test.o > 00000000 T MAIN__ > U mpi_comm_rank_ > U mpi_comm_size_ > U mpi_finalize_ > U mpi_init_ > --------------------test.f------------- > program main > > include 'mpif.h' > > double precision PI25DT > parameter (PI25DT = 3.141592653589793238462643d0) > > double precision mypi, pi, h, sum, x, f, a > integer n, myid, numprocs, i, rc > c function to integrate > f(a) = 4.d0 / (1.d0 + a*a) > > call MPI_INIT( ierr ) > call MPI_COMM_RANK( MPI_COMM_WORLD, myid, ierr ) > call MPI_COMM_SIZE( MPI_COMM_WORLD, numprocs, ierr ) > > 30 call MPI_FINALIZE(rc) > stop > end AFAIK, every version of MPI includes a system for adapting to the default underscore-appending scheme of gfortran. That scheme would be preferable to use of the second_underscore option. In either case, you'll have to break out TFM. If you are trying to combine g77 and gfortran, don't. Several versions of MPI also have FAQs and help lists of their own.