Error Compiling ESMF with PGI 16.1: Whither libstdz?

All,

I tried to compile both ESMF 5.2.0rp3 and 7.0.0 and both have an error linking with libstdz.a. Looking at ESMF 7.0.0, when it tries to link ESMF_Info:

make[6]: Leaving directory `/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/src/esmf/src/apps/ESMF_Info'
mpifort  -lpthread -Wl,--no-as-needed -L/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/src/esmf/lib/libO/Linux.pgi.64.openmpi.default -L/ford1/share/gmao_S
Iteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -L/opt/pgi/linux86-64/16.1/libso -Wl,-rpath,/ford1/share/gmao_
SIteam/Baselibs/Internal-5_0_0/src/esmf/lib/libO/Linux.pgi.64.openmpi.default -Wl,-rpath,/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linu
x-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -Wl,-rpath,/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.1
0.2/Linux/lib -Wl,-rpath,/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -Wl,-rpath,/ford1/
share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -Wl,-rpath,/ford1/share/gmao_SIteam/Baselibs/Inter
nal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -Wl,-rpath,/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-g
nu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -Wl,-rpath,/opt/pgi/linux86-64/16.1/libso -o /ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/src/esmf/apps/appsO/
Linux.pgi.64.openmpi.default/ESMF_Info /ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/src/esmf/obj/objO/Linux.pgi.64.openmpi.default/src/apps/ESMF_Info/ESM
F_Info.o -lesmf  -lmpi_cxx -pgcpplibs -ldl -L/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/li
b -lnetcdff -lnetcdf -L/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -lnetcdff -lnetcdf -
L/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -L/ford1/share/gmao_SIteam/Baselibs/Intern
al-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -lnetcdf -lhdf5_hl -lhdf5 -ldl -lmfhdf -ldf -lsz -ljpeg -lcurl -lssl -lcrypto -lz -
lrt -lm -L/ford1/share/gmao_SIteam/Baselibs/Internal-5_0_0/x86_64-unknown-linux-gnu/pgfortran_16.1-openmpi_1.10.2/Linux/lib -lcurl -lssl -lcrypto -lssl -lcry
pto -lz -lrt -lm
/usr/bin/ld: cannot find -lstdz

I took a look and, yes, libstdz does seem to not be part of 16.1, as it was in 15.x:

(364) $ find 15.10 -iname '*stdz*'
15.10/lib-small/libstdz.a
15.10/lib/libstdz.a
15.10/lib/libstdz.so
15.10/REDIST/libstdz.so
(365) $ find 16.1 -iname '*stdz*'

So, my question is: should libstdz.a be in my 16.1 install? If so, it’s missing in the install on two different machines here, so perhaps we aren’t installing correctly?

Or, if it is purposefully missing (not needed in 16.1) then who is asking for it? -pgcpplibs? Should ESMF pass in different flags if PGI > 16.1?

Matt

So, my question is: should libstdz.a be in my 16.1 install? If so, it’s missing in the install on two different machines here, so perhaps we aren’t installing correctly?

No. libstdz.a was used with the old PGI pgCC compiler which was deprecated in 15.1 and removed in 16.1. The new PGI pgc++ compiler does not need this library.

Or, if it is purposefully missing (not needed in 16.1) then who is asking for it? -pgcpplibs? Should ESMF pass in different flags if PGI > 16.1?

Yes, you should be using “-pgc++libs” instead.

“-pgcpplibs” was accidently left in 16.1 but will be removed in 16.3.

  • Mat

Mat - We know that -pgcpplibs became available in PGI 8.0. Did -pgc++libs also come in at 8.0? Or some later release? It sounds like we (ESMF) should also be using pgc++ instead of pgCC from 15.1 forwards.

Walter

Hi Walter,

pgcpp, our old C++ compiler, was deprecated in 15.1 and discontinued in 16.1. pgc++, our GNU compatible C++ compiler was first introduced in 12.1.

I would recommend using pgc++ for all PGI builds using 14.1 and later.

  • Mat