PETSc on linux86-64

Hello,

I have installed the latest PGI compiler on my Linux AMD 64 workstation and I’m now trying to compile PETSc. I’m getting this silly error during the configuration step:

Executing: pgcc -o conftest -fPIC -g conftest.o -ldl -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -L/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -L/usr/pgi/linux86-64/6.1/lib -Wl,-rpath,/usr/lib64 -L/usr/lib64 -Wl,-rpath,/usr/lib/gcc-lib/x86_64-linux/3.3.5/ -L/usr/lib/gcc-lib/x86_64-linux/3.3.5/ -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -lnspgc -lpgc -ldl -ldl -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -L/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -L/usr/pgi/linux86-64/6.1/lib -Wl,-rpath,/usr/lib64 -Wl,-rpath,/usr/lib64 -L/usr/lib64 -Wl,-rpath,/usr/lib/gcc-lib/x86_64-linux/3.3.5/ -Wl,-rpath,/usr/lib/gcc-lib/x86_64-linux/3.3.5/ -L/usr/lib/gcc-lib/x86_64-linux/3.3.5/ -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -lnspgc -lpgc -Wl,-rpath,/usr/pgi/linux86-64/6.1/libso -Wl,-rpath,/usr/pgi/linux86-64/6.1/lib -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgftnrtl -lm
sh:
Possible ERROR while running linker: /usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to _pgf90_mm_real8_str1c_' /usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to pgf90_mm_real8_str1c_i8
/usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to _pgf90_mm_real8_str1b_i8_' /usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to pgf90_mm_real8_str1b
output: ret = 512
error message = {/usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to _pgf90_mm_real8_str1c_' /usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to pgf90_mm_real8_str1c_i8
/usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to _pgf90_mm_real8_str1b_i8_' /usr/pgi/linux86-64/6.1/libso/libpgf90.so: undefined reference to pgf90_mm_real8_str1b
}


It seems to be unable to use the Fortran libraries from C. Could a kind PGguru tell me what options I should pass? Thank you.

Hi Lionel,

You’re missing the pgf90 runtime library “-lpgf90rtl”.

Note that we’ve added a nice flag called “-pgf90libs” which will add the correct Fortran libraries to your C and C++ links. Use this instead of “-lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl”.

Hope this helps,
Mat

It did, thanks! In case others want to try, I used these options:

./config/configure.py --with-cc=pgcc --with-cxx=pgCC --with-fc=pgf90 --with-blas-lapack-dir=/usr/pgi/linux86-64/6.1/lib/ --with-mpi-dir=/usr/local/lib/mpich-1.2.6/ --LDFLAGS=-pgf90libs

RL