NETCDF 3.6.2 compile problem on Darwin 10.7 with PGI 10.3

Hi,

I’d like to compile NETCDF 3.6.2 on a Darwin 10.7 box with PGI 10.3. It always complained following error messages

source=‘ncx.c’ object=‘ncx.lo’ libtool=yes
DEPDIR=.deps depmode=none /bin/sh …/depcomp
/bin/sh …/libtool --tag=CC --mode=compile pgcc -DHAVE_CONFIG_H -I. -I. -I… -I…/fortran -DNDEBUG -DpgiFortran -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc -c -o ncx.lo ncx.c
libtool: compile: pgcc -DHAVE_CONFIG_H -I. -I. -I… -I…/fortran -DNDEBUG -DpgiFortran -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc -c ncx.c -o ncx.o
PGC-F-0249-#error – This file is only for Metrowerks compatibilty. (/usr/include/float.h: 278)
PGC/x86-64 OSX 10.3-0: compilation aborted
make[2]: *** [ncx.lo] Error 1

Here are my configuration

./configure CPP=“pgcc -E” CC=pgcc CXXCPP=“pgcpp -E” CXX=pgcpp FC=pgf90 F77=pgf90 CPPFLAGS=“-DNDEBUG -DpgiFortran” LDFLAGS=“-L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64” CFLAGS=“-L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc” FFLAGS=“-L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64”

How could I fix this problem?

Thanks

Jerry

Hi Jerry,

The problem is that the system “float.h” file shouldn’t be used. We ship our own version, but I’m not sure why you’re not picking it up.

I was able to successfully build the latest version of NetCDF 4.1.1 on a Darwin 10.6 system. Can you try the latest NetCDF to see if it fixes your issue?

  • Mat

Hi Mat,

I tried the latest version of NetCDF 4.1.1 and got the same problem.

And I also tried to specify CPPFLAGS and CFLAGS with “-I/usr/local/pgi_10.3/osx86-64/10.3/include”, but it sill didn’t work.

My box is upgraded from 32-bit OS/X. After upgrading, mass things were upset. I don’t have privilege, I can’t update localrc file.

the old localrc file

set GCCVERSION=40001;
set GCCDIR=/usr/lib/gcc/i686-apple-darwin9/4.0.1;
set GCCINC=/usr/lib/gcc/i686-apple-darwin9/4.0.1/include;
set OEM_INFO=64-bit target on Apple OS/X ;
set LOCALRC=YES;
set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc) -lSystem;
export PGI="/usr/local/pgi";



