multiple definitions in -lpghpf and -lpgf90

Hello,
I’m getting multiple definition errors, with different sizes for symbols, in many functions in the pghpf and pgf90 libraries when trying to compile and link F90 and HPF code. This happens both when using version 5.1 on an opteron system, and also when using an old version 3.1 on a p4 system. Do you have any suggestions?
Thanks.
The error messages are a follows:

_make -f Makefile.multivariate.hpf
pghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -o HMAX.multivariate lkh_multivariate.o read_multivariate.o legaus.o gammln.o ddaskr.o daux.o dlinpk.o dbanpre.o num_call.o -L/home/hazelton/Bhat_panther -lBhat_hpf -lpghpf -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl
Timing stats:
Total time 0 millisecs
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(error.o)(.text+0x0): In function __hpfio_errinit': error.c: multiple definition of __hpfio_errinit’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(error.o)(.text+0x0):error.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(error.o)(.text+0xa0): In function __hpfio_error': error.c: multiple definition of __hpfio_error’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(error.o)(.text+0xa0):error.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(error.o)(.text+0x2bf): In function __hpfio_eoferr': error.c: multiple definition of __hpfio_eoferr’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(error.o)(.text+0x2bf):error.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(error.o)(.text+0x3e6): In function __hpfio_eorerr': error.c: multiple definition of __hpfio_eorerr’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(error.o)(.text+0x3e6):error.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(fmtwrite.o)(.text+0x6f2): In function __f90io_fmt_write': fmtwrite.c: multiple definition of __f90io_fmt_write’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(fmtwrite.o)(.text+0x7f8):fmtwrite.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x0): In function __hpf_ptr_aligned': allo.c: multiple definition of __hpf_ptr_aligned’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x0):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x4a): In function __hpf_ptr_offset': allo.c: multiple definition of __hpf_ptr_offset’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x4a):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x13a): In function __hpf_alloc': allo.c: multiple definition of __hpf_alloc’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x13a):allo.c: first defined here
/usr/bin/ld: Warning: size of symbol __hpf_alloc' changed from 438 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 534 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o) /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x350): In function __hpf_allocated’:
allo.c: multiple definition of __hpf_allocated' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x2f0):allo.c: first defined here /usr/bin/ld: Warning: size of symbol __hpf_allocated’ changed from 55 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 106 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x3ba): In function ftn_allocated': allo.c: multiple definition of ftn_allocated’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x327):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x419): In function ftn_allocate': allo.c: multiple definition of ftn_allocate’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x386):allo.c: first defined here
/usr/bin/ld: Warning: size of symbol ftn_allocate' changed from 81 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 64 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o) /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x459): In function ftn_alloc’:
allo.c: multiple definition of ftn_alloc' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x3d7):allo.c: first defined here /usr/bin/ld: Warning: size of symbol ftn_alloc’ changed from 77 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 60 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x4f1): In function __hpf_allocate': allo.c: multiple definition of __hpf_allocate’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x4a2):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x519): In function __hpf_local_allocate': allo.c: multiple definition of __hpf_local_allocate’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x4ca):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x541): In function __hpf_dealloc': allo.c: multiple definition of __hpf_dealloc’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x4f2):allo.c: first defined here
/usr/bin/ld: Warning: size of symbol __hpf_dealloc' changed from 193 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 266 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o) /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x64b): In function ftn_deallocate’:
allo.c: multiple definition of ftn_deallocate' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x5b3):allo.c: first defined here /usr/bin/ld: Warning: size of symbol ftn_deallocate’ changed from 35 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 19 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x65e): In function ftn_dealloc': allo.c: multiple definition of ftn_dealloc’
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x5d6):allo.c: first defined here
/usr/bin/ld: Warning: size of symbol ftn_dealloc' changed from 35 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o) to 19 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o) /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x6a9): In function __hpf_deallocate’:
allo.c: multiple definition of __hpf_deallocate' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x651):allo.c: first defined here /usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x6c1): In function __hpf_local_deallocate’:
allo.c: multiple definition of __hpf_local_deallocate' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x669):allo.c: first defined here /usr/pgi/linux86-64/5.1/lib/libpgf90.a(entry.o)(.text+0x0): In function __hpf_entry_init’:
entry.c: multiple definition of __hpf_entry_init' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(entry.o)(.text+0x0):entry.c: first defined here /usr/pgi/linux86-64/5.1/lib/libpgf90.a(entry.o)(.text+0x282): In function __hpf_traceback’:
entry.c: multiple definition of __hpf_traceback' /usr/pgi/linux86-64/5.1/lib/libpghpf.a(entry.o)(.text+0x282):entry.c: first defined here /usr/bin/ld: Warning: size of symbol __hpf_traceback’ changed from 368 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(entry.o) to 369 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(entry.o)
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(entry.o)(.text+0x406): In function __hpf_tracecall': entry.c: multiple definition of __hpf_tracecall’



