[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20030207: Compile ldm-mcidas-7.8.0 on a RedHat Linux 8.0 i386 machine (cont.)



>From: Eirh-Yu Hsie <address@hidden>
>Organization: Aeronomy Laboratory/NOAA
>Keywords: 200302071859.h17IxF602516 ldm-mcidas RedHat 8.0

Hsie,

>I get the new source code (version 2002b).  But I still get the same 
>error messages:
>
>...
>...
>gcc -c -O -I//home/mcidas/mcidas7.8/src -I/home/ldm/include -I../libpng 
>-I../zlib -I../port/misc -I../port/cfortran -I/usr/local/include  cdftomd.c
>cc1: warning: changing search order for system directory 
>"/usr/local/include"
>cc1: warning:   as it has already been specified as a non-system directory
>+ gcc -O cdftomd.o -L/home/ldm/lib -lldm -L/usr/X11R6/lib -lX11 
>../port/misc/libudport.a -L/usr/local/lib -lnetcdf -L../libpng -lpng 
>-L../zlib -lz -lm -o cdftomd
>/usr/local/lib/libnetcdf.a(putget.o): In function `nc_put_vara_text':
>putget.o(.text+0x955a): undefined reference to `__builtin_alloca'
>putget.o(.text+0x9572): undefined reference to `__builtin_alloca'
>/usr/local/lib/libnetcdf.a(putget.o): In function `nc_put_vara_uchar':
>putget.o(.text+0x986a): undefined reference to `__builtin_alloca'
>putget.o(.text+0x9882): undefined reference to `__builtin_alloca'
>/usr/local/lib/libnetcdf.a(putget.o): In function `nc_put_vara_schar':
>putget.o(.text+0x9b7a): undefined reference to `__builtin_alloca'
>/usr/local/lib/libnetcdf.a(putget.o)(.text+0x9b92): more undefined 
>references to `__builtin_alloca' follow
>collect2: ld returned 1 exit status
>+ rm -f cdftomd
>+ exit 1
>make[2]: *** [cdftomd] Error 1
>make[2]: Leaving directory `/home/ldm/ldm-mcidas-2002b/src/decode'
>make[1]: *** [decode/all] Error 1
>make[1]: Leaving directory `/home/ldm/ldm-mcidas-2002b/src'
>+ set +x

Since the errors you are seeing are in the netcdf library, and since
you are using a version you built locally (usr/local/lib/libnetcdf.a),
you are potentially running into problems that will be very difficult
to figure out.

Since you have to link against the McIDAS library to build ldm-mcidas
from source, and since netCDF 3.5.0 gets built with McIDAS, I recommend
that you use the netCDF stuff (libnetcdf.a and netcdf.h include file)
in the McIDAS distribution.  To do this, you will need to:

1) run 'make distclean' from the top level directory where you are
   attempting to build ldm-mcidas v2002b

2) define environment variables that will tell configure where to
   look for the version of the netCDF bundled with McIDAS.  These
   environment variables will depend on the set of compilers you
   built McIDAS with.  The choices on Linux are gcc/mcfc/f2c or
   gcc/g77.  If you built McIDAS using the gcc/g77 combination,
   the environment variable settings you would use are:

# Defines needed for netCDF build using gcc/g77
setenv CC gcc
setenv CPPFLAGS "-DNDEBUG -Df2cFortran"
setenv CFLAGS -O
setenv FC g77
setenv FFLAGS "-O -Wuninitialized -fno-automatic"
setenv CPP_MCIDAS '-I/home/mcidas/inc'
setenv LD_MCIDAS  '-L/home/mcidas/lib -lmcidas'
setenv CXX

This assumes that you installed McIDAS in /home/mcidas.  If your
installation is different (and I believe yours is), you will need to
adjust CPP_MCIDAS and LD_MCIDAS.

Next, the netCDF stuff.  Again, if you installed McIDAS in /home/mcidas,
the environment variables needed for the netCDF would look like:

setenv CPP_NETCDF -I/home/mcidas/include
setenv LD_NETCDF  '-L/home/mcidas/lib -lnetcdf'

Again, you may have to adjust these to match your McIDAS installation.

You will also have to specify CPP_LDM and LD_LDM to locate the LDM
include and library files, respectively.  The settings for these
environment variables will depend on how you installed the LDM on your
machine.  If you installed in /usr/local/ldm, then the settings would
look like:

setenv CPP_LDM    -I/usr/local/ldm/include
setenv LD_LDM     '-L/usr/local/ldm/lib -lldm'

Lastly, you may have to define LD_X11.  I use:

setenv LD_X11     '-L/usr/X11R6/lib -lX11'


After these are defined correctly in your enviornment, you need to
rerun configure.  Note that you must do the 'make distclean' like I
said above before you can rerun configure.  If you don't run 'make
distclean', configure will used cached values for the environment
variable settings I list above.

So, run:

./configure
make
make test

At this point, you should have working ldm-mcidas v2002b executables.

Or, you could simply download the binary distribution of ldm-mcidas
that I make available.  The direct FTP location of the distribution for
RedHat 8.0 Linux is:

<login as 'ldm'>
cd ~ldm
ftp ftp.unidata.ucar.edu
  <user> anonymous
  <pass> address@hidden
  cd pub/binary/linux8_2.4-i686
  binary
  get ldm-mcidas-2002b.tar.Z
  quit
tar xvzf ldm-mcidas-2002b.tar.Z
cd ldm-mcidas-2002b/bin
<copy the ldm-mcidas decoders you are using to the directory you are using
them from>

As a last note, I am just about to release an addendum for McIDAS v2002
that contains bug fixes for the McIDAS-XCD data monitor DMSYN.  The
mods fix a problem first noted on RedHat 8.0 Linux where dmsyn.k will
chew up all available CPU.  The bug fixes can only be used with McIDAS
v2002, so if you are still running McIDAS 7.8x, you may well have
problems that can only be fixed by upgrading your version of McIDAS.

Tom