[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20040727: linking to gempak libraries question/problem



Mark,

The unresolved references are for your linker when linking fortran executables.
I'm assuming you built the GEMPAK distribution using the portland
pgf77 as well. In that case, your link line looks to be missing
fortan functions typically found in -lU77 or -lM77.

If you did not use the same compiler to build GEMPAK that you are using to
link your program, then that is the problem. If you built GEMPAK
with gcc/g77 then you should use that linker as well.

Also, I have found that the portland compiler does not allow multiple
opens on the same fortan file in the past PG 4.0. It will compile, but give
fortan "open" errors during execution. Perhaps that has been improved in later
PG releases.

Steve Chiswell
Unidata User Support


On Tue, 27 Jul 2004, Mark Conder wrote:

> Hi Mr. Chiswell,
>
> I'm trying to compile a version of mm5togem (have been trying to for a
> while now) and this particular version is giving me a compilation
> error that I think you may be able to interpret readily.
>
> the makefile calls:
>
> LIBS=${GEMLIB}/gemlib.a ${GEMLIB}/appl.a ${GEMLIB}/syslib.a
> (in my case GEMLIB is /usr/gempak5/lib)
>
> I've done a source build of gempak 5.6k on my RH7.3 system. The 5.6k
> installation went smoothly and gave no errors - all the libraries are
> present.
>
> The errors I receive when running 'make' are:
> pgf77 -fast -lg2c -o mm5togem functions.o licalc.o pintp.o
> user_input.o write2gem.o dot2cross.o xyll.o
> mm5togem.o /usr/gempak5/lib/linux/gemlib.a /usr/gempak5/lib/linux/appl.
> a /usr/gempak5/lib/linux/syslib.a
> /usr/gempak5/lib/linux/gemlib.a(flinqr.o): In function `fl_inqr_':
> flinqr.o(.text+0xa5): undefined reference to `s_copy'
> flinqr.o(.text+0xcc): undefined reference to `s_copy'
> flinqr.o(.text+0xf3): undefined reference to `s_copy'
> flinqr.o(.text+0x120): undefined reference to `f_inqu'
> flinqr.o(.text+0x14a): undefined reference to `s_copy'
> flinqr.o(.text+0x1a7): undefined reference to `f_inqu'
> flinqr.o(.text+0x1d1): undefined reference to `s_copy'
> flinqr.o(.text+0x269): undefined reference to `s_copy'
> flinqr.o(.text+0x28c): undefined reference to `f_inqu'
> flinqr.o(.text+0x2b6): undefined reference to `s_copy'
> /usr/gempak5/lib/linux/gemlib.a(ipexit.o): In function `ip_exit_':
> ipexit.o(.text+0x8f): undefined reference to `s_wsfe'
> ipexit.o(.text+0xbd): undefined reference to `do_fio'
> ipexit.o(.text+0xf0): undefined reference to `do_fio'
> ipexit.o(.text+0x105): undefined reference to `e_wsfe'
> /usr/gempak5/lib/linux/gemlib.a(ipinit.o): In function `ip_init_':
> ipinit.o(.text+0x37): undefined reference to `s_copy'
> /usr/gempak5/lib/linux/gemlib.a(ssenvr.o): In function `ss_envr_':
> ssenvr.o(.text+0xc1): undefined reference to `i_indx'
> ssenvr.o(.text+0xdc): undefined reference to `i_indx'
> ssenvr.o(.text+0xf7): undefined reference to `i_indx'
> ssenvr.o(.text+0x12b): undefined reference to `s_copy'
> ssenvr.o(.text+0x154): undefined reference to `s_copy'
> ssenvr.o(.text+0x179): undefined reference to `s_copy'
> ssenvr.o(.text+0x197): undefined reference to `s_copy'
> ssenvr.o(.text+0x1f7): undefined reference to `s_cat'
> ssenvr.o(.text+0x220): undefined reference to `s_copy'
> ssenvr.o(.text+0x239): undefined reference to `s_copy'
> ssenvr.o(.text+0x332): undefined reference to `s_cat'
> ssenvr.o(.text+0x349): undefined reference to `s_copy'
> /usr/gempak5/lib/linux/gemlib.a(ssgsym.o): In function `ss_gsym_':
> ssgsym.o(.text+0xa9): undefined reference to `G77_getenv_0'
> ssgsym.o(.text+0xce): undefined reference to `s_copy'
> ssgsym.o(.text+0xe8): undefined reference to `G77_getenv_0'
> /usr/gempak5/lib/linux/gemlib.a(stlcuc.o): In function `st_lcuc_':
> stlcuc.o(.text+0x77): undefined reference to `s_copy'
> stlcuc.o(.text+0xbd): undefined reference to `s_cmp'
> .......
> /usr/gempak5/lib/linux/gemlib.a(flpath.o): In function `fl_path_':
> flpath.o(.text+0xa5): undefined reference to `s_copy'
> flpath.o(.text+0xb9): undefined reference to `s_copy'
> flpath.o(.text+0x131): undefined reference to `s_cmp'
> flpath.o(.text+0x15a): undefined reference to `s_copy'
> flpath.o(.text+0x17a): undefined reference to `s_copy'
> flpath.o(.text+0x1bb): undefined reference to `s_cmp'
> flpath.o(.text+0x1e1): undefined reference to `s_copy'
> flpath.o(.text+0x21d): undefined reference to `s_copy'
> /usr/gempak5/lib/linux/gemlib.a(stitoc.o): In function `st_itoc_':
> stitoc.o(.text+0x71): undefined reference to `s_wsfi'
> stitoc.o(.text+0xa2): undefined reference to `do_fio'
> stitoc.o(.text+0xb9): undefined reference to `e_wsfi'
> stitoc.o(.text+0xd8): undefined reference to `s_copy'
> make: *** [mm5togem] Error 1
>
> I was hoping you might be able to interpret what the gemlib.a errors
> are.
>
> Sincerely,
> Mark
> ________________________________________
> Mark Conder
> National Weather Service Forecast Office
> Lubbock, TX
>