netCDF Configure Make Installation Undefined Reference Linking Error and Solution

How To Resolve undefined Reference Linking Error

1)undefined reference to `H5Fflush'
configure:4825: gcc -o conftest -L/app/intel/tbb/lib/intel64/ -ltbbmalloc   conftest.c  >&5
/tmp/ccPiom2h.o: In function `main':
conftest.c:(.text+0xa): undefined reference to `curl_easy_setopt'
collect2: ld returned 1 exit status
SOLUTION : This problem is resolved by add the following option "--disable-dap"
The above netcdf undefined reference symbol getting while compile netcdf with dap support(curl is library that used to access the network resources.) So disable dap while configure netcdf then the problem will be resolved.

How To Resolve Cannot find Library in netCDF configuration

2)configure:16175: gcc -o conftest -L/app/intel/tbb/lib/intel64/ -ltbbmalloc   conftest.c -lhdf5  -lm -lz  >&5
/usr/bin/ld: cannot find -lhdf5
collect2: ld returned 1 exit status
configure:16175: $? = 1
SOLUTION: After Adding the  hdf5 library into CFLAGS then the problem will be solved.
CFLAGS="-L/app/hdf5-1.8.1-parallel/lib"

2.1)
configure:16175: gcc -o conftest -L/app/intel/tbb/lib/intel64/ -ltbbmalloc -L/app/hdf5-1.8.1-parallel/lib   conftest.c -lhdf5  -lm -lz  >&5
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5F.o): In function `H5Fget_name':
H5F.c:(.text+0x8507): undefined reference to `__intel_sse2_strlen'
H5F.c:(.text+0x8547): undefined reference to `__intel_sse2_strncpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5Fsuper.o): In function `H5F_locate_signature':
H5Fsuper.c:(.text+0xe6): undefined reference to `_intel_fast_memcmp'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5Fsuper.o): In function `H5F_super_read':
H5Fsuper.c:(.text+0x395): undefined reference to `_intel_fast_memcmp'
H5Fsuper.c:(.text+0xab2): undefined reference to `__intel_sse2_strncpy'
H5Fsuper.c:(.text+0xaeb): undefined reference to `__intel_sse2_strncmp'
H5Fsuper.c:(.text+0xb41): undefined reference to `__intel_sse2_strncmp'
H5Fsuper.c:(.text+0xfbd): undefined reference to `__intel_sse2_strncmp'
H5Fsuper.c:(.text+0x1013): undefined reference to `__intel_sse2_strncmp'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FDregister':
H5FD.c:(.text+0x16f): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FD_register':
H5FD.c:(.text+0x631): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FD_fapl_open':
H5FD.c:(.text+0x1102): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FD_fapl_copy':
H5FD.c:(.text+0x156a): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FD_dxpl_open':
H5FD.c:(.text+0x1a42): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o):H5FD.c:(.text+0x1eaa): more undefined references to `_intel_fast_memcpy' follow
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FDwrite':
H5FD.c:(.text+0x6679): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x66a6): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x6737): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x6753): undefined reference to `_intel_fast_memcpy'
5FD.c:(.text+0x6753): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x67e6): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x6810): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x6845): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x68c2): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x690c): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x69fa): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x6a27): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x6a8f): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FD.o): In function `H5FD_write':
H5FD.c:(.text+0x707d): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x70aa): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x713c): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x7158): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x71ec): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x7216): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x724c): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x72ca): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x7314): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x7405): undefined reference to `_intel_fast_memset'
H5FD.c:(.text+0x7433): undefined reference to `_intel_fast_memcpy'
H5FD.c:(.text+0x749c): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDcore.o): In function `H5FD_core_read':
H5FDcore.c:(.text+0xfa8): undefined reference to `_intel_fast_memcpy'
H5FDcore.c:(.text+0xfc0): undefined reference to `_intel_fast_memset'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDcore.o): In function `H5FD_core_write':
H5FDcore.c:(.text+0x11a5): undefined reference to `_intel_fast_memset'
H5FDcore.c:(.text+0x11dd): undefined reference to `_intel_fast_memcpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDfamily.o): In function `H5FD_family_sb_encode':
H5FDfamily.c:(.text+0xce6): undefined reference to `__intel_sse2_strncpy'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDlog.o): In function `H5FD_log_alloc':
H5FDlog.c:(.text+0xf2f): undefined reference to `_intel_fast_memset'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDlog.o): In function `H5FD_log_alloc':
H5FDlog.c:(.text+0xf2f): undefined reference to `_intel_fast_memset'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDlog.o): In function `H5FD_log_read':
H5FDlog.c:(.text+0x1467): undefined reference to `_intel_fast_memset'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDlog.o): In function `H5FD_log_write':
H5FDlog.c:(.text+0x196b): undefined reference to `_intel_fast_memset'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5FDmpi.o): In function `H5FD_mpi_comm_info_dup'

