[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #UZA-829935]: Problem Configuring netcdf-fortran-4.4.1



Hello,

The CPPFLAGS and LDFLAGS you specify should be sufficient for the configure 
script to find libnetcdf, but clearly (as you point out), something is going 
on.  In some cases, the message regarding libnetcdf can be misleading; this 
happens when configure can find libnetcdf, but cannot find one of the libraries 
libnetcdf depends on.

In addition to the CPPFLAGS and LDFLAGS statements, add the following before 
you invoke configure:

LIBS="-lnetcdf -lhdf5 -lhdf5_hl"

If this does not work, can you please provide the entire config.log generated 
by configure? This may contain additional information I can use to track this 
down. Thanks!

-Ward

> Hello,
> 
> 
> I am attempting to install netcdf-fortran-4.4.1 on my system and I keep 
> running into an error in the ./configure stage. I am installing in my 
> /usr/local directory and to be safe, I used the following command:
> 
> CPPFLAGS=-I$/usr/local/include LDFLAGS=-L$/usr/local/lib ./configure 
> --prefix=$/usr/local
> 
> 
> I also have already installed netcdf-4.3.2 for C, also in the /usr/local 
> directory and it is working properly. I am using a gfortran compiler and GCC.
> 
> 
> The error is as follows:
> 
> checking size of off_t... configure: error: in 
> `/usr/local/netcdf-fortran-4.4.1':
> configure: error: cannot compute sizeof (off_t)
> 
> 
> Here is the snippet from the config.log file:
> 
> configure:21409: result: 0
> configure:21423: checking size of off_t
> configure:21428: gcc -o conftest -g -O2   conftest.c -lnetcdf  >&5
> configure:21428: $? = 0
> configure:21428: ./conftest
> ./conftest: error while loading shared libraries: libnetcdf.so.7: cannot open 
> shared object file: No such file or directory
> configure:21428: $? = 127
> configure: program exited with status 127
> configure: failed program was:
> | /* confdefs.h */
> | #define PACKAGE_NAME "netCDF-Fortran"
> | #define PACKAGE_TARNAME "netcdf-fortran"
> | #define PACKAGE_VERSION "4.4.1"
> | #define PACKAGE_STRING "netCDF-Fortran 4.4.1"
> | #define PACKAGE_BUGREPORT "address@hidden"
> | #define PACKAGE_URL ""
> | #define PACKAGE "netcdf-fortran"
> | #define VERSION "4.4.1"
> | #define TEMP_LARGE "."
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_TYPES_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_MEMORY_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_INTTYPES_H 1
> | #define HAVE_STDINT_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_DLFCN_H 1
> | #define LT_OBJDIR ".libs/"
> | #define pgiFortran 1
> | #define NF_INT1_T byte
> | #define NF_INT2_T integer*2
> | #define NF_INT1_IS_C_SIGNED_CHAR 1
> | #define NF_INT2_IS_C_SHORT 1
> | #define NF_INT_IS_C_INT 1
> | #define NF_REAL_IS_C_FLOAT 1
> | #define NF_DOUBLEPRECISION_IS_C_DOUBLE 1
> | #define NCBYTE_T byte
> | #define NCSHORT_T integer*2
> | #define HAVE_NETCDF_H 1
> | #define HAVE_NCCREATE 1
> | #define HAVE_OC_OPEN 1
> | #define HAVE_SYS_PARAM_H 1
> | #define HAVE_LOCALE_H 1
> | #define HAVE_STDIO_H 1
> | #define HAVE_STDARG_H 1
> | #define HAVE_ERRNO_H 1
> | #define HAVE_CTYPE_H 1
> | #define HAVE_FCNTL_H 1
> | #define HAVE_MALLOC_H 1
> | #define HAVE_STDLIB_H 1
> | #define HAVE_STRING_H 1
> | #define HAVE_STRINGS_H 1
> | #define HAVE_UNISTD_H 1
> | #define HAVE_SYS_STAT_H 1
> | #define HAVE_GETOPT_H 1
> | #define HAVE_SYS_TIME_H 1
> | #define HAVE_SYS_RESOURCE_H 1
> | #define HAVE_DIRENT_H 1
> | #define STDC_HEADERS 1
> | #define HAVE_SYS_WAIT_H 1
> | #define TIME_WITH_SYS_TIME 1
> | #define HAVE_VPRINTF 1
> | #define HAVE__BOOL 1
> | #define HAVE_STDBOOL_H 1
> | #define HAVE_ALLOCA_H 1
> | #define HAVE_ALLOCA 1
> | #define HAVE_SSIZE_T 1
> | #define HAVE_PTRDIFF_T 1
> | #define SIZEOF_SHORT 0
> | #define SIZEOF_INT 0
> | #define SIZEOF_LONG 0
> | #define SIZEOF_FLOAT 0
> | #define SIZEOF_DOUBLE 0
> | /* end confdefs.h.  */
> | #include <stdio.h>
> | #ifdef HAVE_SYS_TYPES_H
> | # include <sys/types.h>
> | #endif
> | #ifdef HAVE_SYS_STAT_H
> | # include <sys/stat.h>
> | #endif
> | #ifdef STDC_HEADERS
> | # include <stdlib.h>
> | # include <stddef.h>
> | #else
> | # ifdef HAVE_STDLIB_H
> | #  include <stdlib.h>
> | # endif
> | #endif
> | #ifdef HAVE_STRING_H
> | # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
> | #  include <memory.h>
> | # endif
> | # include <string.h>
> | #endif
> | #ifdef HAVE_STRINGS_H
> | # include <strings.h>
> | #endif
> | #ifdef HAVE_INTTYPES_H
> | # include <inttypes.h>
> | #endif
> | #ifdef HAVE_STDINT_H
> | # include <stdint.h>
> | #endif
> | #ifdef HAVE_UNISTD_H
> | # include <unistd.h>
> | #endif
> | static long int longval () { return (long int) (sizeof (off_t)); }
> | static unsigned long int ulongval () { return (long int) (sizeof (off_t)); }
> | #include <stdio.h>
> | #include <stdlib.h>
> | int
> | main ()
> | {
> |
> |   FILE *f = fopen ("conftest.val", "w");
> |   if (! f)
> |     return 1;
> |   if (((long int) (sizeof (off_t))) < 0)
> |     {
> |       long int i = longval ();
> |       if (i != ((long int) (sizeof (off_t))))
> |     return 1;
> |       fprintf (f, "%ld", i);
> |     }
> |   else
> |     {
> |       unsigned long int i = ulongval ();
> |       if (i != ((long int) (sizeof (off_t))))
> |     return 1;
> |       fprintf (f, "%lu", i);
> |     }
> |   /* Do not output a trailing newline, as this causes \r\n confusion
> |      on some platforms.  */
> |   return ferror (f) || fclose (f) != 0;
> |
> |   ;
> |   return 0;
> | }
> configure:21432: error: in `/usr/local/netcdf-fortran-4.4.1':
> configure:21434: error: cannot compute sizeof (off_t)
> See `config.log' for more details
> 
> 
> After a Google search, I find I might be having a linking issue with 
> libnetcdf.so.7. I have tried to symbolically link the library following some 
> of the suggestions I found with my Google search, but have had no further 
> success. Any suggestions you have would be greatly appreciated or if you need 
> any further information, please let me know. Thank you for taking the time to 
> go over my problem.
> 
> 
> --Dan D'Amico
> 
> The Ohio State University
> 
> Department of Geography
> 
> 1036 Derby Hall
> 
> 154 N Oval Mall
> 
> Columbus, OH 43210
> 
> address@hidden
> 
> (O) 614-219-2705
> 
> (C) 216-401-5234
> 
> 

Ticket Details
===================
Ticket ID: UZA-829935
Department: Support netCDF
Priority: Normal
Status: Closed