[Met_help] Problem compiling METv1.0
John Halley Gotway
johnhg at rap.ucar.edu
Mon Mar 31 14:45:17 MDT 2008
Thomas,
Here are a few thoughts...
Have you tried removing "-lgfortran" from the Makefile? It may be the case that it is not necessary on your system. We only recently upgraded to Debian release Etch on which the gfortran compiler is
available. I was really surprised that we had to supply the -lgfortran compiler option. So please try removing it.
I have attached the Makefile I used for building with gfortran as you requested, but it really doesn't look much different than yours.
Regarding 64-bit, I expect that you'll experience a run-time error from the BUFRLIB code. Everything should compile fine, but when the "pb2nc" tool calls the BUFRLIB routine to read the input
PrepBufr file, you'll likely encounter an error. This means that you won't be able to run the PB2NC tool at this time. We've been in touch with NCEP and requested that they make BUFRLIB compatible
with 64-bit machines, but they have not worked on it yet. However, you will still be able to run the PCP-Combine, Grid-Stat, MODE, VSDB-Analysis, and MODE-Analysis tools with no problem. The
Point-Stat tool would work as well, but currently you'd need the output of the PB2NC to serve as input to Point-Stat. In the next release, we're providing an ASCII2NC tool to remove the dependence on
BUFRLIB.
For the time being, let's make sure we can get MET to compile on your system. And then we can address the other issues that arise.
So please try removing -lgfortran, and let me know what you find.
If you continue having problems with the compilation of PB2NC, you could try skipping that compilation step, by commenting out (or deleting) the following line from the Makefile:
# @ cd $(PB2NC); make CPP_COMPILER=$(CPP_COMPILER) F77_COMPILER=$(F77_COMPILER) FLAGS="$(FLAGS)" PGI_LIBS="$(PGI_LIBS)" --no-print-directory
Thanks,
John
Thomas Schwitalla wrote:
> John Halley Gotway wrote:
>> Thomas,
>>
>> I apologize for the delay in getting back to you.
>>
>> When we released METv1.0, gfortran was not a supported compiler
>> option. However, since then, we've successfully built and tested MET
>> with gfortran.
>>
>> There are 3 minor changes you'll need to make to get METv1.0 to
>> compile with gfortran:
>> (1) Replace the file METv1.0/src/pb2nc/readpb.prm with the version of
>> that file attached to this message.
>> (2) Replace the file METv1.0/src/pb2nc/readpb.f with the version of
>> that file attached to this message.
>> (3) In your Makefile, add "-lgfortran" to the line for "F2C_LIBNAME".
>>
>> Then do a "make clean", followed by a "make >& make_met.log".
>>
>> Please let me know if that does the trick for you. If so, I'll post
>> these fixes to the known issues page on the MET website
>> (http://www.dtcenter.org/met/users/support/known_issues/METv1.0/METv1.0_known_issues.php).
>> We're currently working toward a release of METv1.1 which will include
>> these changes I've sent to you. So we shouldn't experience these
>> issues with gfortran in the future.
>>
>> Thanks and sorry again for the delay in getting back to you.
>>
>> John Halley-Gotway
>>
>> Thomas Schwitalla wrote:
>>> Dear MET-Team,
>>>
>>> I try to compile METv1.0 with the resolved issues at home using the
>>> gfortran (version 4.2.1) compiler.
>>> I get several warnings (as every time..) but also one error message
>>> (log-file is attached).
>>> Because I'm absolutely not familiar with C/C++, any help is highly
>>> appreciated.
>>>
>>>
>>> I'm using 64bit Ubuntu 7.10 and installed the f2c and GSL libraries
>>> with the package manager.
>>>
>>>
>>> Regards from Germany
>>> Thomas
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Met_help mailing list
>>> Met_help at mailman.ucar.edu
>>> http://mailman.ucar.edu/mailman/listinfo/met_help
>
>
> John,
>
> I put your modifications into the directory, but it's still not working :-(
> I finally get the message "/usr/bin/ld: cannot find -lgfortran", which
> confuses me a little bit, because gfortran is also installed via package
> manager :-\
> Can this be a problem of a 64bit system, because on the webpage it's
> mentioned, that there are several problems using 64bit?
> Can you send me your Makefile for using the gfortran compiler?
>
> I will answer your query and test it further as soon as possible, but
> this week it may take some time.
>
> Thomas
>
>
-------------- next part --------------
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
# ** Copyright UCAR (c) 1992 - 2005
# ** University Corporation for Atmospheric Research(UCAR)
# ** National Center for Atmospheric Research(NCAR)
# ** Research Applications Lab (RAL)
# ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA
# *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
###############################################################################
#
# Makefile for the Model Evaluation Tools Project
#
###############################################################################
#
###############################################################################
#
# Begin Variables to be modified before building
#
###############################################################################
# Path to the C++ Compiler
CPP_COMPILER = /usr/bin/g++
# Path to the Fortran-77 Compiler
F77_COMPILER = /usr/bin/gfortran
# Top level directory for the MET build
MET_BASE = /d1/johnhg/MET/METv1.0_gfortran
# Top level directory for the NetCDF library
NETCDF_BASE = /var/autofs/mnt/pd6/score/MET/MET_releases/external_libs/netcdf/netcdf-3.6.2_gfortran
# Directory within the NetCDF library containing the C/C++ header files:
# netcdf.hh
# Specified as: -I/your/include/path
NETCDF_INCS = -I$(NETCDF_BASE)/include
# Directories within the NetCDF library containing the C/C++ archive files:
# libnetcdf.a and libnetcdf_c++.a
# Specified as: -L/your/library/path
NETCDF_LIBS = -L$(NETCDF_BASE)/lib
# Top level directory for the BUFR library
BUFR_BASE = /var/autofs/mnt/pd6/score/MET/MET_releases/external_libs/bufrlib_gfortran
# Directory within the BUFR library containing header files
# Specified as: -I/your/include/path
BUFR_INCS = -I$(BUFR_BASE)
# Directory within the BUFR library containing the libbufr.a archive file
# Specified as: -L/your/library/path
BUFR_LIBS = -L$(BUFR_BASE)
# Directory containing the GNU Scientific Library header files
# (if they're not in a standard location)
# Specified as: -I/your/include/path
GSL_INCS =
# Directory containing the GNU Scientific Library archive file, libgsl.a
# (if it's not in a standard location)
# Specified as: -L/your/library/path
GSL_LIBS =
# Directory containing the F2C or G2C Library header files
# (if they're not in a standard location)
# Specified as: -I/your/include/path
F2C_INCS =
# Directory containing the F2C or G2C Library archive file,
# libf2c.a or libg2c.a (if it's not in a standard location)
# Specified as: -L/your/library/path
F2C_LIBS =
# Name of the Fortan to C Library to be used
# Specified as: -lf2c or -lg2c
F2C_LIBNAME = -lf2c -lgfortran
###############################################################################
#
# End Variables to be modified before building
#
###############################################################################
###############################################################################
#
# Export variables to be used by submakes
#
###############################################################################
export MET_BASE
export NETCDF_INCS
export NETCDF_LIBS
export BUFR_INCS
export BUFR_LIBS
export GSL_INCS
export GSL_LIBS
export F2C_INCS
export F2C_LIBS
export F2C_LIBNAME
###############################################################################
#
# End export variables to be used by submakes
#
###############################################################################
PGI_LIBS =
FLAGS = -g -Wall -Wshadow -static
FAKES = all clean libs targets
LIB_DIR = lib
INC_DIR = lib
SRC_DIR = src
VX_AFM = $(LIB_DIR)/vx_afm
VX_ANALYSIS_UTIL= $(LIB_DIR)/vx_analysis_util
VX_CAL = $(LIB_DIR)/vx_cal
VX_COLOR = $(LIB_DIR)/vx_color
VX_CONTABLE = $(LIB_DIR)/vx_contable
VX_DATA_GRIDS = $(LIB_DIR)/vx_data_grids
VX_ECONFIG = $(LIB_DIR)/vx_econfig
VX_GNOMON = $(LIB_DIR)/vx_gnomon
VX_GRIB_CLASSES = $(LIB_DIR)/vx_grib_classes
VX_GSL_PROB = $(LIB_DIR)/vx_gsl_prob
VX_MATH = $(LIB_DIR)/vx_math
VX_MET_UTIL = $(LIB_DIR)/vx_met_util
VX_NAV = $(LIB_DIR)/vx_nav
VX_PLOT_UTIL = $(LIB_DIR)/vx_plot_util
VX_PS = $(LIB_DIR)/vx_ps
VX_PXM = $(LIB_DIR)/vx_pxm
VX_RENDER = $(LIB_DIR)/vx_render
VX_UTIL = $(LIB_DIR)/vx_util
VX_WRFDATA = $(LIB_DIR)/vx_wrfdata
VX_WRFMODE = $(LIB_DIR)/vx_wrfmode
PCP_COMBINE = $(SRC_DIR)/pcp_combine
MODE = $(SRC_DIR)/mode
GRID_STAT = $(SRC_DIR)/grid_stat
PB2NC = $(SRC_DIR)/pb2nc
POINT_STAT = $(SRC_DIR)/point_stat
VSDB_ANALYSIS = $(SRC_DIR)/vsdb_analysis
MODE_ANALYSIS = $(SRC_DIR)/mode_analysis
all:
@ echo
@ echo "*** Making the Model Evaluation Tools Project ***"
@ echo
@ make libs --no-print-directory
@ make targets --no-print-directory
@ echo
@ echo "*** Finished Making the Model Evaluation Tools Project ***"
@ echo
libs:
@ cd $(VX_AFM); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_ANALYSIS_UTIL);make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_CAL); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_COLOR); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_CONTABLE); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_DATA_GRIDS); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_ECONFIG); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_GNOMON); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_GRIB_CLASSES); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_GSL_PROB); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_MATH); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_MET_UTIL); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_NAV); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_PLOT_UTIL); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_PS); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_PXM); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_RENDER); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_UTIL); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_WRFDATA); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VX_WRFMODE); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
targets:
@ cd $(PCP_COMBINE); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(MODE); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(GRID_STAT); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(PB2NC); make CPP_COMPILER=$(CPP_COMPILER) F77_COMPILER=$(F77_COMPILER) FLAGS="$(FLAGS)" PGI_LIBS="$(PGI_LIBS)" --no-print-directory
@ cd $(POINT_STAT); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(VSDB_ANALYSIS); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
@ cd $(MODE_ANALYSIS); make COMPILER=$(CPP_COMPILER) FLAGS="$(FLAGS)" --no-print-directory
clean:
@ cd $(VX_AFM); make clean --no-print-directory
@ cd $(VX_ANALYSIS_UTIL);make clean --no-print-directory
@ cd $(VX_CAL); make clean --no-print-directory
@ cd $(VX_COLOR); make clean --no-print-directory
@ cd $(VX_CONTABLE); make clean --no-print-directory
@ cd $(VX_DATA_GRIDS); make clean --no-print-directory
@ cd $(VX_ECONFIG); make clean --no-print-directory
@ cd $(VX_GNOMON); make clean --no-print-directory
@ cd $(VX_GRIB_CLASSES); make clean --no-print-directory
@ cd $(VX_GSL_PROB); make clean --no-print-directory
@ cd $(VX_MATH); make clean --no-print-directory
@ cd $(VX_MET_UTIL); make clean --no-print-directory
@ cd $(VX_NAV); make clean --no-print-directory
@ cd $(VX_PLOT_UTIL); make clean --no-print-directory
@ cd $(VX_PS); make clean --no-print-directory
@ cd $(VX_PXM); make clean --no-print-directory
@ cd $(VX_RENDER); make clean --no-print-directory
@ cd $(VX_UTIL); make clean --no-print-directory
@ cd $(VX_WRFDATA); make clean --no-print-directory
@ cd $(VX_WRFMODE); make clean --no-print-directory
@ cd $(PCP_COMBINE); make clean --no-print-directory
@ cd $(MODE); make clean --no-print-directory
@ cd $(GRID_STAT); make clean --no-print-directory
@ cd $(PB2NC); make clean --no-print-directory
@ cd $(POINT_STAT); make clean --no-print-directory
@ cd $(VSDB_ANALYSIS); make clean --no-print-directory
@ cd $(MODE_ANALYSIS); make clean --no-print-directory
rm -r -f *.a *.o junk temp core log c.ps a.out
.PHONY: $(FAKES)
More information about the Met_help
mailing list