[Met_help] building MET on Ubuntu 9.10

Cory Davis cory.davis at metservice.com
Sun Feb 7 18:49:57 MST 2010


Hi there,
I have had to make quite a few changes in order to compile MET v2.0 with 
all patches METv2.0_patches_20091223.tar.gz on my Ubuntu 9.10 machines.

These changes include adding
#include <cstdio>
to
./lib/vx_cal/time_strings.cc
./lib/vx_econfig/machine.cc
./lib/vx_met_util/stat_hdr_columns.cc
./lib/vx_util/ascii_table.cc
./lib/vx_util/concat_string.cc
./lib/vx_util/string_fxns.cc
./lib/vx_util/threshold.cc

this is in order to have sprintf, fopen and fclose defined.

Also, the use of the strrchr function in
./lib/vx_met_util/file_type.cc, and
./lib/vx_met_util/stat_columns.cc
is not quite right.  In C++ you are apprently allowed

const char * strrchr ( const char * str, int character );
       char * strrchr (       char * str, int character );

and NOT
char * strrchr ( const char * str, int character );

so to get around this I have done this
./lib/vx_met_util/file_type.cc:43
if((ptr = (char *) strrchr(filename, '.')) != NULL) {

and
./lib/vx_met_util/stat_columns.cc:

./lib/vx_met_util/file_type.cc
line 44: if((ptr = (char *) strrchr(filename, '.')) != NULL) {
const char * strrchr ( const char * str, int character );
       char * strrchr (       char * str, int character );

./lib/vx_met_util/stat_columns.cc:411
if((ptr = (char *) strrchr(col_name, '_')) != NULL) i = atoi(++ptr);

Cheers,
Cory


-- 
Dr. Cory Davis
Research Scientist
Science, R. and D.
Meteorological Service of New Zealand Limited
+64 4 4700705
PO Box 722
Wellington
New Zealand.


More information about the Met_help mailing list