[Met_help] [rt.rap.ucar.edu #55540] History for cannot successfully compile pb2nc tool

Paul Oldenburg via RT met_help at ucar.edu
Thu Apr 5 12:17:11 MDT 2012


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

Hello,

I got errors when compiling METv3.1, saying ' /usr/bin/ld: cannot find
-lgfortran', details of which are as follows ( the attachment is the
usr_defs.mk file):

cd pb2nc            ; /usr/bin/make

/usr/bin/g++ pb2nc_Conf.cc -Wall -Wshadow -static  -c
-I/nfs/user03/xzhu/METv3.1/include -I~/gls/gsl-1.9/include
-I/nfs/user03/xzhu/netcdf/include

/usr/bin/gfortran numpbmsg.f -Wall -Wshadow -static -ff2c  -c

/usr/bin/gfortran openpb.f -Wall -Wshadow -static -ff2c  -c

/usr/bin/gfortran closepb.f -Wall -Wshadow -static -ff2c  -c

/usr/bin/gfortran readpb.f -Wall -Wshadow -static -ff2c  -c

/usr/bin/gfortran dumppb.f -Wall -Wshadow -static -ff2c  -c
/usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o closepb.o
readpb.o dumppb.o \
    -Wall -Wshadow -static  -DMET_BASE=\"/nfs/user03/xzhu/METv3.1\" \
    -I/nfs/user03/xzhu/METv3.1/include -I/nfs/user03/xzhu/netcdf/include
-I~/gls/gsl-1.9/include -I/nfs/user03/xzhu/BUFRLIB  \
    -L/nfs/user03/xzhu/METv3.1/lib -L/nfs/user03/xzhu/netcdf/lib
-L~/gls/gsl-1.9/lib -L/nfs/user03/xzhu/BUFRLIB  \
    -lvx_shapedata \
    -lvx_analysis_util \
    -lvx_data2d_factory \
    -lvx_data2d_grib \
    -lvx_data2d_nc_met \
    -lvx_data2d_nc_pinterp \
    -lvx_nc_util \
    -lvx_data2d \
    -lvx_render \
    -lvx_plot_util \
    -lvx_pxm \
    -lvx_color \
    -lvx_ps \
    -lvx_afm \
    -lvx_pb_util \
    -lvx_nav \
    -lvx_gnomon \
    -lvx_stat_out \
    -lvx_statistics \
    -lvx_gsl_prob \
    -lvx_econfig \
    -lvx_pb_util \
    -lvx_grid \
    -lvx_util \
    -lvx_math \
    -lvx_cal \
    -lvx_log \
    -lm -lnetcdf_c++ -lnetcdf -lgsl -lbufr \
      -lgfortran
/usr/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status
make[4]: *** [pb2nc] Error 1
make[3]: *** [all] Error 2
make[2]: *** [all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2

Looking forward to your reply.

Thanks a lot and best wishes!

Xiaoxi Zhu
Stony Brook University


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

Subject: Re: [rt.rap.ucar.edu #55540] cannot successfully compile pb2nc tool
From: Paul Oldenburg
Time: Wed Mar 28 13:08:05 2012

Xiaoxi,

The important part of the error message is the linker complaining that
it cannot find the library libgfortran.a:

/usr/bin/ld: cannot find -lgfortran

Once you find this library on your system, please include the folder
with that library in it in the user_defs.mk file
like this:

CXX_LIBS=-L{folder_containing_libgfortran}

For example, on my system, I found the libgfortran library like this:

$ find /usr -name 'libgfortran.a' 2>/dev/null
/usr/lib/gcc/x86_64-linux-gnu/4.4/libgfortran.a

Then, I would add this to my user_defs.mk:

CXX_LIBS=-L/usr/lib/gcc/x86_64-linux-gnu/4.4

If you have any other questions, please let me know.

Thanks,

Paul


On 03/28/2012 12:51 PM, Xiaoxi Zhu via RT wrote:
>
> Wed Mar 28 12:51:13 2012: Request 55540 was acted upon.
> Transaction: Ticket created by xiaoxizhu.thu at gmail.com
>         Queue: met_help
>       Subject: cannot successfully compile pb2nc tool
>         Owner: Nobody
>    Requestors: xiaoxizhu.thu at gmail.com
>        Status: new
>   Ticket<URL:
https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=55540>
>
>
> Hello,
>
> I got errors when compiling METv3.1, saying ' /usr/bin/ld: cannot
find
> -lgfortran', details of which are as follows ( the attachment is the
> usr_defs.mk file):
>
> cd pb2nc            ; /usr/bin/make
>
> /usr/bin/g++ pb2nc_Conf.cc -Wall -Wshadow -static  -c
> -I/nfs/user03/xzhu/METv3.1/include -I~/gls/gsl-1.9/include
> -I/nfs/user03/xzhu/netcdf/include
>
> /usr/bin/gfortran numpbmsg.f -Wall -Wshadow -static -ff2c  -c
>
> /usr/bin/gfortran openpb.f -Wall -Wshadow -static -ff2c  -c
>
> /usr/bin/gfortran closepb.f -Wall -Wshadow -static -ff2c  -c
>
> /usr/bin/gfortran readpb.f -Wall -Wshadow -static -ff2c  -c
>
> /usr/bin/gfortran dumppb.f -Wall -Wshadow -static -ff2c  -c
> /usr/bin/g++ -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o
closepb.o
> readpb.o dumppb.o \
>      -Wall -Wshadow -static  -DMET_BASE=\"/nfs/user03/xzhu/METv3.1\"
\
>      -I/nfs/user03/xzhu/METv3.1/include
-I/nfs/user03/xzhu/netcdf/include
> -I~/gls/gsl-1.9/include -I/nfs/user03/xzhu/BUFRLIB  \
>      -L/nfs/user03/xzhu/METv3.1/lib -L/nfs/user03/xzhu/netcdf/lib
> -L~/gls/gsl-1.9/lib -L/nfs/user03/xzhu/BUFRLIB  \
>      -lvx_shapedata \
>      -lvx_analysis_util \
>      -lvx_data2d_factory \
>      -lvx_data2d_grib \
>      -lvx_data2d_nc_met \
>      -lvx_data2d_nc_pinterp \
>      -lvx_nc_util \
>      -lvx_data2d \
>      -lvx_render \
>      -lvx_plot_util \
>      -lvx_pxm \
>      -lvx_color \
>      -lvx_ps \
>      -lvx_afm \
>      -lvx_pb_util \
>      -lvx_nav \
>      -lvx_gnomon \
>      -lvx_stat_out \
>      -lvx_statistics \
>      -lvx_gsl_prob \
>      -lvx_econfig \
>      -lvx_pb_util \
>      -lvx_grid \
>      -lvx_util \
>      -lvx_math \
>      -lvx_cal \
>      -lvx_log \
>      -lm -lnetcdf_c++ -lnetcdf -lgsl -lbufr \
>        -lgfortran
> /usr/bin/ld: cannot find -lgfortran
> collect2: ld returned 1 exit status
> make[4]: *** [pb2nc] Error 1
> make[3]: *** [all] Error 2
> make[2]: *** [all] Error 2
> make[1]: *** [all] Error 2
> make: *** [all] Error 2
>
> Looking forward to your reply.
>
> Thanks a lot and best wishes!
>
> Xiaoxi Zhu
> Stony Brook University


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


More information about the Met_help mailing list