[Met_help] Error in Bulding PB2NC
John Halley Gotway
johnhg at rap.ucar.edu
Wed Jan 14 10:22:41 MST 2009
Hello,
Thanks for re-registering, and sorry for the delay in getting back to you. Good news... I was able to get MET to compile using icc/ifort, and the problem you're seeing has a pretty simple fix. Let
me tell you about 2 things...
(1) When compiling BUFRLIB, you should name the library archive file "libbufr.a". You're using the following commands to build BUFRLIB:
> icc -c -O2 -DUNDERSCORE *.c
> ifort -c -O2 -assume no2underscore *.f
> ar crv buflib.a *.o
But that last line is wrong. You should replace that last line with the following: ar crv libbufr.a
(2) When building MET with ifort/icc, you'll need to link to the "ifcore" library to fix the undefined reference errors you're seeing. So in the top-level MET Makefile, set the FC_LIBS line to:
FC_LIBS = -lifcore
This tells the linker to link in the library archive file named "libifcore.a" which contains definitions for all those undefined references. And next try recompiling MET with a "make clean" followed
by a "make".
If MET builds, then great. But if you still see errors you may need to tell the linker where to find that file "libifcore.a". To do so, you'll need to locate that file "libifcore.a" on your system
and then edit the FC_LIBS line in the top-level MET Makefile as follows:
FC_LIBS = -L/directory/containing/the/file/libifcore.a -lifcore (where you'll substitute in the actual directory path on your machine containing libifcore.a)
And hopefully that'll do it.
After you successfully compile MET, be sure to go into the scripts directory and run the "test_all.sh" test script. You may need to perform Fortran blocking on the sample PREPBUFR data provided with
MET. You can find a discussion of how to do that here: http://www.dtcenter.org/met/users/support/online_tutorial/pb2nc/index.php
That page is part of an online tutorial available for MET at: http://www.dtcenter.org/met/users/support/online_tutorial.
Good luck and let me know if you continue to experience problems.
Thanks,
John Halley Gotway
johnhg at ucar.edu
mmkader wrote:
> Dear Sir,
> I am compiling METV1.1 using Intel FORTRAN compiler V10.1 on 32bit machine. all modules were built and run successfully including GSL, F2c. One only module (PB2NC) were not built due to missing links with buflib library. The following show how i built the bufrlib
>
> icc -c -O2 -DUNDERSCORE *.c
> ifort -c -O2 -assume no2underscore *.f
> ar crv buflib.a *.o
>
> Part of the error in linking PB2NC with buflib is shown:
>
>
>
>
> icc -o pb2nc pb2nc.cc pb2nc_Conf.o numpbmsg.o openpb.o readpb.o dumppb.o \
> -Bstatic -DMET_BASE=\"/home/mat/WRF_MODEL/POSTPROCESS/METv1.1\" \
> -I../../lib -I/home/mat/LIBRARIES/NETCDF-intel/include
> -I/home/mat/LIBRARIES/GSL-1.9-intel/include -I/home/mat/LIBRARIES/BUFLIB-intel
> \
> -L../../lib -L/home/mat/LIBRARIES/NETCDF-intel/lib
> -L/home/mat/LIBRARIES/GSL-1.9-intel/lib -L/home/mat/LIBRARIES/BUFLIB-intel \
> -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 \
> -lbufr -lf2c -lrt -lpthread
> openpb.o: In function `openpb_':
> openpb.f:(.text+0x57): undefined reference to `for_open'
> dumppb.o: In function `dumppb_':
> dumppb.f:(.text+0x145): undefined reference to `for_concat'
> dumppb.f:(.text+0x196): undefined reference to `for_open'
> dumppb.f:(.text+0x236): undefined reference to `for_open'
> dumppb.f:(.text+0x40a): undefined reference to `for_write_seq_fmt'
> dumppb.f:(.text+0x4cd): undefined reference to `for_write_seq_fmt'
> dumppb.f:(.text+0x50a): undefined reference to `for_write_seq_fmt'
> dumppb.f:(.text+0x53f): undefined reference to `for_write_seq_fmt_xmit'
> dumppb.f:(.text+0x574): undefined reference to `for_write_seq_fmt_xmit'
> dumppb.f:(.text+0x5a9): undefined reference to `for_write_seq_fmt_xmit'
> dumppb.f:(.text+0x5de): undefined reference to `for_write_seq_fmt_xmit'
> dumppb.f:(.text+0x613): undefined reference to `for_write_seq_fmt_xmit'
> dumppb.o:dumppb.f:(.text+0x648): more undefined references to
> `for_write_seq_fmt_xmit' follow
> dumppb.o: In function `dumppb_':
> dumppb.f:(.text+0x6af): undefined reference to `for_write_seq_fmt'
> dumppb.f:(.text+0x774): undefined reference to `for_write_int_fmt'
> dumppb.f:(.text+0x7b5): undefined reference to `for_write_int_fmt_xmit'
> dumppb.f:(.text+0x80b): undefined reference to `for_cpstr'
> dumppb.f:(.text+0x8d8): undefined reference to `for_close'
> dumppb.f:(.text+0x92a): undefined reference to `for_write_seq_fmt'
> dumppb.f:(.text+0x949): undefined reference to `for_stop_core'
> dumppb.o: In function `readpbdump_':
> dumppb.f:(.text+0x9ba): undefined reference to `for_cpystr'
> dumppb.f:(.text+0xb07): undefined reference to `for_cpstr'
>
>
>
>
>
> Could you please help me to find the error?
> Thank you very much for your support
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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