make error ..on red-hat

Help
waheed
2012-06-09
2013-10-17
  • waheed

    waheed - 2012-06-09

    Dear all

    I am trying to install nco-4.1.0 on red-hat Linux
    $ uname -a
    Linux pmd02.pakmet.com 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux

    when i run make it give error

    ./.libs/libnco.so: undefined reference to `nc_put_vara_short'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_short'
    ./.libs/libnco.so: undefined reference to `nc_get_att_float'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_schar'
    ./.libs/libnco.so: undefined reference to `nc_inq_attname'
    ./.libs/libnco.so: undefined reference to `nc_inq_var_fletcher32'
    ./.libs/libnco.so: undefined reference to `nc_inq_dimname'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_double'
    ./.libs/libnco.so: undefined reference to `nc_inq_var_deflate'
    ./.libs/libnco.so: undefined reference to `nc_put_vara_text'
    ./.libs/libnco.so: undefined reference to `nc_inq_dim'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_schar'
    ./.libs/libnco.so: undefined reference to `nc_inq_nvars'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_float'
    ./.libs/libnco.so: undefined reference to `nc_put_vara_float'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_int'
    ./.libs/libnco.so: undefined reference to `nc_inq_var_chunking'
    ./.libs/libnco.so: undefined reference to `nc_open'
    ./.libs/libnco.so: undefined reference to `nc_get_att_short'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_short'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_schar'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_float'
    ./.libs/libnco.so: undefined reference to `nc_def_var_deflate'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_short'
    ./.libs/libnco.so: undefined reference to `nc_inq_varndims'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_float'
    ./.libs/libnco.so: undefined reference to `nc_inq_attlen'
    ./.libs/libnco.so: undefined reference to `nc_def_var'
    ./.libs/libnco.so: undefined reference to `nco_inq_grpname'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_float'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_float'
    ./.libs/libnco.so: undefined reference to `nc_put_att_int'
    ./.libs/libnco.so: undefined reference to `nc_inq'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_int'
    ./.libs/libnco.so: undefined reference to `nc_inq_dimlen'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_short'
    ./.libs/libnco.so: undefined reference to `nc__enddef'
    ./.libs/libnco.so: undefined reference to `nco_inq_varids'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_schar'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_double'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_schar'
    ./.libs/libnco.so: undefined reference to `nco_inq_grps'
    ./.libs/libnco.so: undefined reference to `nc_copy_var'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_int'
    ./.libs/libnco.so: undefined reference to `nc_put_vara_int'
    ./.libs/libnco.so: undefined reference to `nc_put_vara_schar'
    ./.libs/libnco.so: undefined reference to `nc_rename_var'
    ./.libs/libnco.so: undefined reference to `nc_redef'
    ./.libs/libnco.so: undefined reference to `nc_inq_att'
    ./.libs/libnco.so: undefined reference to `nc_put_att_text'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_text'
    ./.libs/libnco.so: undefined reference to `nc_inq_vardimid'
    ./.libs/libnco.so: undefined reference to `nc_put_att_short'
    ./.libs/libnco.so: undefined reference to `nc_rename_att'
    ./.libs/libnco.so: undefined reference to `nc_put_vara_double'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_int'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_short'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_int'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_double'
    ./.libs/libnco.so: undefined reference to `nc_inq_ndims'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_float'
    ./.libs/libnco.so: undefined reference to `nc_get_vara_text'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_double'
    ./.libs/libnco.so: undefined reference to `nco_def_grp'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_int'
    ./.libs/libnco.so: undefined reference to `nc_inq_libvers'
    ./.libs/libnco.so: undefined reference to `nc_sync'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_double'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_short'
    ./.libs/libnco.so: undefined reference to `nc_put_att_schar'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_int'
    ./.libs/libnco.so: undefined reference to `nc_put_att_double'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_schar'
    ./.libs/libnco.so: undefined reference to `nc_inq_natts'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_short'
    ./.libs/libnco.so: undefined reference to `nc_close'
    ./.libs/libnco.so: undefined reference to `nc_inq_dimid'
    ./.libs/libnco.so: undefined reference to `nc_put_varm_text'
    ./.libs/libnco.so: undefined reference to `nc_inq_unlimdim'
    ./.libs/libnco.so: undefined reference to `nc_del_att'
    ./.libs/libnco.so: undefined reference to `nc_get_att_int'
    ./.libs/libnco.so: undefined reference to `nc_abort'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_text'
    ./.libs/libnco.so: undefined reference to `nc_def_dim'
    ./.libs/libnco.so: undefined reference to `nc_def_var_chunking'
    ./.libs/libnco.so: undefined reference to `nc_get_att_double'
    ./.libs/libnco.so: undefined reference to `nc_get_varm_text'
    ./.libs/libnco.so: undefined reference to `nc_inq_vartype'
    ./.libs/libnco.so: undefined reference to `nc_strerror'
    ./.libs/libnco.so: undefined reference to `nc_inq_varname'
    ./.libs/libnco.so: undefined reference to `nc_set_fill'
    ./.libs/libnco.so: undefined reference to `nc_enddef'
    ./.libs/libnco.so: undefined reference to `nc_get_att_schar'
    ./.libs/libnco.so: undefined reference to `nc_put_att_float'
    ./.libs/libnco.so: undefined reference to `nc_inq_varid'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_schar'
    ./.libs/libnco.so: undefined reference to `nc_inq_attid'
    ./.libs/libnco.so: undefined reference to `nc_get_att_text'
    ./.libs/libnco.so: undefined reference to `nc_get_var1_text'
    ./.libs/libnco.so: undefined reference to `nc_create'
    ./.libs/libnco.so: undefined reference to `nc_rename_dim'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_double'
    ./.libs/libnco.so: undefined reference to `nc_put_var1_float'
    ./.libs/libnco.so: undefined reference to `nc_copy_att'
    ./.libs/libnco.so: undefined reference to `nc_put_vars_text'
    ./.libs/libnco.so: undefined reference to `nc_inq_varnatts'
    ./.libs/libnco.so: undefined reference to `nc_get_vars_double'
    ./.libs/libnco.so: undefined reference to `nco_inq_grpname_len'
    ./.libs/libnco.so: undefined reference to `nc_inq_atttype'
    ./.libs/libnco.so: undefined reference to `nco_inq_grpname_full'
    ./.libs/libnco.so: undefined reference to `nc_inq_var'
    collect2: ld returned 1 exit status
    make: ***  Error 1
    make: Leaving directory `/home/pmdtest/nco-4.1.0/src/nco'
    make: ***  Error 1
    make: Leaving directory `/home/pmdtest/nco-4.1.0/src'
    make: ***  Error 1
    make: Leaving directory `/home/pmdtest/nco-4.1.0'
    make: ***  Error 2

    Please help me to solve this problem
    Best regards
    waheed

     
  • Pedro Vicente

    Pedro Vicente - 2012-06-14

    Hi Waheed

    Those are errors regarding the netCDF library not being found (linked)  by nco.
    These are instructions I used to build on a Red Hat Enterprise Linux system (RHEL 6) using automake 1.11.1
    Note: these are generic instructions for any Unix system.

    1) First, build the netCDF library with support for netCDF4 (this assumes the HDF5 library already installed, for example, in the location mentioned below)

    I used

    $ CFLAGS=-I/SNS/users/pvicente/libs/install/hdf5-1.8.5-patch1/include LDFLAGS=-L/SNS/users/pvicente/libs/install/hdf5-1.8.5-patch1/lib ./configure -prefix=/SNS/users/pvicente/libs/install/netcdf-4.2 -disable-dap -disable-examples -disable-doxygen

    $make && make install

    2) Download the latest nc0 4.2.0 release from (Get NCO Source Code section)
    http://nco.sourceforge.net/

    3) Define the following environment variables, needed to build nco

    #nco build
    export NETCDF_INC=/SNS/users/pvicente/libs/install/netcdf-4.2/include
    export NETCDF4_ROOT=/SNS/users/pvicente/libs/install/netcdf-4.2
    export NETCDF_LIB=/SNS/users/pvicente/libs/install/netcdf-4.2/lib
    export PATH_TO_NCGEN=/SNS/users/pvicente/libs/install/netcdf-4.2/bin/ncgen
    export ANTLR_ROOT=/SNS/users/pvicente/libs/install/antlr-2.7.7

    additionally, to run the nco tests, you need this

    #nco tests
    export DATA=/SNS/users/pvicente/nco/nco_data
    export MY_BIN_DIR=/SNS/users/pvicente/nco/nco_install/bin

    $ mkdir /SNS/users/pvicente/nco/nco_data

    4) Install the antlr library, from

    http://www.antlr.org/

    you need version 2.7.7, do not use the latest

    To compile antlr  in RHEL , these changes to the antlr  2.7.7 source are needed, to the file
    lib/cpp/antlr/CharScanner.hpp

    +#include <stdio.h>
    +#include <strings.h>

    Do
    $ ./configure -prefix=/SNS/users/pvicente/libs/install/antlr-2.7.7
    $ make && make install

    5) Finally, build nco with

    $./configure -prefix=/SNS/users/pvicente/nco/nco_install -enable-netcdf4
    $ make && make install
    $ make check

     
  • Jonathan Murray

    Jonathan Murray - 2012-11-28

    I've got the following set:

    NETCDF_INC is /home/jmurray/global/netcdf-4.2.1.1/include
    NETCDF4_ROOT is /home/jmurray/global/netcdf-4.2.1.1
    NETCDF_LIB is /home/jmurray/global/netcdf-4.2.1.1/lib
    PATH_TO_NCGEN is /home/jmurray/global/netcdf-4.2.1.1/bin/ncgen
    ANTLR_ROOT is /home/jmurray/global/antlr-2.7.7
    DATA is /home/jmurray/global/nco_data
    MY_BIN_DIR is /home/jmurray/global/nco-4.2.0/bin

    ./configure -prefix=/home/jmurray/global/nco-4.2.0 -enable-netcdf4

    Configuration Parameters:
    AR_FLAGS…………. cru
    CC………………. gcc -std=gnu99
    CFLAGS…………… -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE
    CPP……………… gcc -E
    CPPFLAGS…………. -I/home/jmurray/global/netcdf-4.2.1.1/include -I/home/jmurray/global/netcdf-4.2.1.1/include   -I/home/jmurray/global/antlr-2.7.7/include
    CXX……………… g++
    CXXFLAGS…………. -g -O2
    ENABLE_DAP_NETCDF…. no
    ENABLE_DAP……….. no
    ENABLE_GSL……….. no
    ENABLE_NETCDF4……. yes
    ENABLE_UDUNITS……. no
    ENABLE_UDUNITS2…… no
    GSL_ROOT…………. /usr
    HAVE_NETCDF4_H……. yes
    HOST……………..
    host…………….. x86_64-unknown-linux-gnu
    HOSTNAME…………. delmar.whoi.edu
    LDFLAGS………….. -L/home/jmurray/global/netcdf-4.2.1.1/lib -lnetcdf -lhdf5_hl -lhdf5 -lm -lcurl -L/home/jmurray/global/netcdf-4.2.1.1/lib   -L/home/jmurray/global/antlr-2.7.7/lib
    LIBS……………..

    make

    /nco_att_utl.Tpo -c nco_att_utl.c  -fPIC -DPIC -o .libs/nco_att_utl.o
    In file included from nco_prn.h:32,
                     from nco_mss_val.h:31,
                     from nco_var_utl.h:39,
                     from nco_scl_utl.h:33,
                     from nco_pck.h:27,
                     from nco_ctl.h:38,
                     from nco_mmr.h:37,
                     from nco_cnf_typ.h:26,
                     from nco_att_utl.h:30,
                     from nco_att_utl.c:9:
    nco_sng_utl.h:44: error: expected identifier or '(' before '__extension__'
    make: ***  Error 1
    make: Leaving directory `/home/jmurray/src/nco-4.2.0/src/nco'
    make: ***  Error 1
    make: Leaving directory `/home/jmurray/src/nco-4.2.0/src'
    make: ***  Error 1
    make: Leaving directory `/home/jmurray/src/nco-4.2.0'
    make: ***  Error 2

    NETCDF4_ROOT……… /home/jmurray/global/netcdf-4.2.1.1

     
  • Jonathan Murray

    Jonathan Murray - 2012-11-28

    whoops…anyone out there in NCO world have any ideas. I'm happy to try them. thank you

     
  • zjlzjl6666

    zjlzjl6666 - 2012-12-03

    I am also trying to install nco-4.1.0 on red-hat Linux and encountered make error as following:

    make  all-recursive
    make: Entering directory `/users2/jlzhu/software/nco-4.2.3'
    Making all in data
    make: Entering directory `/users2/jlzhu/software/nco-4.2.3/data'
    make: Nothing to be done for `all'.
    make: Leaving directory `/users2/jlzhu/software/nco-4.2.3/data'
    Making all in src
    make: Entering directory `/users2/jlzhu/software/nco-4.2.3/src'
    Making all in nco
    make: Entering directory `/users2/jlzhu/software/nco-4.2.3/src/nco'
    /bin/sh ../../libtool -tag=CXX -tag=CC   -mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..   -I/software/netcdf-intel/include/    -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -MT nco_att_utl.lo -MD -MP -MF .deps/nco_att_utl.Tpo -c -o nco_att_utl.lo nco_att_utl.c
    libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I/software/netcdf-intel/include/ -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -MT nco_att_utl.lo -MD -MP -MF .deps/nco_att_utl.Tpo -c nco_att_utl.c  -fPIC -DPIC -o .libs/nco_att_utl.o
    libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I/software/netcdf-intel/include/ -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -MT nco_att_utl.lo -MD -MP -MF .deps/nco_att_utl.Tpo -c nco_att_utl.c -o nco_att_utl.o >/dev/null 2>&1
    mv -f .deps/nco_att_utl.Tpo .deps/nco_att_utl.Plo
    /bin/sh ../../libtool -tag=CXX -tag=CC   -mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..   -I/software/netcdf-intel/include/    -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -MT nco_aux.lo -MD -MP -MF .deps/nco_aux.Tpo -c -o nco_aux.lo nco_aux.c
    libtool: compile:  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. -I/software/netcdf-intel/include/ -g -O2 -std=c99 -D_BSD_SOURCE -D_POSIX_SOURCE -MT nco_aux.lo -MD -MP -MF .deps/nco_aux.Tpo -c nco_aux.c  -fPIC -DPIC -o .libs/nco_aux.o
    In file included from nco_lmt.h:39,
                     from nco_aux.h:25,
                     from nco_aux.c:18:
    nco_cln_utl.h:29:51: error: udunits.h: No such file or directory
    make: ***  Error 1
    make: Leaving directory `/users2/jlzhu/software/nco-4.2.3/src/nco'
    make: ***  Error 1
    make: Leaving directory `/users2/jlzhu/software/nco-4.2.3/src'
    make: ***  Error 1
    make: Leaving directory `/users2/jlzhu/software/nco-4.2.3'
    make: ***  Error 2

     
  • Jonathan Murray

    Jonathan Murray - 2012-12-03

    We spent about two weeks working on this one. I don't really know how to test that it works, but the scientist is using it and not complaining. We moved to pvicente's suggestion of trying nco-4.2.3. I think most of our problems are related to the fact that is on a rocks/centos5.5 cluster that is out of date. Going outside the rocks cluster repos, from what I understand, is a no no. This was definitely an issue with getting everything to "work". We've also managed to get it working on ubuntu, debian and centos 6.2.

    We put everything into one directory and built it there.

    we used the following:
    antlr-2.7.7
    udunits-2.1.20
    hdf5-1.8.9
    netcdf-4.2.1.1
    nco-4.2.3
    intel fortran compiler Version 12.0.3

    antlr and udunits installed first (from source)

    /usr/local/src/antlr-2.7.7
    /usr/local/src/udunits-2.1.20

    for hdf5-1.8.9

    make clean && make distclean
    FC=ifort F77=ifort CFLAGS=-Wno-unreachable-code ./configure -enable-fortran -enable-cxx -prefix=
    make && make install

    for netcdf-4.2.1.1:
    make clean && make distclean

    FC=ifort F77=ifort CFLAGS=-I/usr/local/src/include CPPFLAGS=-I/usr/local/src/include LDFLAGS=-L/usr/local/src/lib ./configure -enable-fortran -enable-cxx -prefix=

    make && make install

    nco-4.2.3

    FC=ifort F77=ifort CCFLAGS=-I/usr/local/antlr-2.7.7/include LDFLAGS=-L/usr/local//antlr-2.7.7/lib  NETCDF_INC=/usr/local/src/include NETCDF_LIB=/usr/local/src/lib UDUNITS2_PATH=/usr/local/src/udunits-2.1.20 ./configure -prefix=
    make && make check && make install

    Your environment may vary, so adjust your variable accordingly. We found building everything after antlr and udunits2 in one place seemed to work.

    Good luck!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks