* g77/gfortran incompatibilities---name mangling
@ 2006-06-11 3:00 sean yang
2006-06-11 3:43 ` Tim Prince
0 siblings, 1 reply; 2+ messages in thread
From: sean yang @ 2006-06-11 3:00 UTC (permalink / raw)
To: gcc-help
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
----------------------------------------------------
_________________________________________________________________
DonÂt just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: g77/gfortran incompatibilities---name mangling
2006-06-11 3:00 g77/gfortran incompatibilities---name mangling sean yang
@ 2006-06-11 3:43 ` Tim Prince
0 siblings, 0 replies; 2+ messages in thread
From: Tim Prince @ 2006-06-11 3:43 UTC (permalink / raw)
To: sean yang; +Cc: gcc-help
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-11 3:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-11 3:00 g77/gfortran incompatibilities---name mangling sean yang
2006-06-11 3:43 ` Tim Prince
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).