/usr/pgi/linux86-64/5.1/lib/libpghpf.a(rdst.o)(.text+0x2dc8):rdst.c: first defined here
/usr/bin/ld: Warning: size of symbol `_hpf_copy_out’ changed from 888 in /usr/pgi/linux86-64/5.1/lib/libpghpf.a(rdst.o) to 445 in /usr/pgi/linux86-64/5.1/lib/libpgf90.a(rdst.o)
make: *** [HMAX.multivariate] Error 2

Hi Bill h,

The pgf90 and pghpf runtime libraries have some of the same object names and are typically not used together. To fix, remove all the PGI libraries from your link line since pghpf will add the appropriate libraries. The exception to this would be if your compiling with pgf90 but linking with pghpf. In this case, remove “-lpghpf” from the link line or insert it after “-lpgf90”.

  • Mat

Hi Mat,
I’m trying to compile part with pghpf and part with pgf90, then link with pghpf. I tried to do what you suggested, using a Makefile as follows:
COMP=pghpf
COMP90=pgf90
FFLAGS= -O -g -Minform=warn -Minfo=all -Mextend -Mr8
FOPTIONS=-L/home/hazelton/Bhat_panther -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lBhat_hpf -lpghpf

all: HMAX.multivariate

HMAX.multivariate: lkh_multivariate.o read_multivariate.o legaus.o gammln.o ddaskr.o daux.o dlinpk.o dbanpre.o num_call.o
$(COMP) $(FFLAGS) -o HMAX.multivariate lkh_multivariate.o read_multivariate.o legaus.o gammln.o ddaskr.o daux.o dlinpk.o dbanpre.o num_call.o $(FOPTIONS)

lkh_multivariate.o: lkh_multivariate.hpf model.multivariate
$(COMP) $(FFLAGS) -c lkh_multivariate.hpf

read_multivariate.o: read_multivariate.hpf
$(COMP) $(FOPTIONS) $(FFLAGS) -c read_multivariate.hpf

num_call.o: num_call.f90
$(COMP90) $(FFLAGS) -c num_call.f90

ddaskr.o: ddaskr.f90
$(COMP90) $(FFLAGS) -c ddaskr.f90

daux.o: daux.f90
$(COMP90) $(FFLAGS) -c daux.f90

dlinpk.o: dlinpk.f90
$(COMP90) $(FFLAGS) -c dlinpk.f90

dbanpre.o: dbanpre.f90
$(COMP90) $(FFLAGS) -c dbanpre.f90


legaus.o: legaus.hpf
$(COMP) $(FFLAGS) -Mextend -c legaus.hpf

gammln.o: gammln.hpf
$(COMP) $(FFLAGS) -Mextend -c gammln.hpf

The hpf compilation goes ok, but the f90 part doesn’t compile.
See below:

hazelton@panther:~/Data/Prostate/HPF> make -f Makefile.multivariateHP.hpf
pghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -c lkh_multivariate.hpf
158, Independent loop parallelized
Invariant assignments hoisted out of loop
175, Invariant assignments hoisted out of loop
191, Invariant assignments hoisted out of loop
201, Invariant assignments hoisted out of loop
212, sum reduction inlined
220, Independent loop parallelized
244, Invariant assignments hoisted out of loop
246, Invariant assignments hoisted out of loop
272, Invariant assignments hoisted out of loop
284, sum reduction inlined
287, sum reduction inlined
313, Invariant assignments hoisted out of loop
327, sum reduction inlined
0 inform, 5 warnings, 0 severes, 0 fatal for func
Timing stats:
init 50 millisecs 75%
parser 16 millisecs 24%
Total time 66 millisecs
Timing stats:
expand 16 millisecs 6%
optimize 51 millisecs 20%
schedule 183 millisecs 73%
Total time 250 millisecs
pghpf -L/home/hazelton/Bhat_panther -lBhat_hpf -lpghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -c read_multivariate.hpf
Timing stats:
Total time 0 millisecs
Timing stats:
schedule 33 millisecs 100%
Total time 33 millisecs
pghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -Mextend -c legaus.hpf
Timing stats:
Total time 0 millisecs
Timing stats:
schedule 16 millisecs 100%
Total time 16 millisecs
pghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -Mextend -c gammln.hpf
Timing stats:
Total time 0 millisecs
Timing stats:
Total time 0 millisecs
make: *** No rule to make target num_call.o', needed by HMAX.multivariate’. Stop.
hazelton@panther:~/Data/Prostate/HPF>

Looks like a problem with make not finding a rule for target ‘num_call.o’. Is this rule defined in your makefile?

  • Mat

Hi Mat,
Sorry to keep bothering you. I fixed the problem with not finding a rule for target ‘num_call.o’, but am back to the origonal problem. I put -lpgf90 and associated libraries first, and eliminated the reference to -lpghpf in the Makefile.

hazelton@panther:~/Data/Prostate/HPF> make -f Makefile.multivariate.hpf
pghpf -O -g -Minform=warn -Minfo=all -Mextend -Mr8 -o HMAX.multivariate lkh_multivariate.o read_multivariate.o legaus.o gammln.o ddaskr.o daux.o dlinpk.o numcall.o dbanpre.o -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -L/home/hazelton/Bhat_panther -lBhat_hpf
Timing stats:
Total time 0 millisecs
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x0): In function __hpf_ptr_aligned': allo.c: multiple definition of __hpf_ptr_aligned’
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x0):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x4a): In function __hpf_ptr_offset': allo.c: multiple definition of __hpf_ptr_offset’
/usr/pgi/linux86-64/5.1/lib/libpgf90.a(allo.o)(.text+0x4a):allo.c: first defined here
/usr/pgi/linux86-64/5.1/lib/libpghpf.a(allo.o)(.text+0x13a): In function __hpf_alloc': allo.c: multiple definition of __hpf_alloc’

Hi Mat,
I was able to solve my problem by compiling the F90 pieces using the HPF compiler with the -Mf90 flag and the hpf pieces without this flag, eliminating the need to use both the -lpghpf and -lpgf90 libraries together.
Thanks for your help.
Bill

Hi Bill,

I’m glad you we’re able to compile your F90 code using “pghpf -Mf90”. I have not been able to recreate the problem internally using the 6.0 compilers, so there is a good possibility that is has been solved since the 5.1 release which you are using. Still, I have asked our compiler team to take a look.

Thanks,
Mat