problem compiling netCDF: --instantiation_dir

Hi,

I am having problems compiling and installing netCDF using pgi version 10.2.

I have been following the build directions in http://www.pgroup.com/resources/netcdf/netcdf360_pgi60.htm
(These directions worked fine for me when previously building netCDF with PGI version 5.2.)

Now when I try to follow them with the version 10.2 compiler, I encounter the following make error (only the last lines of make log):

pgcc 10.2-1 64-bit target on x86-64 Linux -tp nehalem-64
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2010, STMicroelectronics, Inc. All Rights Reserved.
make[4]: Leaving directory /tmp/netcdf3/working/netcdf-4.0.1/ncdump' make[3]: Leaving directory /tmp/netcdf3/working/netcdf-4.0.1/ncdump’
make[2]: Leaving directory /tmp/netcdf3/working/netcdf-4.0.1/ncdump' Making all in nf_test make[2]: Entering directory /tmp/netcdf3/working/netcdf-4.0.1/nf_test’
make[2]: Nothing to be done for all'. make[2]: Leaving directory /tmp/netcdf3/working/netcdf-4.0.1/nf_test’
Making all in cxx
make[2]: Entering directory /tmp/netcdf3/working/netcdf-4.0.1/cxx' source='netcdf.cpp' object='netcdf.lo' libtool=yes \ DEPDIR=.deps depmode=none /bin/sh ../depcomp \ /bin/sh ../libtool --tag=CXX --mode=compile /opt/pgi/linux86-64/10.2/bin/pgCC -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libsrc -DNDEBUG -DpgiFortran -g -c -o netcdf.lo netcdf.cpp libtool: compile: /opt/pgi/linux86-64/10.2/bin/pgCC -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libsrc -DNDEBUG -DpgiFortran -g -c netcdf.cpp -o netcdf.o source='ncvalues.cpp' object='ncvalues.lo' libtool=yes \ DEPDIR=.deps depmode=none /bin/sh ../depcomp \ /bin/sh ../libtool --tag=CXX --mode=compile /opt/pgi/linux86-64/10.2/bin/pgCC -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libsrc -DNDEBUG -DpgiFortran -g -c -o ncvalues.lo ncvalues.cpp libtool: compile: /opt/pgi/linux86-64/10.2/bin/pgCC -DHAVE_CONFIG_H -I. -I.. -I../fortran -I../libsrc -DNDEBUG -DpgiFortran -g -c ncvalues.cpp -o ncvalues.o /bin/sh ../libtool --tag=CXX --mode=link /opt/pgi/linux86-64/10.2/bin/pgCC -g -version-info 4:0:0 -o libnetcdf_c++.la -rpath /tmp/netcdf3/final/lib netcdf.lo ncvalues.lo ../libsrc/libnetcdf.la libtool: link: tpldir=Template.dir libtool: link: rm -rf Template.dir libtool: link: /opt/pgi/linux86-64/10.2/bin/pgCC --prelink_objects --instantiation_dir Template.dir netcdf.o ncvalues.o pgCC-Error-Unknown switch: --instantiation_dir make[2]: *** [libnetcdf_c++.la] Error 1 make[2]: Leaving directory /tmp/netcdf3/working/netcdf-4.0.1/cxx’
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/netcdf3/working/netcdf-4.0.1’
make: *** [all] Error 2

After searching online about “pgCC-Error-Unknown switch: --instantiation_dir”, I see that it may be related to a libtool problem for versions 10.x. I tried applying changes from the two patches to libtool.m4 referenced in the following response to an openmpi question:
http://www.pgroup.com/userforum/viewtopic.php?p=6244&sid=3b40192af234822fa5d23451ea2996b8
(specifically, to add a dot to lower version numbers and adding “pgfortran*”).

However, I STILL get the same make error. What could the problem be???

Thanks.

I solved the netCDF compile problem I needed to patch the configure file as well as the libtool.m4 (again, adding dot for lower versions and adding “pgfortran”). Hope there will not be many more compatibility problems with version 10.x.