[netcdf-porting] Fwd: NetCDF fails some tests, undefined symbols _nf_*

NOTE: The netcdf-porting mailing list is no longer active. The list archives are made available for historical reasons.

Hi, I've been trying for a few days now to build Netcdf on Mac OS X Lion,
with the GNU 4.6

I noticed Cheung had the same issue on Jul 2, but there were no responses.
http://www.unidata.ucar.edu/mailing_lists/archives/netcdf-porting/2011/msg00008.html

The build goes fine, it's the tests that fail.

Here's a sample of the error:

===================
All 11 tests passed
===================
Making check in nf_test
make  nf_test tst_f77_v2         ftest tst_f90
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o test_get.o test_get.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o test_put.o test_put.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o nf_error.o nf_error.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o nf_test.o nf_test.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o test_read.o test_read.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o test_write.o test_write.F
/Users/matt/software/gcc46/usr/local/bin/gfortran -DHAVE_CONFIG_H -I. -I..
-I../fortran  -I../include -I../oc  -O2 -DgFortran -m64 -I../fortran
-I../include -
I../oc  -I../f90 -O2 -w -Wall -m64 -c -o util.o util.F
depbase=`echo fortlib.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
        /Users/matt/software/gcc46/usr/local/bin/gcc -DHAVE_CONFIG_H -I.
-I.. -I../fortran  -I../include -I../oc  -O2 -DgFortran -m64  -O2 -m64
-I/usr/local/i
nclude -DCURL_NO_OLDIES -MT fortlib.o -MD -MP -MF $depbase.Tpo -c -o
fortlib.o fortlib.c &&\
        mv -f $depbase.Tpo $depbase.Po
/bin/sh ../libtool --tag=F77   --mode=link
/Users/matt/software/gcc46/usr/local/bin/gfortran -I../fortran -I../include
-I../oc  -I../f90 -O2 -w -Wall -m64  -L
/opt/local/lib -o nf_test test_get.o test_put.o nf_error.o nf_test.o
test_read.o test_write.o util.o fortlib.o ../fortran/libnetcdff.la  -lm -lz
-lcurl -lcurl
libtool: link: /Users/matt/software/gcc46/usr/local/bin/gfortran
-I../fortran -I../include -I../oc -I../f90 -O2 -w -Wall -m64 -o
.libs/nf_test test_get.o test
_put.o nf_error.o nf_test.o test_read.o test_write.o util.o fortlib.o
 -L/opt/local/lib ../fortran/.libs/libnetcdff.dylib
/Users/matt/software/netcdf/netcdf-4
.1.3/liblib/.libs/libnetcdf.dylib -lm /opt/local/lib/libcurl.dylib
/opt/local/lib/libidn.dylib /opt/local/lib/libintl.dylib -lc
/opt/local/lib/libiconv.dylib
-lssl -lcrypto -lz
Undefined symbols for architecture x86_64:
  "_nf_get_var1_int1_", referenced from:
      _test_nf_get_var1_int1_ in test_get.o
      _check_vars_int1_ in test_put.o
     (maybe you meant: _test_nf_get_var1_int1_)
  "_nf_get_var1_int2_", referenced from:
      _test_nf_get_var1_int2_ in test_get.o
      _check_vars_int2_ in test_put.o
     (maybe you meant: _test_nf_get_var1_int2_)
  "_nf_get_var_int1_", referenced from:
      _test_nf_get_var_int1_ in test_get.o
     (maybe you meant: _test_nf_get_var_int1_)
  "_nf_get_var_int2_", referenced from:
      _test_nf_get_var_int2_ in test_get.o
     (maybe you meant: _test_nf_get_var_int2_)

Can I continue despite this failed test?  How can I get this test to pass.

My environment and config is:

#
# Fortran
FC="$GNU_BIN_PATH/gfortran"
FFLAGS="-O2 -w -Wall -m64"
FCLAGS=$FFLAGS
F90="${FC}"
F77=${FC}
FLIBS=""
F90LIBS=""

#
# C
CC="$GNU_BIN_PATH/gcc"
CXX="$GNU_BIN_PATH/g++"

CFLAGS="-O2 -m64 -I/usr/local/include"
CPPFLAGS="-O2 -DgFortran -m64"
CXXFLAGS="-O2 -DgFortran -m64"

# Libs
LDFLAGS="-L/opt/local/lib"
LIBS="-lcurl"

# Without the CURL_NO_OLDIES, I get an error about illegal
# character in curlsomething.c:29.  This is documented on the wiki.
# For some reason, the macro isn't defined or something, I don't
# know..
export CFLAGS="${CFLAGS} -DCURL_NO_OLDIES"

# Took this from sec 3.2 of the INSTALL guide,
export NF_INT_IS_C_INT=1

./configure --prefix=/usr/local/netcdf_gnu --disable-netcdf-4

Having the lib path or include path in the *FLAGS made no difference.  (at
that point I was stabbing in the dark.)

Has anyone encountered this problem, or have advice to resolve it or move
on?  Thank you.
  • 2011 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-porting archives: