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

Re: xdr routines in netcdf library



> Keywords: 199409152338.AA28544 SGI configure

Keith,

> About : 
> If you are on SGI/IRIX, the XDR libraries are accessed with "-lsun" on the
> link line.
> 
> Which file actually contains this link line? How do i change the command
> to include XDR in the library? The small letters "xdr" directory is in
> /netcdf-232pl2/xdr directory once i tar the original file i got from ucar.

The proper link line that needs "-lsun" gets put in all the Makefiles when
they are generated by "configure".  I just tried this from the netcdf-232pl2
distribution on an SGI running "IRIX Release 5.2 IP20", and everything just
worked without having to manually edit any link lines or Makefiles.  Perhaps
you aren't using the "configure" script to generate the Makefiles?

If you've already got the distribution, you should first type 

   make distclean

to start over, removing all the existing generated files, including
Makefiles and object files.  This should be equivalent to getting a new copy
of the compressed tar file and unpacking it.

Next, use the "configure" script from the top-level netCDF directory to
generate Makefiles.  You may need to specify a value for the "prefix" where
you want things installed later, if the default is not acceptable.  Here's
what I used when I was testing it:

    ./configure --prefix=/home/russ/build

This resulted in the following output:

    reading configuration customizations
    checking for type of operating system
    checking for cc
    checking for ar
    checking for ranlib
    checking for fill value usage
    setting the installation prefix
    checking for type of machine
    checking for which
    checking how to run the C preprocessor
    checking for f77
    checking for neqn
    ./configure: Can't find program `neqn'; setting to `cat'
    checking for tbl
    ./configure: Can't find program `tbl'; setting to `cat'
    checking for install
    checking for makeinfo
    checking endianess
    checking type of netlong
    checking for XDR header-file
    checking XDR library
    checking for function prototypes
    checking for working const
    checking for variadic function support
    checking for strerror
    checking for package version
    creating config.status
    creating Makefile
    creating xdr/Makefile
    creating libsrc/Makefile
    creating fortran/Makefile
    creating ncgen/Makefile
    creating ncdump/Makefile
    creating nctest/Makefile
    creating doc/Makefile
    creating port/Makefile
    creating port/master.mk
    creating libsrc/netcdf.h
    post processing makefile `Makefile'
    post processing makefile `xdr/Makefile'
    post processing makefile `libsrc/Makefile'
    post processing makefile `fortran/Makefile'
    post processing makefile `ncgen/Makefile'
    post processing makefile `ncdump/Makefile'
    post processing makefile `nctest/Makefile'
    post processing makefile `doc/Makefile'
    post processing makefile `port/Makefile'

If you get something different from invoking configure, please send it,
along with the config.status file that gets generated so we can try to
diagnose the problem.

Next, you should only have to invoke "make" with no arguments.  Following is
the output I got from 

    make

Notice the "-lsun" has been put in the Makefiles by the "configure" script
so that you shouldn't have to edit the Makefiles to get it there:

    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/port

            cc -c -I. -DNDEBUG -O uddummy.c
            ar rcuv libudport.a uddummy.o 
    a - uddummy.o
    s - creating archive symbol table. Wait...
    s - done

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/xdr


    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/libsrc

            cc -c   -DNDEBUG -O array.c
            cc -c   -DNDEBUG -O attr.c
            cc -c   -DNDEBUG -O cdf.c
            cc -c   -DNDEBUG -O dim.c
            cc -c   -DNDEBUG -O file.c
            cc -c   -DNDEBUG -O iarray.c
            cc -c   -DNDEBUG -O error.c
            cc -c   -DNDEBUG -O globdef.c
            cc -c   -DNDEBUG -O putget.c
            cc -c   -DNDEBUG -O putgetg.c
            cc -c   -DNDEBUG -O sharray.c
            cc -c   -DNDEBUG -O string.c
            cc -c   -DNDEBUG -O var.c
            cc -c   -DNDEBUG -O xdrposix.c
            ar rcuv libnetcdf.a array.o attr.o cdf.o dim.o file.o iarray.o 
error.o  globdef.o putget.o putgetg.o sharray.o string.o var.o  xdrposix.o
    a - array.o
    a - attr.o
    a - cdf.o
    a - dim.o
    a - file.o
    a - iarray.o
    a - error.o
    a - globdef.o
    a - putget.o
    a - putgetg.o
    a - sharray.o
    a - string.o
    a - var.o
    a - xdrposix.o
    s - creating archive symbol table. Wait...
    s - done

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/fortran

            ./fortc -L . -O irix common.inc > netcdf.inc
            ./fortc -L . -O irix jackets.src > jackets.c
            cc -c -I../libsrc -DNDEBUG -O jackets.c
            ar rcuv ../libsrc/libnetcdf.a jackets.o
    a - jackets.o
    s - creating archive symbol table. Wait...
    s - done

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/ncdump

            cc -c -I../libsrc -I../port -DNDEBUG -O ncdump.c
            cc -c -I../libsrc -I../port -DNDEBUG -O vardata.c
            cc -c -I../libsrc -I../port -DNDEBUG -O dumplib.c
    cc -O ncdump.o vardata.o dumplib.o ../libsrc/libnetcdf.a -lsun -lm -o ncdump

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/ncgen

            cc -c -I../libsrc -DNDEBUG -O main.c
            cc -c -I../libsrc -DNDEBUG -O generate.c
            cc -c -I../libsrc -DNDEBUG -O load.c
            lex ncgen.l
            mv lex.yy.c ncgenyy.c
            yacc -d ncgen.y
            mv y.tab.c ncgentab.c
            mv y.tab.h ncgentab.h
            cc -c -I../libsrc -DNDEBUG -O ncgentab.c
            cc -c -I../libsrc -DNDEBUG -O escapes.c
            cc -c -I../libsrc -DNDEBUG -O getfill.c
            cc -c -I../libsrc -DNDEBUG -O init.c
            cc -c -I../libsrc -DNDEBUG -O close.c
            cc -c -I../libsrc -DNDEBUG -O genlib.c
    cc -O main.o generate.o load.o ncgentab.o escapes.o getfill.o init.o 
close.o genlib.o ../libsrc/libnetcdf.a -lsun -o ncgen

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/nctest

            cc -c -I../libsrc -DNDEBUG -O varget.c
            cc -c -I../libsrc -DNDEBUG -O vargetg.c
            cc -c -I../libsrc -DNDEBUG -O varput.c
            cc -c -I../libsrc -DNDEBUG -O varputg.c
            cc -c -I../libsrc -DNDEBUG -O vardef.c
            cc -c -I../libsrc -DNDEBUG -O vartests.c
            cc -c -I../libsrc -DNDEBUG -O vputget.c
            cc -c -I../libsrc -DNDEBUG -O vputgetg.c
            cc -c -I../libsrc -DNDEBUG -O driver.c
            cc -c -I../libsrc -DNDEBUG -O cdftests.c
            cc -c -I../libsrc -DNDEBUG -O dimtests.c
            cc -c -I../libsrc -DNDEBUG -O rec.c
            cc -c -I../libsrc -DNDEBUG -O atttests.c
            cc -c -I../libsrc -DNDEBUG -O misctest.c
            cc -c -I../libsrc -DNDEBUG -O add.c
            cc -c -I../libsrc -DNDEBUG -O error.c
            cc -c -I../libsrc -DNDEBUG -O emalloc.c
            cc -c -I../libsrc -DNDEBUG -O val.c
            cc -c -I../libsrc -DNDEBUG -O slabs.c
    cc -O varget.o vargetg.o varput.o varputg.o vardef.o vartests.o vputget.o 
vputgetg.o driver.o cdftests.o dimtests.o rec.o atttests.o misctest.o add.o 
error.o emalloc.o val.o slabs.o ../libsrc/libnetcdf.a -lsun -o nctest

    returning to directory /a/zero/home/russ/build/netcdf-232pl3


    making `all' in directory /a/zero/home/russ/build/netcdf-232pl3/doc


    returning to directory /a/zero/home/russ/build/netcdf-232pl3

After this, if I invoke

    make test

All the tests succeed and show everything has been built satisfactorily.
Then you should only have to type 

    make install

to get things installed where you originally specified with the --prefix
argument to configure.

--
Russ Rew                                                UCAR Unidata Program
address@hidden                                          P.O. Box 3000
http://www.unidata.ucar.edu/                          Boulder, CO 80307-3000