undefined reference in

I am taking a test drive the of the latest release of 7.04 version of pgi C compiler. I ran into a problem
Here is the out put
/opt/pgi/linux86-64/7.0-4/lib/libpgftnrtl.a(async.o): In function asy_wait': async.c:(.text+0x32): undefined reference to aio_suspend’
async.c:(.text+0x64): undefined reference to aio_return' async.c:(.text+0x8d): undefined reference to aio_error’
/opt/pgi/linux86-64/7.0-4/lib/libpgftnrtl.a(async.o): In function Fio_asy_read': async.c:(.text+0x2b0): undefined reference to aio_read’
/opt/pgi/linux86-64/7.0-4/lib/libpgftnrtl.a(async.o): In function Fio_asy_write': async.c:(.text+0x362): undefined reference to aio_write’

I have used these command line swiches:
pgcc -c -I/opt/acml3.6.0/pgi64_mp/include cfft1d_c_example.c -o cfft1d_c_example.o
NOTE: your trial license will expire in 9 days, 1.78 hours.

Linking program cfft1d_c_example.exe:
pgcc -mp cfft1d_c_example.o /opt/acml3.6.0/pgi64_mp/lib/libacml_mp.a -lpgftnrtl -lm -o cfft1d_c_example.exe

I also try to compile the examples under the latest ACML 3.6.0 generated with PGI Fortrtan compiler. Same thing happened.

Anybody knows how to fix this?


Hi Shuo,

The asynchronous IO symbols are found in /usr/lib/librt.a. You can add “-lrt” you you link line, but a better solution is to use the flag “-pgf77libs”. “-pgf77lib” will automatically add all need F77 runtime libraries to you link line, including “-lrt”. For F90, instead use “-pgf90libs”.

Hope this helps,