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

[netCDF #EFH-651694]: netcdf-4.1.1 shared library error


This seems to be a problem with the configure script trying to determine how to 
shared libraries using your Fortran compiler, which is a fairly old "f77":

  /usr/bin/f77 is GNU Fortran (GCC) 3.4.6 20060404 (Red Hat 3.4.6-4)

The config.log file shows that it gets it right the first time it is tested:

  configure:18066: checking whether the f77 linker (/usr/bin/ld -m elf_x86_64) 
supports shared libraries
  configure:19031: result: yes
  configure:19168: checking dynamic linker characteristics
  configure:19543: f77 -o conftest -g -O2  -Wl,-rpath -Wl,/foo conftest.f  >&5

but later it looks like the needed "-Wl," to do shared libraries is deleted:

  configure:21737: checking dynamic linker characteristics
  configure:22112: f77 -o conftest   -rpath /foo  conftest.f  >&5
  f77: /foo: No such file or directory
  f77: unrecognized option `-rpath'

I'm not sure why configure doesn't just cache the answer it got from the first
test and use that, rather than recomputing it and getting it wrong the second

The error is the same one that occurs when you run "make check":

  libtool: link: f77 -shared  .libs/fort-attio.o .libs/fort-control.o 
.libs/fort-dim.o .libs/fort-genatt.o .libs/fort-geninq.o .libs/fort-genvar.o 
.libs/fort-lib.o .libs/fort-misc.o .libs/fort-v2compat.o .libs/fort-vario.o 
.libs/fort-var1io.o .libs/fort-varaio.o .libs/fort-varmio.o .libs/fort-varsio.o 
   -rpath /home/pd605077/rpmbuild/BUILD/netcdf-4.1.1/libsrc/.libs -rpath 
/usr/lib64 -L/lib ../libsrc/.libs/libnetcdf.so 
-L/usr/lib/gcc/x86_64-redhat-linux/3.4.6/../../.. -L/lib/../lib64 
-L/usr/lib/../lib64 -lfrtbegin -lg2c -lm -lc -lgcc_s    -soname libnetcdff.so.4 
-o .libs/libnetcdff.so.4.0.0
  f77: libnetcdff.so.4: No such file or directory
  f77: unrecognized option `-rpath'
  f77: unrecognized option `-rpath'
  f77: unrecognized option `-soname'

I suspect this link command would work OK if it used "-Wl,-rpath" instead of "  
and similarly for the absolute directory paths following each -rpath, e.g.
"-Wl,/usr/lib64" instead of just "/usr/lib64".

I've checked compiling 4.1.1 with --enable-shared and FC=gfortran on a Linux 
and it works fine.  The Fortran library gets installed as a separate shared 
library and 
programs can link against it.

Because we don't have the 2006 vintage f77 compiler you are using or convenient 
access to 
the Bluegen-L platform for testing, I suggest you work around this problem by 

  - installing an up-to-date Fortran compiler that can still compile Fortran-77 
    such as gfortran or g95

  - trying to build with a LDFLAGS environment variable set vefore invoking 
    which might be something like:

      LDFLAGS='-Wl,-rpath -Wl,/usr/lib64'

  - debugging the configure script to make it provide the needed "-Wl," prefix 
to link
    commands such as -rpath.

The last alternative may be impractical or too difficult to attempt, and the 
suggestions seems like the easiest to me.


Russ Rew                                         UCAR Unidata Program
address@hidden                      http://www.unidata.ucar.edu

Ticket Details
Ticket ID: EFH-651694
Department: Support netCDF
Priority: Normal
Status: Closed