[Met_help] [rt.rap.ucar.edu #45102] History for compile fail at pb2nc

RAL HelpDesk {for John Halley Gotway} met_help at ucar.edu
Fri Apr 8 11:34:23 MDT 2011


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

Hi,
I'm trying to compile METv3.0 and am getting confused.....
Initially I ran into a lot of 'undefined references' during the compiling of
pb2nc (if I commented out this option all the other tools built OK). I have
googled round and have eliminated some by linking libraries in the FC_LIBS.

The start of my Makefile looks like this:
       # 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    = -DUNDERSCORE -Wall -Wshadow -static # -g -m32
       CXX_LIBS     = -lm

       # Path to the Fortran Compiler
       # Fortran compiler flags
       # Any additional required libraries
       FC           = /usr/pgi/linux86/10.5/bin/pgf90
       FC_FLAGS     = -Bstatic  -DUNDERSCORE -Mnosecond_underscore # -g
       FC_LIBS      = -L/usr/pgi/linux86/10.5/lib -lgslcblas -lgcc_eh
-lpgf90rtl -lpgf90 -lpgc -lpgf90_rpm1 -lpgf902 -lpghpf -lpgftnrtl -lrt
-lpthread -lpgsse1 -lpgsse2

****************


When I compile it fails at....

*** Making pb2nc application ***

/usr/bin/g++ -c pb2nc_Conf.cc -DUNDERSCORE -Wall -Wshadow -static   \
    -I../../lib
/usr/pgi/linux86/10.5/bin/pgf90 -c numpbmsg.f -Bstatic  -DUNDERSCORE
-Mnosecond_underscore
/usr/pgi/linux86/10.5/bin/pgf90 -c openpb.f -Bstatic  -DUNDERSCORE
-Mnosecond_underscore
/usr/pgi/linux86/10.5/bin/pgf90 -c readpb.f -Bstatic  -DUNDERSCORE
-Mnosecond_underscore
/usr/pgi/linux86/10.5/bin/pgf90 -c dumppb.f -Bstatic  -DUNDERSCORE
-Mnosecond_underscore


/usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o readpb.o
dumppb.o \
    -DUNDERSCORE -Wall -Wshadow -static   -DMET_BASE=\"/home/met/METv3.0\" \
    -I../../lib -I/usr/local/netcdf-4.1.1_pgi/include
-I/home/met/BUFRLIB                 -I/usr/local/include  \
    -L../../lib -L/usr/local/netcdf-4.1.1_pgi/lib
-L/home/met/BUFRLIB                -L/usr/local/lib -lgslcblas   \
    -lbufr -lvx_pb_util \
    -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 \
     -lm   -L/usr/pgi/linux86/10.5/lib -lgslcblas -lgcc_eh -lpgf90rtl
-lpgf90 -lpgc -lpgf90_rpm1 -lpgf902 -lpghpf -lpgftnrtl -lrt -lpthread
-lpgsse1 -lpgsse2
/usr/pgi/linux86/10.5/lib/libpgf902.a(cnfg.o): In function
`__hpfio_scratch_name':
/proj/pgrel/extract/x86/2010/rte/f90/f90/lib-linux86/../src-fio/cnfg.c:114:
undefined reference to `__pgio_tempnam'
/usr/pgi/linux86/10.5/lib/libpgftnrtl.a(utils.o): In function
`__fio_swap_bytes':
/proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-linux86/../../port/fio/src/utils.c:467:
undefined reference to `__mth_i_klshift'
/proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-linux86/../../port/fio/src/utils.c:471:
undefined reference to `__mth_i_klshift'
/usr/pgi/linux86/10.5/lib/libpgftnrtl.a(cnfg.o): In function
`__fio_scratch_name':
/proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-linux86/../../port/fio/src/cnfg.c:84:
undefined reference to `__pgio_tempnam'
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

*****************************

But if I comment out -static
CXX_FLAGS    = -DUNDERSCORE -Wall -Wshadow #-static # -g -m32
It compiles. Then after I add /usr/local/lib and /usr/pgi/linux86/10.5/lib
to the LD_LIBRARY_PATH, the test script appears to run successfully.

What are the undefined references referring to, and should I compile with
-static option (what exactly does this mean for functionality?)

Thanks,
Jason


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

Subject: Re: [rt.rap.ucar.edu #45102] compile fail at pb2nc
From: John Halley Gotway
Time: Fri Mar 04 23:00:00 2011

Jason,

It appears that you're trying to compile MET using compilers from
different families.  You're using the GNU g++ compiler as the C++
compiler
and the PGI pgf90 compiler as the FORTRAN compiler.  Since you're
mixing
the families of compilers, I'm not surprised that you're seeing a
bunch of
undefined references.

You need to decide which you'd like to use - either the GNU compilers
or
the PGI compilers.  For GNU, you'd use the g++ and gfortan compilers.
For
PGI, you'd use the pgcc and pgf90 compilers.  Keep in mind that the
external libraries (NetCDF, GSL, and BUFRLIB), on which MET depends,
need
to be built with this same family of compilers as well.

Once you pick GNU or PGI, make a copy of the corresponding Makefile
and
configure it for your system.  You may find the compilation section of
the
MET online tutorial to be useful:
   http://www.dtcenter.org/met/users/support/online_tutorial/METv3.0/compilation/index.php

Two more things:
   - Please be sure to get and apply the latest set of patches from
the
MET website:
   http://www.dtcenter.org/met/users/support/known_issues/METv3.0/index.php
   - Also, we'll be doing a minor release of MET in next few weeks.
It'll
include mostly bugfixes plus some minor upgrades.  We'll send out an
email to all the registered MET users when it's available.

If you continue to have problems compiling MET, just let us know.
We're
happy to help.

Thanks,
John Halley Gotway
met_help at ucar.edu

>
> Fri Mar 04 18:56:59 2011: Request 45102 was acted upon.
> Transaction: Ticket created by marshj77 at gmail.com
>        Queue: met_help
>      Subject: compile fail at pb2nc
>        Owner: Nobody
>   Requestors: marshj77 at gmail.com
>       Status: new
>  Ticket <URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=45102 >
>
>
> Hi,
> I'm trying to compile METv3.0 and am getting confused.....
> Initially I ran into a lot of 'undefined references' during the
compiling
> of
> pb2nc (if I commented out this option all the other tools built OK).
I
> have
> googled round and have eliminated some by linking libraries in the
> FC_LIBS.
>
> The start of my Makefile looks like this:
>        # 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    = -DUNDERSCORE -Wall -Wshadow -static # -g -m32
>        CXX_LIBS     = -lm
>
>        # Path to the Fortran Compiler
>        # Fortran compiler flags
>        # Any additional required libraries
>        FC           = /usr/pgi/linux86/10.5/bin/pgf90
>        FC_FLAGS     = -Bstatic  -DUNDERSCORE -Mnosecond_underscore #
-g
>        FC_LIBS      = -L/usr/pgi/linux86/10.5/lib -lgslcblas
-lgcc_eh
> -lpgf90rtl -lpgf90 -lpgc -lpgf90_rpm1 -lpgf902 -lpghpf -lpgftnrtl
-lrt
> -lpthread -lpgsse1 -lpgsse2
>
> ****************
>
>
> When I compile it fails at....
>
> *** Making pb2nc application ***
>
> /usr/bin/g++ -c pb2nc_Conf.cc -DUNDERSCORE -Wall -Wshadow -static
\
>     -I../../lib
> /usr/pgi/linux86/10.5/bin/pgf90 -c numpbmsg.f -Bstatic  -DUNDERSCORE
> -Mnosecond_underscore
> /usr/pgi/linux86/10.5/bin/pgf90 -c openpb.f -Bstatic  -DUNDERSCORE
> -Mnosecond_underscore
> /usr/pgi/linux86/10.5/bin/pgf90 -c readpb.f -Bstatic  -DUNDERSCORE
> -Mnosecond_underscore
> /usr/pgi/linux86/10.5/bin/pgf90 -c dumppb.f -Bstatic  -DUNDERSCORE
> -Mnosecond_underscore
>
>
> /usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o
readpb.o
> dumppb.o \
>     -DUNDERSCORE -Wall -Wshadow -static
-DMET_BASE=\"/home/met/METv3.0\"
> \
>     -I../../lib -I/usr/local/netcdf-4.1.1_pgi/include
> -I/home/met/BUFRLIB                 -I/usr/local/include  \
>     -L../../lib -L/usr/local/netcdf-4.1.1_pgi/lib
> -L/home/met/BUFRLIB                -L/usr/local/lib -lgslcblas   \
>     -lbufr -lvx_pb_util \
>     -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 \
>      -lm   -L/usr/pgi/linux86/10.5/lib -lgslcblas -lgcc_eh
-lpgf90rtl
> -lpgf90 -lpgc -lpgf90_rpm1 -lpgf902 -lpghpf -lpgftnrtl -lrt
-lpthread
> -lpgsse1 -lpgsse2
> /usr/pgi/linux86/10.5/lib/libpgf902.a(cnfg.o): In function
> `__hpfio_scratch_name':
> /proj/pgrel/extract/x86/2010/rte/f90/f90/lib-linux86/../src-
fio/cnfg.c:114:
> undefined reference to `__pgio_tempnam'
> /usr/pgi/linux86/10.5/lib/libpgftnrtl.a(utils.o): In function
> `__fio_swap_bytes':
> /proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-
linux86/../../port/fio/src/utils.c:467:
> undefined reference to `__mth_i_klshift'
> /proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-
linux86/../../port/fio/src/utils.c:471:
> undefined reference to `__mth_i_klshift'
> /usr/pgi/linux86/10.5/lib/libpgftnrtl.a(cnfg.o): In function
> `__fio_scratch_name':
> /proj/pgrel/extract/x86/2010/rte/pgftn/x86/lib-
linux86/../../port/fio/src/cnfg.c:84:
> undefined reference to `__pgio_tempnam'
> 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
>
> *****************************
>
> But if I comment out -static
> CXX_FLAGS    = -DUNDERSCORE -Wall -Wshadow #-static # -g -m32
> It compiles. Then after I add /usr/local/lib and
/usr/pgi/linux86/10.5/lib
> to the LD_LIBRARY_PATH, the test script appears to run successfully.
>
> What are the undefined references referring to, and should I compile
with
> -static option (what exactly does this mean for functionality?)
>
> Thanks,
> Jason
>



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


More information about the Met_help mailing list