information in the config.log 

 432 configure:8553: pgcc -c -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc  -I/usr/local/pgi_10.3/osx86-64/10.3/include -DNDEBUG -DpgiFortran conftest.c >&5
 433 PGC-F-0249-#error --  This file is only for Metrowerks compatibilty. (/usr/include/float.h: 278)
 434 PGC/x86-64 OSX 10.3-0: compilation aborted
 435 configure:8559: $? = 2
 436 configure: failed program was:
 437 | /* confdefs.h.  */
 438 | #define PACKAGE_NAME "netCDF"
 439 | #define PACKAGE_TARNAME "netcdf"
 440 | #define PACKAGE_VERSION "3.6.2"
 441 | #define PACKAGE_STRING "netCDF 3.6.2"
 442 | #define PACKAGE_BUGREPORT "support@unidata.ucar.edu"
 443 | #define PACKAGE "netcdf"
 444 | #define VERSION "3.6.2"
 445 | #define USE_EXTREME_NUMBERS 1
 446 | #define TEMP_LARGE $TEMP_LARGE
 447 | /* end confdefs.h.  */
 448 | #include <stdlib.h>
 449 | #include <stdarg.h>
 450 | #include <string.h>
 451 | #include <float.h>
 452 |
 453 | int
 454 | main ()
 455 | {
 456 |
 457 |   ;
 458 |   return 0;
 459 | } 


 922 configure:24525: checking for struct stat.st_blksize
 923 configure:24553: pgcc -c -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc -DNDEBUG -DpgiFortran conftest.c >&5
 924 configure:24559: $? = 0
 925 configure:24616: result: yes
 926 configure:24633: checking for IEEE floating point format
 927 configure:24681: pgcc -o conftest -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 -lpgc  -I/usr/local/pgi_10.3/osx86-64/10.3/include -DNDEBUG -DpgiFortran -L/usr/lib/gcc/i686-apple-darwin10/4.0.1/X86_64 conftest.c  >&5
 928 PGC-F-0249-#error --  This file is only for Metrowerks compatibilty. (/usr/include/float.h: 278)
 929 PGC/x86-64 OSX 10.3-0: compilation aborted
 930 configure:24684: $? = 2
 931 configure: program exited with status 2
 932 configure: failed program was:
 933 | /* confdefs.h.  */
 934 | #define PACKAGE_NAME "netCDF"
 935 | #define PACKAGE_TARNAME "netcdf"
 936 | #define PACKAGE_VERSION "3.6.2"
 937 | #define PACKAGE_STRING "netCDF 3.6.2"
 938 | #define PACKAGE_BUGREPORT "support@unidata.ucar.edu"
 939 | #define PACKAGE "netcdf"
 940 | #define VERSION "3.6.2"
 941 | #define USE_EXTREME_NUMBERS 1
 942 | #define TEMP_LARGE $TEMP_LARGE
 943 | #define HAVE_SYS_TYPES_H 1
 944 | #define HAVE_SYS_STAT_H 1
 945 | #define HAVE_STDLIB_H 1
 946 | #define HAVE_STRING_H 1
 947 | #define HAVE_MEMORY_H 1
 948 | #define HAVE_STRINGS_H 1
 949 | #define HAVE_INTTYPES_H 1
 950 | #define HAVE_STDINT_H 1
 951 | #define HAVE_UNISTD_H 1
 952 | #define HAVE_DLFCN_H 1
 953 | #define LT_OBJDIR ".libs/"
 954 | #define NF_INT1_T byte
 955 | #define NF_INT2_T integer*2
 956 | #define NF_INT1_IS_C_SIGNED_CHAR 1
 957 | #define NF_INT2_IS_C_SHORT 1
 958 | #define NF_INT_IS_C_INT 1
 959 | #define NF_REAL_IS_C_FLOAT 1
 960 | #define NF_DOUBLEPRECISION_IS_C_DOUBLE 1
 961 | #define NCBYTE_T byte
 963 | #define HAVE_STRLCAT 1
 964 | #define HAVE_STRERROR 1
 965 | #define HAVE_ALLOCA_H 1
 966 | #define HAVE_ALLOCA 1
 967 | #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
 968 | #define HAVE_ST_BLKSIZE 1
 969 | /* end confdefs.h.  */
 970 | #ifndef NO_FLOAT_H
 971 | #include <float.h>
 972 | #endif
 973 |
 974 | #define EXIT_NOTIEEE  1
 975 | #define EXIT_MAYBEIEEE        0
 976 |
 977 | int
 978 | main()
 979 | {
 980 | #if   defined(FLT_RADIX)      && FLT_RADIX != 2
 981 |               return EXIT_NOTIEEE;
 982 | #elif defined(DBL_MAX_EXP)    && DBL_MAX_EXP != 1024
 983 |               return EXIT_NOTIEEE;
 984 | #elif defined(DBL_MANT_DIG)   && DBL_MANT_DIG != 53
 985 |               return EXIT_NOTIEEE;
 986 | #elif         defined(FLT_MAX_EXP)    && !(FLT_MAX_EXP == 1024 || FLT_MAX_EXP == 128)
 987 |               return EXIT_NOTIEEE;
 988 | #elif defined(FLT_MANT_DIG)   && !(FLT_MANT_DIG == 53 || FLT_MANT_DIG == 24)
 989 |               return EXIT_NOTIEEE;
 990 | #else
 991 |       /* (assuming eight bit char) */
 992 |       if(sizeof(double) != 8)
 993 |               return EXIT_NOTIEEE;
 994 |       if(!(sizeof(float) == 4 || sizeof(float) == 8))
 995 |               return EXIT_NOTIEEE;
 996 |
 997 |       return EXIT_MAYBEIEEE;
 998 | #endif
 999 | }

Can I use a users’s localrc replace the default PGI localrc file to check whether if help?

Or can I modify the configure script or some source codes to fix this problem?


Thanks

Jerry

Hi Jerry,

Since you updated your OS without updating the localrc, this would explain the error you’re see. The localrc file most likely points to a GCC version that doesn’t exist on your system. The 'float.h" in “/usr/include” is just a placeholder with the one in the GCC include directory being the one that needs to be used. However, since the path to the GCC include directory is wrong, the “/usr/include” version is being used instead and causes the error.

You can try making the necessary edits in a local copy of “~/.mypgccrc” file but the correct solution would be to update the localrc file or re-install the compilers. Note that since OSX 10.7 has not been released it is not yet supported by PGI. It’s not that the compilers wont work, we just have not tested on this new OS.

  • Mat