The example can not pass the compiling and linking.

OS: Redhat Linux 7.3
PGI version: 5.0
Installing the software package, I can not compile and link the example in the EXAMPLE


[root@localhost matmul]# ./buildf90
matmul_time:
33, Parallel code for non-innermost loop generated; block distribution
34, Loop unrolled 10 times
38, Parallel code for non-innermost loop generated; block distribution
39, Loop unrolled 10 times
58, Parallel code for non-innermost loop generated; block distribution
59, Loop unrolled 10 times
65, Parallel code generated; block distribution
Loop unrolled 10 times
70, Parallel code for non-innermost loop generated; block distribution
71, Loop unrolled 3 times
/usr/pgi/linux86/lib/libpgc.a(init_dummy.o): In function _mp_init2': init_dummy.o(.text+0x10): multiple definition of _mp_init2’
/usr/pgi/linux86/lib/libpgmp.a(init_pthr.o)(.text+0x200): first defined here
/usr/bin/ld: Warning: size of symbol _mp_init2' changed from 149 to 17 in /usr/pgi/linux86/lib/libpgc.a(init_dummy.o) /usr/pgi/linux86/lib/libpgc.a(init_dummy.o)(.data+0x4): multiple definition of _mp_tcpus’
/usr/pgi/linux86/lib/libpgmp.a(init_pthr.o)(.data+0xa8): first defined here
/usr/pgi/linux86/lib/libpgc.a(init_dummy.o): In function _mp_term2': init_dummy.o(.text+0x30): multiple definition of _mp_term2’
/usr/pgi/linux86/lib/libpgmp.a(init_pthr.o)(.text+0x2e0): first defined here
/usr/bin/ld: Warning: size of symbol _mp_term2' changed from 113 to 7 in /usr/pgi/linux86/lib/libpgc.a(init_dummy.o) /usr/pgi/linux86/lib/libpgc.a(init_dummy.o): In function _mp_avlcpus’:
init_dummy.o(.text+0x40): multiple definition of _mp_avlcpus' /usr/pgi/linux86/lib/libpgmp.a(init_pthr.o)(.text+0x360): first defined here /usr/bin/ld: Warning: size of symbol _mp_avlcpus’ changed from 246 to 12 in /usr/pgi/linux86/lib/libpgc.a(init_dummy.o)
/usr/pgi/linux86/lib/libpgf902.a(cnfg.o): In function __hpfio_scratch_name': cnfg.o(.text+0x2a): the use of tempnam’ is dangerous, better use mkstemp' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_msync@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_system@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_pause@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_lseek@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_connect@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_close@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_accept@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_recvmsg@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_sendto@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_tcdrain@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_send@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_write@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __on_exit@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_longjmp@GLIBC_2.1' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_read@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_fsync@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_nanosleep@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_fcntl@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_sendmsg@GLIBC_2.0’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_recvfrom@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_siglongjmp@GLIBC_2.1’
/usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_open@GLIBC_2.0' /usr/pgi/linux86/lib/libpthread.so: undefined reference to __libc_recv@GLIBC_2.0’

Hello,


Did you install the compilers on this system or are you using an installation from a different system? Have you modified your installation?

Notice the directories are “/usr/pgi/linux86/lib/”, they would be “/usr/pgi/linux86/5.0/lib” if you have not modified your installation.

Also notice the undefined reference errors in “/usr/pgi/linux86/lib/libpthread.so”. If you look in “/usr/pgi/linux86/lib” you should see no such file. Rather, on most systems we have the library “libpgthread.so” (note the “g”) which is really a link to your system’s “libpthread.so”. The exception is Red Hat 7.3. On Red Hat 7.3 the system’s thread library has too small of a stack to be usable, so we have included our own thread library. Since the error message has the resolved link, this indicates that the installation your using is not for Red Hat 7.3.

Reinstalling on your Red Hat 7.3 should take care of the problem.

  • Mat