porting g77 code to gfortran
Daniel Franke
franke.daniel@gmail.com
Sun Jan 6 23:41:00 GMT 2008
On Sunday 06 January 2008 23:16:44 Granville Sewell wrote:
Let's see:
> gfortran -c main.f
> gfortran -static main.o -L /home/sewell/lib -lpde2dgf64 -L /usr/X11R6/lib64
> -lX11 -lXt
> /usr/X11R6/lib64/libXt.a(Initialize.o): In function `GetRootDirName':
> (.text+0x223): warning: Using 'getpwnam_r' in statically linked
> applications requires at runtime the shared libraries from the glibc
> version used for linking
Drop '-static' and these will go away. Static linking is evil anyway ;)
> /usr/X11R6/lib64/libX11.a(XlibInt.o): In function
> `_XProcessInternalConnection': (.text+0x18c4): undefined reference to
> `pthread_equal'
Something, somewhere uses threads. Add '-lpthread'.
> /usr/X11R6/lib64/libX11.a(XlibInt.o):(.text+0x3345): more undefined
> references to `pthread_equal' follow /usr/X11R6/lib64/libXt.a(Event.o): In
> function `_XtEventInitialize': (.text+0x1305): undefined reference to
> `XCreateRegion'
As libX11 provides XCreateRegion, switch '-lX11 -lXt'. Use '-lXt -X11'.
Holds true for lot more of these.
> /usr/X11R6/lib64/libXt.a(Shell.o): In function `JoinSession':
> (.text+0x1669): undefined reference to `IceConnectionNumber'
Function `IceConnectionNumber' is defined in libICE. Add '-lICE'.
> [...]
Continue until you got rid of all messages.
To begin with, try something like:
$> gfortran main.o -L /home/sewell/lib -lpde2dgf64 -L /usr/X11R6/lib64 \
-Xt -lICE -lX11 -lpthread
Hope this helps.
Daniel
More information about the Fortran
mailing list