static linking does not work for 32 bit?

Hello,

I am trying to build static 32-bit binary with pgfortan and see the following errors:

$ /opt/pgi/linux86/2013/bin/pgf95 -fastsse ax2test.f -Bstatic
/opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function _mp_setaff': setaff.c:(.text+0xcf): undefined reference to numa_available’
/opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function __pgi_nnodes': setaff.c:(.text+0xf4): undefined reference to numa_available’
setaff.c:(.text+0xfd): undefined reference to numa_max_node' /opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function _mp_malloc_local’:
setaff.c:(.text+0x11b): undefined reference to numa_available' setaff.c:(.text+0x133): undefined reference to numa_alloc_local

-fastsse is not a problem here, there are the same errors without it.

I supposed that it requires some threading librray (why?).

If I add -Mconcur flag the compilation completes successfully. In this case it is linked against libnuma.so (checked with -Wl,-t) . But if I specify this librray explicitly the same errors are reported:

$ /opt/pgi/linux86/2013/bin/pgf95 -fastsse test.f -Bstatic -lnuma
/opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function _mp_setaff': setaff.c:(.text+0xcf): undefined reference to numa_available’
/opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function __pgi_nnodes': setaff.c:(.text+0xf4): undefined reference to numa_available’
setaff.c:(.text+0xfd): undefined reference to numa_max_node' /opt/pgi/linux86/13.2/lib/libpgmp.a(setaff.o): In function _mp_malloc_local’:
setaff.c:(.text+0x11b): undefined reference to numa_available' setaff.c:(.text+0x133): undefined reference to numa_alloc_local’

Am I doing something wrong?

Thank you in advance.
Alex

Hi Alex,

Yes, libnuma, which we link in by default in order to support processor binding, doesn’t have a static library available. The work arounds are to either not use libnuma (i,e, add either “-nomp” or “-mp=nonuma” to the link), or only statically link the PGI libraries (i.e. use “-Bstatic_pgi” instead of “-Bstatic”).

Hope this helps,
Mat