[Met_help] problem compiling METv2
John Halley Gotway
johnhg at rap.ucar.edu
Thu Apr 9 11:22:30 MDT 2009
Joe,
I'm out of the office through Monday of next week. So I should be able to
provide more support at that time.
But I took a quick look this morning, and this seems a little odd. The
linker is complaining that it can't find the definition for a power
function called by one of the MET libraries that's supposed to be defined
in the standard math library. And what's really odd is that the other MET
tools actually are compiling WITHOUT this error - because they're linking
to the same MET library that the linker is complaining about.
My first guess is that when MET builds the other tools, the linker finds
the version of the standard math library that it needs. But when it tries
to build PB2NC, the linker finds an incompatible version. And a possible
reason for that is how the "F2C_LIBS" is set in your top-level Makefile.
Please try the following in your top-level Makefile:
- Empty out the lines for "F2C_INCS" and "F2C_LIBS"
- Leave F2C_LIBNAME set to "-lg2c"
I'm hoping the compiler can find the G2C library in a standard location.
And hopefully it'll find the correct version of the math library as well
and the linker will be happy.
Give that a shot and let me know how it goes. I should mention that you
will likely continue to have issues running PB2NC on a 64-bit machine
because of 64-bit compatibility issues with BUFRLIB. So please let me
know if BUFRLIB actually works for you.
Also, with the latest version of Debian (Lenny) we've switched over to
using the "gfortran" compiler. If it's available on your system, you
could do that as well. Then you don't need to set anything for F2C.
gfortran handles it all without having to link to that library.
Thanks,
John
> I'm compiling this on a Linux 64-bit cluster. I need PB2NC to compile,
> but its choking at:
>
> usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o
> readpb.o dumppb.o \
> -Wall -Wshadow -static -DMET_BASE=\"/mnt/tg0/projects/wrfruc/olson/
> METv2.0\" \
> -I../../lib -I/misc/whome/olson/netcdf-3.6.2/include -I/misc/whome/
> olson/gsl-1.11/include -I/tg0/projects/wrfruc/olson/BUFRLIB -I/usr/lib/
> gcc/x86_64-redhat-linux/3.4.6/include \
> -L../../lib -L/misc/whome/olson/netcdf-3.6.2/lib -L/misc/whome/olson/
> gsl-1.11/lib -L/tg0/projects/wrfruc/olson/BUFRLIB -L/usr/lib/gcc/
> x86_64-redhat-linux/3.4.6 \
> -lbufr -lvx_pb_util \
> -lvx_met_util -lvx_analysis_util -lvx_wrfdata -lvx_met_util \
> -lvx_contable -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 \
> -lg2c
> ../../lib/libvx_wrfdata.a(vx_wrfdata.o): In function `std::pow(double,
> int)':
> vx_wrfdata.cc:(.text._ZSt3powdi[std::pow(double, int)]+0x19):
> undefined reference to `__powidf2'
> collect2: ld returned 1 exit status
> make[3]: *** [pb2nc] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [targets] Error 2
> make: *** [all] Error 2
>
>
> I've attached my compile log and here is my configuration of the
> Makefile (I should note that these libraries worked for METv1.1):
>
> ###############################################################################
>
> # Path to GNU Make command
> MAKE = /usr/bin/make
>
> # Architecture flags
> ARCH_FLAGS = # -DBLOCK4
>
> # Path to the C++ Compiler
> # C++ compiler flags
> # Any additional required libraries
> CXX = /usr/bin/g++
> CXX_FLAGS = -Wall -Wshadow -static # -g -m32
> CXX_LIBS =
>
> # Path to the Fortran Compiler
> # Fortran compiler flags
> # Any additional required libraries
> FC = /usr/bin/g77
> FC_FLAGS = -Wall -Wshadow -static -ff2c # -g -m32
> FC_LIBS = # -lgfortran
>
> # Make print options
> PRINT_OPTS = --no-print-directory
>
> # Top level directory for the NetCDF library
> # NetCDF include directory specified as: -I/your/include/path
> # NetCDF library directory specified as: -L/your/library/path
> NETCDF_BASE = /misc/whome/olson/netcdf-3.6.2
> NETCDF_INCS = -I$(NETCDF_BASE)/include
> NETCDF_LIBS = -L$(NETCDF_BASE)/lib
>
> # Top level directory for BUFRLIB
> # BUFRLIB include directory specified as: -I/your/include/path
> # BUFRLIB library directory specified as: -L/your/library/path
> BUFR_BASE = /tg0/projects/wrfruc/olson/BUFRLIB
> BUFR_INCS = -I$(BUFR_BASE)
> BUFR_LIBS = -L$(BUFR_BASE)
>
> # Top level directory for the GNU Scientific Library (GSL) if it's not
> # installed in a standard location.
> # GSL include directory specified as: -I/your/include/path
> # GSL library directory specified as: -L/your/library/path
> GSL_BASE = /misc/whome/olson/gsl-1.11
> GSL_INCS = -I$(GSL_BASE)/include
> GSL_LIBS = -L$(GSL_BASE)/lib
>
> # Top level directory for the F2C or G2C Library if it's not installed
> in a
> # standard location.
> # F2C include directory specified as: -I/your/include/path
> # F2C library directory containing libf2c.a or libg2c.a and specified
> as:
> # -L/your/library/path
> # Name of the library to be used: -lf2c or -lg2c
> F2C_BASE =
> F2C_INCS = -I/usr/lib/gcc/x86_64-redhat-linux/3.4.6/include
> F2C_LIBS = -L/usr/lib/gcc/x86_64-redhat-linux/3.4.6
> F2C_LIBNAME = -lg2c
>
> # Optional flags to disable the compilation of MET tools
> # Specify a non-zero value to disable the compilation of the tool
> DISABLE_PCP_COMBINE = 0
> DISABLE_GEN_POLY_MASK = 0
> DISABLE_MODE = 0
> DISABLE_GRID_STAT = 0
> DISABLE_PB2NC = 0
> DISABLE_ASCII2NC = 0
> DISABLE_POINT_STAT = 0
> DISABLE_WAVELET_STAT = 0
> DISABLE_STAT_ANALYSIS = 0
> DISABLE_MODE_ANALYSIS = 0
>
> ###############################################################################
>
> thanks in advance,
> joe
>
> _______________________________________________
> Met_help mailing list
> Met_help at mailman.ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/met_help
>
More information about the Met_help
mailing list