Error compiling libpciaccess 0.13.4 with PGI 15.10

Hello,

I am getting the following error message when trying to compile libpciaccess 0.13.4 with PGI 15.10:

Making all in scanpci
make[2]: Entering directory `/scratch/ajstewart/libpciaccess-0.13.4/scanpci'
  CC       scanpci.o
  CCLD     scanpci
../src/.libs/libpciaccess.so: undefined reference to `inw'
../src/.libs/libpciaccess.so: undefined reference to `outw'
../src/.libs/libpciaccess.so: undefined reference to `inb'
../src/.libs/libpciaccess.so: undefined reference to `outb'
../src/.libs/libpciaccess.so: undefined reference to `inl'
../src/.libs/libpciaccess.so: undefined reference to `outl'
make[2]: *** [scanpci] Error 2
make[2]: Leaving directory `/scratch/ajstewart/libpciaccess-0.13.4/scanpci'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/scratch/ajstewart/libpciaccess-0.13.4'
make: *** [all] Error 2

So far I have had no trouble installing libpciaccess with GCC or Intel compilers. I submitted a bug report with libpciaccess but they believe the problem is that PGI is not compatible with my system headers. We are running CentOS 6. Any idea how I can get libpciaccess to compile with PGI?

Adam

We have recreated this and have logged it as TPR 22355.

Thanks for the report.

dave

Dave,

Thanks! Let me know if you develop any patches for this so that I may apply them locally.

Adam

Adam,

Engineering has asked which gcc version and Linux version you are using.

dave

Dave,

Sorry, didn’t notice your reply until now. I went in and changed my email preferences to email me when a response has been added, so it won’t happen again.

$ gcc --version
gcc (GCC) 5.3.0

$ uname -a
Linux blogin4 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Let me know if there is anything else you need from me. I have confirmed that this bug is still present in the latest PGI 16.3-0 compilers.

Adam

Adam,

We are still waiting for some EDG updates to support gcc 5.2, and supporting 5.3 is even more work.

The quickest solution is to move to a linux version with a gcc version before 5.0, and you should
have less problems.

Or you can wait, or just use gcc to build the library. If it is all C then
linking with PGI programs is no problem from gcc objects.


dave

Dave,

I just tried again with PGI 16.5-0 and GCC 4.4.7 but I’m still seeing the same problem. I am using libtool, m4, and libsigsegv that I build by hand with the same compilers. Could there be a problem with one of those installations? I just checked and none of them are missing symbols. It’s just libpciaccess.so:

$ ldd -r libpciaccess.so
	linux-vdso.so.1 =>  (0x00007ffc121fd000)
	libc.so.6 => /lib64/libc.so.6 (0x00002b46bea31000)
	libpgmp.so => /blues/gpfs/home/software/spack-0.9.1/opt/spack/linux-centos6-x86_64/gcc-4.4.7/pgi-16.5-pa5hji6khmosol3h7u65zhw6cy2dnekn/linux86-64/16.5/lib/libpgmp.so (0x00002b46bedc5000)
	libnuma.so.1 => /usr/lib64/libnuma.so.1 (0x00002b46bf045000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b46bf251000)
	libpgc.so => /blues/gpfs/home/software/spack-0.9.1/opt/spack/linux-centos6-x86_64/gcc-4.4.7/pgi-16.5-pa5hji6khmosol3h7u65zhw6cy2dnekn/linux86-64/16.5/lib/libpgc.so (0x00002b46bf46e000)
	libm.so.6 => /lib64/libm.so.6 (0x00002b46bf6f6000)
	/lib64/ld-linux-x86-64.so.2 (0x00002b46be5ec000)
undefined symbol: inw	 (./libpciaccess.so)
undefined symbol: outw	(./libpciaccess.so)
undefined symbol: inb	 (./libpciaccess.so)
undefined symbol: outb	(./libpciaccess.so)
undefined symbol: inl	 (./libpciaccess.so)
undefined symbol: outl	(./libpciaccess.so)

Any idea where those symbols are supposed to be coming from?

Adam

Dave,

Are there any updates on the progress of fixing this bug?

Adam

I have requested an update on the status of bug 22355.

dave

It is a header file issue. Workaround is to add

-D__GNUC__=3

to your compile line.

dave

Thanks Dave, that does indeed get me past the problem I originally reported. Unfortunately, it also uncovers a new problem.

pgcc-Error-Unknown switch: -fno-strict-aliasing

It looks like libpciaccess’s configure script is incorrectly detecting the PGI compilers as GCC. This obviously isn’t PGI’s fault, so I think it’s safe to close this issue. I’ll work with the libpciaccess developers to solve this latest bug.

Thanks for all of your help!

Adam

Actually, looking at the configure script, it looks like it checks whether or not GNUC has been defined. If so, it detects it as GCC and uses GCC compiler flags. I think the fix you gave me actually causes this new problem.

Any updates on this bug? I tried again with the PGI 16.10 compilers but the result is the same.

I messed up on this problem. Someone reported
-D__GNUC__=3 would fix things, and I believed it and reported it and closed
the problem. When I went to verify (which I will do in the future every time),
it fixed nothing. Problem is still open.

dave