[Met_help] [rt.rap.ucar.edu #52194] History for help_[pcp_combine] Error 2

John Halley Gotway via RT met_help at ucar.edu
Thu Jan 5 09:37:47 MST 2012


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Dear Sir,

I am trying to compile METv3.0 using pgi compilers.

*The start of my Makefile looks like this:*
*
*
*
# Path to the C++ Compiler
# C++ compiler flags
# Any additional required libraries
CXX          = /opt/pgi/linux86-64/10.5/bin/pgCC
CXX_FLAGS    = -Bstatic # -g
CXX_LIBS     =

# Path to the Fortran Compiler
# Fortran compiler flags
# Any additional required libraries
FC           = /opt/pgi/linux86-64/10.5/bin/pgf90
FC_FLAGS     = -Bstatic # -g
FC_LIBS      = -lpgftnrtl -lrt -lpthread

*

error message:
(1)
/opt/pgi/linux86-64/10.5/bin/pgCC -o pcp_combine pcp_combine.cc \ -Bstatic
-DMET_BASE=\"/work4/joray/tzyu/METv3.0.1\" \ -I../../lib
-I/opt/netcdf/include -I/work4/joray/tzyu/gsl-1.14//include \ -L../../lib
-L/opt/netcdf/lib -L/work4/joray/tzyu/gsl-1.14//lib \ -lvx_contable
-lvx_met_util -lvx_analysis_util \ -lvx_gdata -lvx_wrfdata -lvx_contable
-lvx_met_util -lvx_grib_classes \ -lvx_econfig -lvx_gsl_prob -lgsl \
-lvx_plot_util -lvx_render -lvx_pxm -lvx_color -lvx_ps -lvx_afm \
-lvx_data_grids -lvx_gnomon -lvx_nav -lvx_cal -lvx_util -lvx_math -lm \
-lnetcdf_c++ -lnetcdf \ /tmp/pgCCeTremIVRJez9.o: In function
`write_netcdf(long long, long long, int, Grid &, GribRecord &)':
/work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
undefined reference to `NcFile::__ct(char const *, NcFile::FileMode,
unsigned long *, unsigned long, NcFile::FileFormat)'
/work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
undefined reference to `NcFile::is_valid( const(void))'

(2)

../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_global__FP6NcFilePCcT2':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(write_netcdf.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
more undefined references to `NcVar::add_att(char const *, char const
*)' follow
../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:108:
undefined reference to `NcVar::put(float const *, long, long, long,
long, long)'

(3)
../../lib/libvx_met_util.a(grid_output.o): In function
`lambert_grid_output(const GridInfo &, NcFile *)':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86: undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86: undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86: undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86: undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86: undefined
reference to `NcFile::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(grid_output.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
more undefined references to `NcFile::add_att(char const *, char const *)'
follow

make[3]: *** [pcp_combine] Error 2 make[2]: *** [all] Error 2 make[1]: ***
[targets] Error 2 make: *** [all] Error 2


*Could you please give me hints to resolve this? Thank you very much!*

*
*

*Kate*

*
*


----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: help_[pcp_combine] Error 2
From: 吳小榆
Time: Wed Dec 21 17:28:52 2011

Dear Sir,

I am trying to compile METv3.0 using pgi compilers.

The start of my Makefile looks like this:


# Path to the C++ Compiler
# C++ compiler flags
# Any additional required libraries
CXX          = /opt/pgi/linux86-64/10.5/bin/pgCC
CXX_FLAGS    = -Bstatic # -g
CXX_LIBS     =

# Path to the Fortran Compiler
# Fortran compiler flags
# Any additional required libraries
FC           = /opt/pgi/linux86-64/10.5/bin/pgf90
FC_FLAGS     = -Bstatic # -g
FC_LIBS      = -lpgftnrtl -lrt -lpthread

----------------------------

error message:
(1)
/opt/pgi/linux86-64/10.5/bin/pgCC -o pcp_combine pcp_combine.cc \
-Bstatic
-DMET_BASE=\"/work4/joray/tzyu/METv3.0.1\" \ -I../../lib
-I/opt/netcdf/include -I/work4/joray/tzyu/gsl-1.14//include \
-L../../lib
-L/opt/netcdf/lib -L/work4/joray/tzyu/gsl-1.14//lib \ -lvx_contable
-lvx_met_util -lvx_analysis_util \ -lvx_gdata -lvx_wrfdata
-lvx_contable
-lvx_met_util -lvx_grib_classes \ -lvx_econfig -lvx_gsl_prob -lgsl \
-lvx_plot_util -lvx_render -lvx_pxm -lvx_color -lvx_ps -lvx_afm \
-lvx_data_grids -lvx_gnomon -lvx_nav -lvx_cal -lvx_util -lvx_math -lm
\
-lnetcdf_c++ -lnetcdf \ /tmp/pgCCeTremIVRJez9.o: In function
`write_netcdf(long long, long long, int, Grid &, GribRecord &)':
/work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
undefined reference to `NcFile::__ct(char const *, NcFile::FileMode,
unsigned long *, unsigned long, NcFile::FileFormat)'
/work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
undefined reference to `NcFile::is_valid( const(void))'

(2)

../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_global__FP6NcFilePCcT2':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
undefined reference to `NcFile::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
undefined reference to `NcVar::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(write_netcdf.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
more undefined references to `NcVar::add_att(char const *, char const
*)' follow
../../lib/libvx_met_util.a(write_netcdf.o): In function
`write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:108:
undefined reference to `NcVar::put(float const *, long, long, long,
long, long)'

(3)
../../lib/libvx_met_util.a(grid_output.o): In function
`lambert_grid_output(const GridInfo &, NcFile *)':
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
reference to `NcFile::add_att(char const *, char const *)'
/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
reference to `NcFile::add_att(char const *, char const *)'
../../lib/libvx_met_util.a(grid_output.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
more undefined references to `NcFile::add_att(char const *, char const
*)'
follow

make[3]: *** [pcp_combine] Error 2
make[2]: *** [all] Error 2 make[1]: ***
[targets] Error 2
make: *** [all] Error 2



Could you please give me hints to resolve this? Thank you very much!




Kate

------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #52194]_help_[pcp_combine] Error 2
From: John Halley Gotway
Time: Thu Dec 22 09:24:43 2011

Kate,

I see that you're having problems getting METv3.0.1 to compile.

First, let me mention a problem I see.  It won't fix the problem you
asked about but will come up later.  It looks like you're using the
pgf90 compiler in your Makefile:
   FC = /opt/pgi/linux86-64/10.5/bin/pgf90
Instead you should be using the pgf77 compiler.  The small pieces of
FORTRAN code in the PB2NC tool are FORTRAN-77 code.  Please switch to
this:
   FC = /opt/pgi/linux86-64/10.5/bin/pgf77

Next, based on the error messages you sent, I see that the MET code
isn't compiling because the linker is having problems linking to the
NetCDF library.  These types of linker errors almost always
occur because users are trying to link to a version of NetCDF that was
built with a family of compilers that differs from what they're using
to build MET.  Based on what you sent, I see that you're
pointing to NetCDF in "/opt/netcdf".

I would guess that the version of NetCDF in /opt/netcdf was *NOT*
built with the PGI version 10.5 compilers.  Just to test it out, I
tried compiling MET with PGI compilers and linking to a NetCDF
library built with the GNU compilers - and I was able to replicate the
exact linker error messages you're seeing.

If you can find a version of NetCDF that's built with PGI version
10.5, just point to it in the top-level MET Makefile.  If not, you
could download and build such a version of NetCDF.  Or you could
switch to building MET with the same family of compilers that was used
to build NetCDF in /opt/netcdf.

Hope that helps.

Thanks,
John Halley Gotway




On 12/21/2011 05:28 PM, 吳小榆 via RT wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=52194 >
>
> Dear Sir,
>
> I am trying to compile METv3.0 using pgi compilers.
>
> The start of my Makefile looks like this:
>
>
> # Path to the C++ Compiler
> # C++ compiler flags
> # Any additional required libraries
> CXX          = /opt/pgi/linux86-64/10.5/bin/pgCC
> CXX_FLAGS    = -Bstatic # -g
> CXX_LIBS     =
>
> # Path to the Fortran Compiler
> # Fortran compiler flags
> # Any additional required libraries
> FC           = /opt/pgi/linux86-64/10.5/bin/pgf90
> FC_FLAGS     = -Bstatic # -g
> FC_LIBS      = -lpgftnrtl -lrt -lpthread
>
> ----------------------------
>
> error message:
> (1)
> /opt/pgi/linux86-64/10.5/bin/pgCC -o pcp_combine pcp_combine.cc \
-Bstatic
> -DMET_BASE=\"/work4/joray/tzyu/METv3.0.1\" \ -I../../lib
> -I/opt/netcdf/include -I/work4/joray/tzyu/gsl-1.14//include \
-L../../lib
> -L/opt/netcdf/lib -L/work4/joray/tzyu/gsl-1.14//lib \ -lvx_contable
> -lvx_met_util -lvx_analysis_util \ -lvx_gdata -lvx_wrfdata
-lvx_contable
> -lvx_met_util -lvx_grib_classes \ -lvx_econfig -lvx_gsl_prob -lgsl \
> -lvx_plot_util -lvx_render -lvx_pxm -lvx_color -lvx_ps -lvx_afm \
> -lvx_data_grids -lvx_gnomon -lvx_nav -lvx_cal -lvx_util -lvx_math
-lm \
> -lnetcdf_c++ -lnetcdf \ /tmp/pgCCeTremIVRJez9.o: In function
> `write_netcdf(long long, long long, int, Grid &, GribRecord &)':
> /work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
> undefined reference to `NcFile::__ct(char const *, NcFile::FileMode,
> unsigned long *, unsigned long, NcFile::FileFormat)'
> /work4/joray/tzyu/METv3.0.1/src/pcp_combine/./pcp_combine.cc:1071:
> undefined reference to `NcFile::is_valid( const(void))'
>
> (2)
>
> ../../lib/libvx_met_util.a(write_netcdf.o): In function
> `write_netcdf_global__FP6NcFilePCcT2':
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
> undefined reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
> undefined reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:37:
> undefined reference to `NcFile::add_att(char const *, char const *)'
> ../../lib/libvx_met_util.a(write_netcdf.o): In function
> `write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> undefined reference to `NcVar::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> undefined reference to `NcVar::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> undefined reference to `NcVar::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> undefined reference to `NcVar::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> undefined reference to `NcVar::add_att(char const *, char const *)'
>
../../lib/libvx_met_util.a(write_netcdf.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:78:
> more undefined references to `NcVar::add_att(char const *, char
const
> *)' follow
> ../../lib/libvx_met_util.a(write_netcdf.o): In function
> `write_netcdf_latlon__FP6NcFileP5NcDimT2RC4Grid':
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./write_netcdf.cc:108:
> undefined reference to `NcVar::put(float const *, long, long, long,
> long, long)'
>
> (3)
> ../../lib/libvx_met_util.a(grid_output.o): In function
> `lambert_grid_output(const GridInfo &, NcFile *)':
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
> reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
> reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
> reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
> reference to `NcFile::add_att(char const *, char const *)'
> /work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
undefined
> reference to `NcFile::add_att(char const *, char const *)'
>
../../lib/libvx_met_util.a(grid_output.o):/work4/joray/tzyu/METv3.0.1/lib/vx_met_util/./grid_output.cc:86:
> more undefined references to `NcFile::add_att(char const *, char
const *)'
> follow
>
> make[3]: *** [pcp_combine] Error 2
> make[2]: *** [all] Error 2 make[1]: ***
> [targets] Error 2
> make: *** [all] Error 2
>
>
>
> Could you please give me hints to resolve this? Thank you very much!
>
>
>
>
> Kate

------------------------------------------------
Subject: help_[pcp_combine] Error 2
From: 吳小榆
Time: Thu Dec 29 01:01:14 2011

Dear sir,

When I compiled the METv3.0.1 to get the error message about
pb2nc.cc,I
guessed BUFRLIB maybe something wrong, but I didn't know how to fix
it. The
setting and error messages please see attached files, could you please
give
me hints to resolve this? Thank you very much and Happy New Year!

Kate

------------------------------------------------
Subject: Re: [rt.rap.ucar.edu #52194]help_pb2nc.cc_error
From: Paul Oldenburg
Time: Thu Dec 29 08:52:22 2011

Kate,

We are not sure what exactly is causing your problem.  It might help
if you do not use f2c when you are compiling MET.
This can be done by setting the F2C settings in the MET Makefile to
empty strings:

F2C_BASE     =
F2C_INCS     =
F2C_LIBS     =
F2C_LIBNAME  =

Then, do a make clean and rebuild MET from the base directory.

If that does not work, you can disable the building of the pb2nc tool
by setting the following Makefile flag:

DISABLE_PB2NC         = 1

This will not fix your problem, but at least you should be able to
build the rest of the MET tools to use observation
types other than PrepBUFR.  Please let me know if you have any
questions.

Thanks,

Paul


On 12/29/2011 01:01 AM, 吳小榆 via RT wrote:
>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=52194 >
>
> Dear sir,
>
> When I compiled the METv3.0.1 to get the error message about
pb2nc.cc,I
> guessed BUFRLIB maybe something wrong, but I didn't know how to fix
it. The
> setting and error messages please see attached files, could you
please give
> me hints to resolve this? Thank you very much and Happy New Year!
>
> Kate


------------------------------------------------


More information about the Met_help mailing list