SOLUTION: The Above undefined Reference problem is matches with /app/intel/composer_xe_2013.1.117/compiler/lib/ia32/libintlc.so.5.
We have to use the Global Text Symbol library.Then only the undefined reference problem will be solved.
-L/app/intel/composer_xe_2013.1.117/compiler/lib/intel64/ -lintlc
header fine missing cannot find library

2.2)H5Smpio.c:(.text+0x2a6): undefined reference to `MPI_Type_commit'
H5Smpio.c:(.text+0x2c8): undefined reference to `MPI_Type_hvector'
H5Smpio.c:(.text+0x2da): undefined reference to `MPI_Type_commit'
H5Smpio.c:(.text+0x2ec): undefined reference to `MPI_Type_free'
H5Smpio.c:(.text+0x33a): undefined reference to `MPI_Type_struct'
H5Smpio.c:(.text+0x367): undefined reference to `MPI_Type_free'
H5Smpio.c:(.text+0x3cd): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x454): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x4db): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x562): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x5e9): undefined reference to `MPI_Error_string'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5Smpio.o):H5Smpio.c:(.text+0x670): more undefined references to `MPI_Error_string' follow
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5Smpio.o): In function `H5S_obtain_datatype':
H5Smpio.c:(.text+0x744): undefined reference to `MPI_Type_contiguous'
H5Smpio.c:(.text+0x75f): undefined reference to `MPI_Type_commit'
H5Smpio.c:(.text+0x7ba): undefined reference to `MPI_Type_hindexed'
H5Smpio.c:(.text+0x7d8): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x85f): undefined reference to `MPI_Error_string'
H5Smpio.c:(.text+0x8e6): undefined reference to `MPI_Error_string'
/app/hdf5-1.8.1-parallel/lib/libhdf5.a(H5Smpio.o): In function `H5S_mpio_space_type':
H5Smpio.c:(.text+0xd33): undefined reference to `MPI_Type_commit'
H5Smpio.c:(.text+0xd55): undefined reference to `MPI_Type_hvector'

SOLUTION:The Above Symbol Matches with following library flags.
/app/openmpi-1.6.4/lib/libvt-mpi.so and it is resolved by adding following flags.
-L/app/openmpi-1.6.4/lib -lmpi

How To Resolve Can not Find Header File(.h) Issue

2.3) configure: error: Compiling a test with HDF5 failed.  Either hdf5.h cannot be found, or config.log should be checked for other reason
SOLUTION :CPPFLAGS="-I/app/hdf5-1.8.1-parallel/include/ -I/app/openmpi-1.6.4/include/"

2.4) checking for mfhdf.h... no
configure: error: Cannot find mfhdf.h, yet --enable-hdf4 was used.
SOLUTION: CPPFLAGS="-I/app/setups/hdf-4.2.7-patch1/include/


CONFIGURE FINAL SUCCESSFUL OPTION.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/intel/tbb/lib/intel64/
./configure --prefix=/app/netcdf-4.3.0-t2/ --enable-hdf4 --with-hdf5=/app/hdf5-1.8.1-parallel/lib --enable-parallel CFLAGS="-L/app/intel/tbb/lib/intel64/ -ltbbmalloc -L/app/hdf5-1.8.1-parallel/lib -L/app/intel/composer_xe_2013.1.117/compiler/lib/intel64/ -lintlc -L/app/intel/ics/2013.0.028/itac/mic/lib/ -L/app/intel/composer_xe_2013.1.117/compiler/lib/intel64/ -lsvml -L/app/openmpi-1.6.4/lib -lmpi" CPPFLAGS="-I/app/hdf5-1.8.1-parallel/include/ -I/app/openmpi-1.6.4/include/ -I/app/setups/hdf-4.2.7-patch1/include/" --disable-dap --disable-dap-remote-tests


MAKE ERROR MESSAGE
1)gcc -shared  -fPIC -DPIC  .libs/libnetcdf_la-stub.o  -Wl,--whole-archive ../libdispatch/.libs/libnetcdf2.a ../libdispatch/.libs/libdispatch.a ../libsrc/.libs/libnetcdf3.a ../libsrc4/.libs/libnetcdf4.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/app/openmpi-1.6.4/lib -Wl,-rpath -Wl,/app/openmpi-1.6.4/lib -L/app/intel/tbb/lib/intel64/ -L/app/hdf5-1.8.1-parallel/lib -L/app/intel/composer_xe_2013.1.117/compiler/lib/intel64/ -L/app/intel/ics/2013.0.028/itac/mic/lib/ -L/app/openmpi-1.6.4/lib -L/root/openmpi-1.6.4/opal/mca/hwloc/hwloc132/hwloc/src -ltbbmalloc -lintlc -lsvml /app/openmpi-1.6.4/lib/libmpi.so -lnuma -ldl -lrt -lnsl -lutil /app/hdf5-1.8.1-parallel/lib/libhdf5_hl.a /app/hdf5-1.8.1-parallel/lib/libhdf5.a -lm -lz    -pthread -Wl,-soname -Wl,libnetcdf.so.7 -o .libs/libnetcdf.so.7.2.0
/usr/bin/ld: /app/hdf5-1.8.1-parallel/lib/libhdf5_hl.a(H5DS.o): relocation R_X86_64_32 against `.rodata.str1.4' can not be used when making a shared object; recompile with -fPIC
/app/hdf5-1.8.1-parallel/lib/libhdf5_hl.a: could not read symbols: Bad value

