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

Re: 19981124: Installing NetCDF under SOlaris



>To: address@hidden
>From: Erik Ivins <address@hidden>
>Subject: netCDF 3.4 on a sun4u sparc SUNW Ultra 30
>Organization: .
>Keywords: 199811242054.NAA00395

Hi Erik,

> I am attempting to compile version 3.4 of your
> free-ware netcdf package (ultimately to compile, link
> and use GMT 3.0).  I have a new Sun Ultra30 (Creator)
> I am running Sun WorkShop for Solaris 2.X (University
> Edition).   I am told that this corresponds to
> architecture corresponds to the "sun4u sparc SUNW"
> recommended setups for the setenv variables.

I think the problem is that you are using the wrong syntax to set your
environment variables.  Unfortunately csh (the shell you are using)
provides no indication that you are using a mixture of sh and csh
syntax for setting the environment variables.

The INSTALL file also doesn't give detailed instructions for how to
set environment variables.  (We intend to fix this problem in the next
version, since we are getting more questions about how to set
environment variables.)

How you set an environment variable on a Unix system depends on which
shell you are using.  You can usually tell which shell you are using
by invoking the command "echo $SHELL".  If you are using a shell such
as "csh" or "tcsh" to interact with the system, environment variables
are set with the "setenv" command, for example:

  % setenv CC /opt/SUNWspro/bin/c89
  % setenv CPPFLAGS ""
  % setenv CFLAGS "-O"
  % setenv FC /opt/SUNWspro/bin/f77
  % setenv FFLAGS "-O -erroff=WDECL_LOCAL_NOTUSED"
  % setenv CXX /opt/SUNWspro/bin/CC

(Note there are no "=" characters used with this syntax.  But if you
 invoke something like 
   % setenv CFLAGS=-O
 instead of
   % setenv CFLAGS "-O"
 the csh program will unhelpfully set the value of a new environment
 variable with the name "CFLAGS=-O", instead of reporting an error!)

If you are using ksh, sh, or bash, use the "export" statement instead
to set environment variables, for example:

  $ export CC=/opt/SUNWspro/bin/c89
  $ export CPPFLAGS=
  $ export CFLAGS=-O
  $ export FC=/opt/SUNWspro/bin/f77
  $ export FFLAGS="-O -erroff=WDECL_LOCAL_NOTUSED"
  $ export CXX=/opt/SUNWspro/bin/CC

In either case, after setting the environment variables you want, you
should start over with building netcdf, such as the following:

  % make distclean    # don't worry if this produces an error message
  % rm config.cache   # necessary if you have run the configure script here 
before
  % ./configure       # run the script, maybe use --prefix=wherever to tell
                      # where it will be installed, as described in INSTALL
  % make all
  % make test
  % make install

> I have tried each of these and none work.
> I am using a download from Nov. 23 1998, with the
> INSTALL instructions.  (IMPORTANT: I do note
> that netCDF 3.4 is "not tested").

It has been tested and works on Solaris 2.x platforms.

> All my attempts to compile have failed and I am seeking
> your advice.
> 
> I have been at it for an emarrasingly long time.
> 
> I have documented the attempts and errors messages
> in the attachments included with this mail.
> The file exa.cs shows the various options that I have used
> in my .cshrc file.  I also attach the last config.log file
> that documnets typical errors.  DO YOU HAVE ANY
> RECOMMENDATIONS FOR VERSION 3.4 AVAILABLE ?
 ...

#
# option no. 1 for SunOS laraine 5.6 from the INSTALL guide for netCDF 3.4
# installation (see bottom page 9, top page 10 of my
#  Nov. 17 listing of INSTALL)
#
#setenv CC /opt/SUNWspro/SC4.2/bin/c89 
#setenv CPPFLAGS=
#setenv CFLAGS=-g
#setenv FC /opt/SUNWspro/SC4.2/bin/f77
#setenv FFLAGS="-g -erroff=WDECL_LOCAL_NOTUSED"
#setenv CXX /opt/SUNWspro/SC4.2/bin/CC
#
# end of option  no. 1. (doesn't work!)

Just leave out the "=" characters in the above and it should work
fine.  Also, you don't have to set environment variables in your
.cshrc file.  You can just set them interactively before invoking the
configure script.  The other options you tried may also work with this
change ...

Please let us know if there are still problems.

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu