- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to compile an ANSI compatible FORTRAN program that was written in '98 and link it with two additional object files that were compiled with the f77 compiler provided with RH Linux 5.1. I am new to Linux and have exhausted all imaginable options. I can compile fine with the -c option however, I cannot link the program. I get the following errors when I execute :
ifort -o dataonlyb dataonlyb.o ../gasp_v33b.o ../prng_v33.o
dataonlyb.o(.text+0x34): In function `MAIN__':
: undefined reference to `f_open'
dataonlyb.o(.text+0x4c): In function `MAIN__':
: undefined reference to `f_open'
dataonlyb.o(.text+0xc1): In function `MAIN__':
: undefined reference to `s_wsfe'
dataonlyb.o(.text+0xdf): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0xfd): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x11b): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x139): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x157): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x172): more undefined references to `do_fio' follow
dataonlyb.o(.text+0x1f1): In function `MAIN__':
: undefined reference to `e_wsfe'
etc.. etc... for the additional two object files I am trying to link with...
I do not have access to the source files for the two linked object files, is there a way to do this using ifort without?
Thanks for your help and time in advance.
ifort -o dataonlyb dataonlyb.o ../gasp_v33b.o ../prng_v33.o
dataonlyb.o(.text+0x34): In function `MAIN__':
: undefined reference to `f_open'
dataonlyb.o(.text+0x4c): In function `MAIN__':
: undefined reference to `f_open'
dataonlyb.o(.text+0xc1): In function `MAIN__':
: undefined reference to `s_wsfe'
dataonlyb.o(.text+0xdf): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0xfd): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x11b): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x139): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x157): In function `MAIN__':
: undefined reference to `do_fio'
dataonlyb.o(.text+0x172): more undefined references to `do_fio' follow
dataonlyb.o(.text+0x1f1): In function `MAIN__':
: undefined reference to `e_wsfe'
etc.. etc... for the additional two object files I am trying to link with...
I do not have access to the source files for the two linked object files, is there a way to do this using ifort without?
Thanks for your help and time in advance.
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Those symbols are from the GNU fortran runtime system. Your code
may build if you force ifort to look through libg2c (the current
location for the GNU fortran I/O stuff). However there may be
some library version problems.
You can try
ifort -o dataonlyb dataonlyb.o ../gasp_v33b.o ../prng_v33.o
/usr/lib/libg2c.so.0
If that library is not found, try "locate libg2c" for alternatives.
For the record, does anyone else know whether there are restrictions
on combining libg2c with the Intel Fortran libraries? I have
not seen problems with a few simple cases, but expect there are
traps here.
may build if you force ifort to look through libg2c (the current
location for the GNU fortran I/O stuff). However there may be
some library version problems.
You can try
ifort -o dataonlyb dataonlyb.o ../gasp_v33b.o ../prng_v33.o
/usr/lib/libg2c.so.0
If that library is not found, try "locate libg2c" for alternatives.
For the record, does anyone else know whether there are restrictions
on combining libg2c with the Intel Fortran libraries? I have
not seen problems with a few simple cases, but expect there are
traps here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We don't claim link compatibility of ifort with code compiled with other Fortran compilers. If you can get the libraries to resolve, maybe it will work, maybe it won't.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page