collect2: ld returned 1 exit status
make[2]: *** [libnetcdf.la] Error 1
make[2]: Leaving directory `/app/setups/netcdf-4.3.0-new/netcdf-4.3.0/liblib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/app/setups/netcdf-4.3.0-new/netcdf-4.3.0'
make: *** [all] Error 2

SOLUTION :The above problem has been resolved by recombile with different hdf library.
/app/hdf5-1.8.1-parallel/lib/ instead of that /app/hdf5-1.8.5-patch1/lib then the problem will be solved.
Useful Link : http://lists.osgeo.org/pipermail/gdal-dev/2011-September/030130.html


2)./liblib/.libs/libnetcdf.so: undefined reference to `SDend'
../liblib/.libs/libnetcdf.so: undefined reference to `SDfileinfo'
../liblib/.libs/libnetcdf.so: undefined reference to `SDdiminfo'
../liblib/.libs/libnetcdf.so: undefined reference to `SDgetfillvalue'
../liblib/.libs/libnetcdf.so: undefined reference to `SDgetinfo'
../liblib/.libs/libnetcdf.so: undefined reference to `SDselect'
../liblib/.libs/libnetcdf.so: undefined reference to `SDgetdimid'
../liblib/.libs/libnetcdf.so: undefined reference to `SDstart'
../liblib/.libs/libnetcdf.so: undefined reference to `SDreaddata'
../liblib/.libs/libnetcdf.so: undefined reference to `SDreadattr'
../liblib/.libs/libnetcdf.so: undefined reference to `SDattrinfo'
collect2: ld returned 1 exit status
make[2]: *** [ncgen3] Error 1
make[2]: Leaving directory `/app/setups/netcdf-4.3.0-new/netcdf-4.3.0/ncgen3'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/app/setups/netcdf-4.3.0-new/netcdf-4.3.0'
make: *** [all] Error 2
CFLAGS=-fPIC
NOTE: If we check the config.log  lines 3840 and 3970
we see that configure cannot find the hdf4 libraries 'libdf' and 'libmfhdf'.

SOLUTION:  The above problem is occur due to hdf4 because we enable the option using "--enable-hdf4" in the configure but didn't give any library path to the LDFLAGS.Once remove that particular option "--enable-hdf4" then the problem has been resolved.

netcdf bin include lib deps


Post a Comment

0 Comments