~ubuntu-branches/ubuntu/lucid/hdf-eos5/lucid

« back to all changes in this revision

Viewing changes to bin/tmp/hdfeos_env.ksh.tmp

  • Committer: Bazaar Package Importer
  • Author(s): Alastair McKinstry
  • Date: 2009-08-17 23:07:29 UTC
  • Revision ID: james.westby@ubuntu.com-20090817230729-gzbwp1ny01hv2nlk
Tags: upstream-5.1.12.dfsg.1
ImportĀ upstreamĀ versionĀ 5.1.12.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#-----------------------------------------------------------------------------
 
2
# file: 
 
3
#       hdfeos_env.ksh
 
4
#
 
5
# description:
 
6
#       This file defines environment variables used by HDFEOS5.
 
7
#       This version is for use under the Korn shell (ksh).
 
8
#
 
9
# usage:
 
10
#       This file should be called from your .profile file with the line:
 
11
#
 
12
#           . <HDFEOS5-home-dir>/bin/hdfeos_env.ksh
 
13
#       
 
14
#       where <HDFEOS5-home-dir> is the full path of the HDFEOS5 home directory.
 
15
#
 
16
# author:
 
17
#       Mike Sucher / A.R.C.
 
18
#       Guru Tej S. Khalsa / Applied Research Corporation
 
19
#       Abe Taaheri / Emergent Information Technologies, Inc.
 
20
#
 
21
# notes:
 
22
#       1) This file is compatible with the following platforms:
 
23
#          Sun, SGI, HP-9000, IBM RS-6000 and DEC Alpha.
 
24
#          It automatically figures out which platform you are on,
 
25
#          and sets environment variables accordingly.
 
26
#       2) This file defines a variable called hdfeos5_path which contains
 
27
#          all the directories likely to be needed on a given machine
 
28
#          type, including the HDFEOS5 bin directories.  Users 
 
29
#          may choose to set their path variable with:
 
30
#          
 
31
#                  PATH=<user-path-additions>:$hdfeos5_path
 
32
#                  export PATH
 
33
#
 
34
#          where <user-path-additions> is an optional list of other
 
35
#          directories added to the search path.
 
36
#
 
37
# history:
 
38
#       17-Jun-1996 MES  Initial version 
 
39
#       11-Apr-2001 AT   Modified for HDF5
 
40
 
41
#-----------------------------------------------------------------------------
 
42
 
 
43
: ${sgi_mode:=32}               # by default, SGI mode is standard 32-bit
 
44
 
 
45
: ${hdfeos5_f90_comp:=""}       # by default, no FORTRAN-90 compiler
 
46
 
 
47
: ${hdfeos5_nag_flag:=0}        # by default, not using NAG FORTRAN-90
 
48
 
 
49
: ${use_flavor:=0}              # by default, not using "flavor"
 
50
 
 
51
: ${opt_flag:=-O}               # by default, optimizing code
 
52
 
 
53
 
 
54
 
 
55
user_path=$PATH         # save user path
 
56
 
 
57
# set path to a base subset of directories, allowing startup on unknown host
 
58
# note: once the host has been determined the path is appropriately customized
 
59
 
 
60
PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/ucb:/usr/bin/X11
 
61
export PATH 
 
62
 
 
63
# get operating system type, login name
 
64
# special cases: SCO and Cray  - uname works differently,
 
65
 
 
66
MACHINE="`uname -m | awk '{print $1}'`" # needed on Cray & SCO
 
67
temp_ostype=`uname`
 
68
 
 
69
case "$MACHINE" in
 
70
 
 
71
    i386)                               # SCO box
 
72
        OSTYPE=sco386 
 
73
        ;;
 
74
 
 
75
    CRAY)                               # CRAY
 
76
        OSTYPE=UNICOS 
 
77
        ;;
 
78
 
 
79
    *)                                  # everybody else
 
80
        OSTYPE="`uname`"
 
81
        ;;
 
82
 
 
83
esac
 
84
         
 
85
CYGPL="`uname | awk -F_ '{print $1}'`"  
 
86
     
 
87
# Intel Macintosh is also i386 or i686 (?) machine
 
88
 
 
89
    if [ "$MACHINE" = "i386" ] ; then
 
90
        if [ "$temp_ostype" = "Darwin" ] ; then 
 
91
            OSTYPE=DarwinIntel
 
92
        fi
 
93
        if [ "$CYGPL" = "CYGWIN" ] ; then 
 
94
            OSTYPE=Cygwin
 
95
        fi
 
96
    fi
 
97
    if [ "$MACHINE" = "i686" ] ; then
 
98
        if [ "$temp_ostype" = "Darwin" ] ; then 
 
99
            OSTYPE=DarwinIntel
 
100
        fi
 
101
        if [ "$CYGPL" = "CYGWIN" ] ; then 
 
102
            OSTYPE=Cygwin
 
103
        fi
 
104
    fi
 
105
    if [ "`uname -m | awk '{print $1}'`" = "x86_64" ] || [ "`uname -m | awk '{print $1}'`" = "ia64" ] ; then
 
106
        if [ "$LINUX_BRAND" = "" ] ; then 
 
107
            echo " Error: In 64-bit linux platform the env. variable LINUX_BRAND must be set to linux32 or linux64 before running this script."
 
108
            exit 1
 
109
        fi
 
110
    fi
 
111
 
 
112
user=`id | cut -d\( -f2 | cut -d\) -f1`
 
113
LOGNAME=$user                           # make sure $LOGNAME is defined
 
114
USER=$LOGNAME                           # make sure $USER is defined
 
115
export USER LOGNAME
 
116
 
 
117
# set machine-dependent environment variables:
 
118
#       HOST   the host name of this machine
 
119
#       BRAND  used by other achitecture-specific code
 
120
#       PATH   the execution search path 
 
121
 
 
122
case "$OSTYPE" in
 
123
 
 
124
  AIX) 
 
125
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/ucb:/usr/bin/X11:/usr/sbin
 
126
    HOST="`hostname`"
 
127
    BRAND="ibm"
 
128
    ;;
 
129
 
 
130
  HP-UX) 
 
131
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/bin/X11
 
132
    HOST="`hostname`"
 
133
    BRAND="hp"
 
134
    ;;
 
135
 
 
136
  IRIX) 
 
137
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/bsd:/usr/sbin
 
138
    HOST="`hostname`"
 
139
    case $sgi_mode in
 
140
      64 ) BRAND=sgi64 ;;
 
141
      n32) BRAND=sgi32 ;;
 
142
      65 ) BRAND=irix65 ;;
 
143
      32 ) BRAND=sgi ;;
 
144
      *  ) BRAND=sgi ;;  # just in case
 
145
    esac
 
146
    ;;
 
147
 
 
148
  IRIX64) 
 
149
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/bsd:/usr/sbin
 
150
    HOST="`hostname`"
 
151
    case $sgi_mode in
 
152
      64 ) BRAND=sgi64 ;;
 
153
      n32) BRAND=sgi32 ;;
 
154
      65 ) BRAND=irix65 ;;
 
155
      32 ) BRAND=sgi ;;
 
156
      *  ) BRAND=sgi ;;  # just in case
 
157
    esac
 
158
    ;;
 
159
 
 
160
  Linux )
 
161
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/X11/bin
 
162
    HOST=`hostname`
 
163
    BRAND=linux
 
164
    if [ "$LINUX_BRAND" = "linux64" ] ; then
 
165
        BRAND=linux64
 
166
    elif [ "$LINUX_BRAND" = "linux32" ] ; then
 
167
        BRAND=linux32
 
168
    elif [ "$LINUX_BRAND" = "linux" ] ; then
 
169
        BRAND=linux
 
170
    fi
 
171
    ;;
 
172
 
 
173
  Darwin )
 
174
    PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
175
    HOST=`hostname`
 
176
    BRAND=macintosh
 
177
    ;;
 
178
 
 
179
  DarwinIntel )
 
180
    PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
181
    HOST=`hostname`
 
182
    BRAND=macintel
 
183
    ;;
 
184
 
 
185
  Cygwin)
 
186
    PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
187
    HOST="`hostname`"
 
188
    BRAND="cygwin"
 
189
    ;;
 
190
 
 
191
  OSF1) 
 
192
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/ucb:/usr/bin/X11:/usr/sbin
 
193
    HOST="`hostname -s`"
 
194
    BRAND="dec"
 
195
    ;;
 
196
 
 
197
  sco386) 
 
198
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/bin/X11
 
199
    HOST="`hostname -s`"
 
200
    BRAND="sco"
 
201
    ;;
 
202
 
 
203
  SunOS) 
 
204
    # distinguish between SunOS 5.5/5.8 and 4.x versions
 
205
    if [ `uname -r | awk -F. '{print $1}'` = "5" ] ; then 
 
206
       if [ `uname -r | awk -F. '{print $2}'` = "8" ] ; then 
 
207
        BRAND="sun5.8"                  # Solaris 8
 
208
       elif [ `uname -r | awk -F. '{print $2}'` = "9" ] ; then
 
209
        BRAND="sun5.9"                  # Solaris 9
 
210
       elif [ `uname -r | awk -F. '{print $2}'` = "10" ] ; then
 
211
        BRAND="sun5.10"                 # Solaris 10
 
212
       else
 
213
        BRAND="sun5"                    # release V5.5 SunOS
 
214
       fi
 
215
        PATH=/usr/local/bin:/opt/SUNWspro/bin:/bin:/usr/bin:/etc:/usr/etc:/usr/ucb:/usr/openwin/bin:/usr/openwin/demo:/usr/ccs/bin:/usr/sbin
 
216
    else                                
 
217
        BRAND="sun4"                    # release V4.x SunOS
 
218
        PATH=/usr/local/bin:/usr/local/lang:/usr/lang:/bin:/usr/bin:/etc:/usr/etc:/usr/ucb:/usr/openwin/demo
 
219
    fi
 
220
    HOST="`hostname`"
 
221
    ;;
 
222
 
 
223
  UNICOS) 
 
224
    PATH=/usr/local/bin:/bin:/usr/bin:/etc:/usr/bin/X11
 
225
    HOST="`hostname`"
 
226
    BRAND="cray"
 
227
    ;;
 
228
 
 
229
  *)    
 
230
    echo "Operating system: $OSTYPE not supported"
 
231
    echo "This release of HDFEOS5 supports: "
 
232
    echo "   Sun, SGI HP-9000 IBM-6000 DEC-Alpha and Cray/Unicos "
 
233
    ;;
 
234
 
 
235
esac
 
236
 
 
237
export PATH HOST BRAND
 
238
 
 
239
 
 
240
# set machine-dependent compilers and compilation switches:
 
241
#
 
242
#
 
243
 
 
244
NSL_FLAG=""                     # this is nil on all but Sun platforms
 
245
NSL_LIB=""                      # this is nil on all but Sun platforms
 
246
 
 
247
case "$BRAND" in
 
248
 
 
249
    cray)
 
250
        CC=cc                   # C compiler
 
251
        CFLAGS="$opt_flag -DH5_USE_16_API"      # default C flags (optimize, ansi)
 
252
        C_CFH="-DCRAYFortran"   # C/cfortran.h called from FORTRAN
 
253
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
254
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
255
        C_F77_LIB=""            # FORTRAN lib called by C main
 
256
        F77=cf77                # FORTRAN compiler
 
257
        F77FLAGS=""             # common FORTRAN flags
 
258
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
259
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
260
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
261
        F77_C_LIB=""            # C lib called by FORTRAN main 
 
262
        HDFSYS=UNICOS           # system type as defined by HDF5
 
263
        MACHINE=CRAY            # system type as defined by HDFEOS5
 
264
        ;;
 
265
 
 
266
    dec)
 
267
        CC=cc                   # C compiler
 
268
        CFLAGS="$opt_flag -std -DH5_USE_16_API" # default C flags (optimize, ansi)
 
269
        C_CFH="-DDECFortran"    # C w/ cfortran.h callable from FORTRAN
 
270
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
271
        C_F77_CFH="$C_CFH -Dmain=MAIN__" # calling FORTRAN
 
272
        C_F77_LIB=""            # FORTRAN lib called by C main
 
273
        F77=f77                 # FORTRAN compiler
 
274
        F77FLAGS=""             # common FORTRAN flags
 
275
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
276
        F77_C_CFH="$F77_CFH "   # calling C w/ cfortran.h
 
277
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
278
        F77_C_LIB=""            # C lib called by FORTRAN main
 
279
        HDFSYS=DEC_ALPHA        # system type as defined by HDF5
 
280
        MACHINE=DEC             # system type as defined by HDFEOS5
 
281
        ;;
 
282
 
 
283
    hp)
 
284
        CC=c89                  # C compiler
 
285
        CFLAGS="$opt_flag -Ae -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
286
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
287
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
288
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
289
        C_F77_LIB=""            # FORTRAN lib called by C main 
 
290
        F77=fort77              # FORTRAN compiler
 
291
        F77FLAGS=""             # common FORTRAN flags
 
292
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
293
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
294
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
295
        F77_C_LIB=""            # C lib called by FORTRAN main
 
296
        HDFSYS=HP9000           # system type as defined by HDF5
 
297
        MACHINE=HP              # system type as defined by HDFEOS5
 
298
        ;;
 
299
 
 
300
    ibm)
 
301
        CC=cc                   # C compiler
 
302
        CFLAGS="$opt_flag -qlanglvl=ansi -DH5_USE_16_API" # default C flags (optimize, ansi)
 
303
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
304
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
305
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
306
        C_F77_LIB=""            # FORTRAN lib called by C main  FORTAN
 
307
        F77=xlf                 # FORTRAN compiler
 
308
        F77FLAGS=""             # common FORTRAN flags
 
309
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
310
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
311
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
312
        F77_C_LIB=""            # C lib called by FORTRAN main
 
313
        HDFSYS=IBM6000          # system type as defined by HDF5
 
314
        MACHINE=IBM             # system type as defined by HDFEOS5
 
315
        ;;
 
316
 
 
317
    linux | linux32 | linux64)
 
318
        CC="gcc LNX_CMP_FLAG"   # C compiler
 
319
        CFLAGS="$opt_flag -ansi -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
320
        C_CFH="-Df2cFortran"    # C w/ cfortran.h callable from FORTRAN
 
321
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
322
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
323
        C_F77_LIB=""            # FORTRAN lib called by C main
 
324
        F77="g77 LNX_CMP_FLAG"  # FORTRAN compiler
 
325
        F77FLAGS=""             # common FORTRAN flags
 
326
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
327
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
328
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
329
        F77_C_LIB=""            # C lib called by FORTRAN main
 
330
        HDFSYS=LINUX            # system type as defined by HDF5
 
331
        if [ `/bin/uname -m` = "x86_64" ]; then
 
332
            if [ "$BRAND" = "linux32" ] || [ "$BRAND" = "linux" ] ; then
 
333
                HDFSYS=LINUX    # system type as defined by HDF
 
334
            else
 
335
                HDFSYS=LINUX64  # Only for 64 bit linux
 
336
            fi
 
337
        elif [ `/bin/uname -m` = "ia64" ]; then
 
338
            if [ "$BRAND" = "linux32" ] || [ "$BRAND" = "linux" ] ; then
 
339
                HDFSYS=LINUX    # system type as defined by HDF
 
340
            else
 
341
                HDFSYS=IA64     #Only for IA64
 
342
            fi
 
343
        else
 
344
           HDFSYS=LINUX         # system type as defined by HDF
 
345
        fi
 
346
 
 
347
        MACHINE=LINUX           # system type as defined by HDFEOS5
 
348
        ;;
 
349
 
 
350
    macintosh)
 
351
        CC=gcc                  # C compiler
 
352
        CFLAGS="$opt_flag -ansi -DH5_USE_16_API"        # default C flags (optimize, ansi)
 
353
        C_CFH="-Df2cFortran"    # C w/ cfortran.h callable from FORTRAN
 
354
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
355
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
356
        C_F77_LIB=""            # FORTRAN lib called by C main
 
357
        F77="g77"               # FORTRAN compiler
 
358
        F77FLAGS=""             # common FORTRAN flags
 
359
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
360
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
361
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
362
        F77_C_LIB=""            # C lib called by FORTRAN main
 
363
        HDFSYS=MACINTOSH        # system type as defined by HDF5
 
364
        MACHINE=MACINTOSH       # system type as defined by HDFEOS5
 
365
        ;;
 
366
 
 
367
    macintel)
 
368
        CC=gcc                  # C compiler
 
369
        CFLAGS="$opt_flag -ansi -DH5_USE_16_API"        # default C flags (optimize, ansi)
 
370
        C_CFH="-Df2cFortran"    # C w/ cfortran.h callable from FORTRAN
 
371
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
372
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
373
        C_F77_LIB=""            # FORTRAN lib called by C main
 
374
        F77="gfortran"          # FORTRAN compiler
 
375
        F77FLAGS=""             # common FORTRAN flags
 
376
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
377
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
378
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
379
        F77_C_LIB=""            # C lib called by FORTRAN main
 
380
        HDFSYS=MACINTEL         # system type as defined by HDF
 
381
        MACHINE=MACINTEL        # system type as defined by HDFEOS
 
382
        ;;
 
383
 
 
384
    cygwin)
 
385
        CC=gcc                          # C compiler
 
386
        CFLAGS="$opt_flag -ansi -DH5_USE_16_API"            # default C flags (optimize, ansi)
 
387
        C_CFH="-Df2cFortran"            # C w/ cfortran.h callable from FORTRAN
 
388
        CFHFLAGS="$CFLAGS $C_CFH"       # CFLAGS + C_CFH
 
389
        F77=g77
 
390
        F77FLAGS="$opt_flag -fno-second-underscore" # common FORTRAN flags
 
391
        F77_CFH="-fno-second-underscore"     # FORTRAN callable from C w/cfortran.h
 
392
        F77_C_CFH=""            # calling C w/ cfortran.h
 
393
        F77_C_LIB=""            # C lib called by FORTRAN main
 
394
        HDFSYS=CYGWIN           # system type as defined by HDF
 
395
        MACHINE=CYGWIN          # system type as defined by HDFEOS
 
396
        ;;
 
397
 
 
398
    sco)
 
399
        CC=cc                   # C compiler
 
400
        CFLAGS="$opt_flag -posix -DH5_USE_16_API"       # default C flags (optimize, ansi)
 
401
        C_CFH="-Df2cFortran"    # C w/ cfortran.h callable from FORTRAN
 
402
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
403
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
404
        C_F77_LIB=""            # FORTRAN lib called by C main
 
405
        F77=""                  # FORTRAN compiler
 
406
        F77FLAGS=""             # common FORTRAN flags
 
407
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
408
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
409
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
410
        F77_C_LIB=""            # C lib called by FORTRAN main
 
411
        HDFSYS=SCO              # system type as defined by HDF5
 
412
        MACHINE=SCO             # system type as defined by HDFEOS5
 
413
        ;;
 
414
 
 
415
    sgi)
 
416
        if [ $OSTYPE = "IRIX64" ]
 
417
        then
 
418
                CC="cc -32"     # C compiler (32 bit)
 
419
                F77="f77 -32"   # FORTRAN compiler (32 bit)
 
420
        else
 
421
                CC=cc           # C compiler
 
422
                F77=f77         # FORTRAN compiler
 
423
        fi
 
424
        CFLAGS="$opt_flag -xansi -D_POSIX_SOURCE -DH5_USE_16_API"       # default C flags (optimize, ansi)
 
425
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
426
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
427
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
428
        C_F77_LIB="-lI77 -lU77 -lF77" # FORTRAN lib called by C main
 
429
        F77FLAGS=""             # common FORTRAN flags
 
430
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
431
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
432
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
433
        F77_C_LIB=""            # C lib called by FORTRAN main
 
434
        HDFSYS=IRIS4            # system type as defined by HDF5
 
435
        MACHINE=SGI             # system type as defined by HDFEOS5
 
436
        ;;
 
437
 
 
438
    sgi32)
 
439
        CC="cc -n32"            # C compiler (new-style 32 bit)
 
440
        F77="f77 -n32"          # FORTRAN compiler (new-style 32 bit)
 
441
        CFLAGS="$opt_flag -xansi -D_POSIX_SOURCE -DH5_USE_16_API"       # default C flags (optimize, ansi)
 
442
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
443
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
444
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
445
        C_F77_LIB="-lI77 -lU77 -lF77" # FORTRAN lib called by C main
 
446
        F77FLAGS=""             # common FORTRAN flags
 
447
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
448
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
449
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
450
        F77_C_LIB=""            # C lib called by FORTRAN main
 
451
        HDFSYS=IRIS4            # system type as defined by HDF5
 
452
        MACHINE=SGI             # system type as defined by HDFEOS5
 
453
        ;;
 
454
 
 
455
   irix65)
 
456
        CC="cc -n32"            # C compiler (new-style 32 bit)
 
457
        F77="f77 -n32"          # FORTRAN compiler (new-style 32 bit)
 
458
        CFLAGS="$opt_flag -xansi -D_POSIX_SOURCE -DH5_USE_16_API"       # default C flags (optimize, ansi)
 
459
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
460
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
461
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
462
        C_F77_LIB="-lI77 -lU77 -lF77" # FORTRAN lib called by C main
 
463
        F77FLAGS=""             # common FORTRAN flags
 
464
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
465
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
466
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
467
        F77_C_LIB=""            # C lib called by FORTRAN main
 
468
        HDFSYS=IRIS4            # system type as defined by HDF5
 
469
        MACHINE=SGI             # system type as defined by HDFEOS5
 
470
        ;;
 
471
 
 
472
    sgi64)
 
473
        cpu_type=`hinv | fgrep CPU | head -1 | cut -d' ' -f3 | cut -b2`
 
474
        if [ "$cpu_type" = "4" ] ; then
 
475
            CC="cc -64 -mips3"  # C compiler (R4?00 chip)
 
476
            F77="f77 -64 -mips3"        # FORTRAN compiler (R4?00 chip)
 
477
        else
 
478
            CC="cc -64"         # C compiler
 
479
            F77="f77 -64"       # FORTRAN compiler
 
480
        fi
 
481
        CFLAGS="$opt_flag -xansi -D_POSIX_SOURCE -DH5_USE_16_API"       # default C flags (optimize, ansi)
 
482
        C_CFH=""                # C w/ cfortran.h callable from FORTRAN
 
483
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
484
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
485
        C_F77_LIB="-lI77 -lU77 -lF77" # FORTRAN lib called by C main
 
486
        F77FLAGS=""             # common FORTRAN flags
 
487
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
488
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
489
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
490
        F77_C_LIB=""            # C lib called by FORTRAN main
 
491
        HDFSYS=IRIS4            # system type as defined by HDF5
 
492
        MACHINE=SGI             # system type as defined by HDFEOS5
 
493
        ;;
 
494
 
 
495
    sun4)
 
496
        CC=acc                  # C compiler
 
497
        CFLAGS="$opt_flag -Xa -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
498
        C_CFH="-DsunFortran"    # C w/ cfortran.h callable from FORTRAN
 
499
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
500
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
501
        C_F77_LIB=""            # FORTRAN lib called by C main
 
502
        F77=f77                 # FORTRAN compiler
 
503
        F77FLAGS=""             # common FORTRAN flags
 
504
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
505
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
506
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
507
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
508
        HDFSYS=SUN              # system type as defined by HDF5
 
509
        MACHINE=SUN4            # system type as defined by HDFEOS5
 
510
        NSL_FLAG="-lnsl"        # this is nil on all but Sun platforms
 
511
        NSL_LIB="/usr/lib/libnsl.a" # this is nil on all but Sun platforms
 
512
        ;;
 
513
 
 
514
    sun5)
 
515
        CC=cc                   # C compiler
 
516
        CFLAGS="$opt_flag -Xa -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
517
        C_CFH="-DsunFortran"    # C w/ cfortran.h callable from FORTRAN
 
518
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
519
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
520
        C_F77_LIB=""            # FORTRAN lib called by C main
 
521
        F77=f77                 # FORTRAN compiler
 
522
        F77FLAGS=""             # common FORTRAN flags
 
523
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
524
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
525
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
526
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
527
        HDFSYS=SUN              # system type as defined by HDF5
 
528
        MACHINE=SUN5            # system type as defined by HDFEOS5
 
529
        NSL_FLAG="-lnsl"        # this is nil on all but Sun platforms
 
530
        NSL_LIB="/usr/lib/libnsl.a" # this is nil on all but Sun platforms
 
531
        ;;
 
532
 
 
533
    sun5.8)
 
534
        CC=cc                   # C compiler
 
535
        CFLAGS="$opt_flag -Xa -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
536
        C_CFH="-DsunFortran"    # C w/ cfortran.h callable from FORTRAN
 
537
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
538
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
539
        C_F77_LIB=""            # FORTRAN lib called by C main
 
540
        F77=f77                 # FORTRAN compiler
 
541
        F77FLAGS=""             # common FORTRAN flags
 
542
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
543
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
544
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
545
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
546
        HDFSYS=SUN              # system type as defined by HDF5
 
547
        MACHINE=SUN8            # system type as defined by HDFEOS5
 
548
        NSL_FLAG="-lnsl"        # this is nil on all but Sun platforms
 
549
        NSL_LIB="/usr/lib/libnsl.a" # this is nil on all but Sun platforms
 
550
        ;;
 
551
 
 
552
    sun5.9)
 
553
        CC=cc                   # C compiler
 
554
        CFLAGS="$opt_flag -Xa -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
555
        C_CFH="-DsunFortran"    # C w/ cfortran.h callable from FORTRAN
 
556
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
557
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
558
        C_F77_LIB=""            # FORTRAN lib called by C main
 
559
        F77=f77                 # FORTRAN compiler
 
560
        F77FLAGS=""             # common FORTRAN flags
 
561
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
562
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
563
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
564
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
565
        HDFSYS=SUN              # system type as defined by HDF5
 
566
        MACHINE=SUN9            # system type as defined by HDFEOS5
 
567
        NSL_FLAG="-lnsl"        # this is nil on all but Sun platforms
 
568
        NSL_LIB="/usr/lib/libnsl.a" # this is nil on all but Sun platforms
 
569
        ;;
 
570
 
 
571
    sun5.10)
 
572
        CC=cc                   # C compiler
 
573
        CFLAGS="$opt_flag -Xa -DH5_USE_16_API"  # default C flags (optimize, ansi)
 
574
        C_CFH="-DsunFortran"    # C w/ cfortran.h callable from FORTRAN
 
575
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
576
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
577
        C_F77_LIB=""            # FORTRAN lib called by C main
 
578
        F77=f77                 # FORTRAN compiler
 
579
        F77FLAGS=""             # common FORTRAN flags
 
580
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
581
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
582
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
583
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
584
        HDFSYS=SUN              # system type as defined by HDF5
 
585
        MACHINE=SUN10           # system type as defined by HDFEOS5
 
586
        NSL_FLAG="-lnsl"        # this is nil on all but Sun platforms
 
587
        NSL_LIB="/usr/lib/libnsl.a" # this is nil on all but Sun platforms
 
588
        ;;
 
589
 
 
590
    *)
 
591
        CC=cc                   # C compiler
 
592
        CFLAGS="$opt_flag -DH5_USE_16_API"      # default C flags (optimize)
 
593
        C_CFH=""        # C w/ cfortran.h callable from FORTRAN
 
594
        CFHFLAGS="$CFLAGS $C_CFH" # CFLAGS + C_CFH
 
595
        C_F77_CFH="$C_CFH"      # calling FORTRAN
 
596
        C_F77_LIB=""            # FORTRAN lib called by C main
 
597
        F77=f77                 # FORTRAN compiler
 
598
        F77FLAGS=""             # common FORTRAN flags
 
599
        F77_CFH=""              # FORTRAN callable from C w/ cfortran.h
 
600
        F77_C_CFH="$F77_CFH"    # calling C w/ cfortran.h
 
601
        CFH_F77="$F77_C_CFH"    # old version of F77_C_CFH
 
602
        F77_C_LIB="-lm"         # C lib called by FORTRAN main
 
603
        HDFSYS=unknown          # system type as defined by HDF5
 
604
        MACHINE=unknown         # system type as defined by HDFEOS5
 
605
        ;;
 
606
esac
 
607
 
 
608
export MACHINE
 
609
export NSL_FLAG NSL_LIB
 
610
 
 
611
export CC CFLAGS C_CFH CFHFLAGS C_F77_CFH C_F77_LIB F77
 
612
export F77FLAGS F77_CFH F77_C_CFH CFH_F77 F77_C_LIB HDFSYS
 
613
 
 
614
 
 
615
 
616
# set up environment to handle FORTRAN-90 compiler
 
617
#
 
618
 
 
619
if [ "$hdfeos5_f90_comp" != "" ] ; then         # using FORTRAN-90
 
620
 
 
621
    F77="$hdfeos5_f90_comp"
 
622
 
 
623
    if [ "$hdfeos5_nag_flag" = "1" ] ; then             # using NAG f90
 
624
        C_CFH="$C_CFH -DNAGf90F"
 
625
        CFHFLAGS="$CFLAGS $C_CFH"
 
626
    fi
 
627
 
 
628
    export CFHFLAGS C_CFH F77
 
629
 
 
630
fi
 
631
 
 
632
 
 
633
# copy the machine-specific path to variable hdfeos5_path
 
634
 
 
635
hdfeos5_path=$PATH
 
636
 
 
637
# set HDFEOS5-related environment variables
 
638
# these may be referred to in makefiles and on compiler command lines
 
639
 
 
640
if [ "$HDFEOS5_HOME" != "" ] ; then
 
641
 
 
642
# set up base set of HDFEOS5_ Toolkit directory variables.
 
643
 
 
644
    HDFEOS5_BIN=${HDFEOS5_HOME}/bin/$BRAND      # executable files
 
645
    HDFEOS5_INC=$HDFEOS5_HOME/include           # include header files
 
646
    HDFEOS5_LIB=${HDFEOS5_HOME}/lib/$BRAND      # library files
 
647
    HDFEOS5_OBJ=${HDFEOS5_HOME}/obj/$BRAND      # object files
 
648
    HDFEOS5_SRC=$HDFEOS5_HOME/src               # HDFEOS5 source files
 
649
 
 
650
    if [ $use_flavor = 1 ] ; then
 
651
    if [ "$opt_flag" = "-g" ] ; then
 
652
 
 
653
        HDFEOS5_LIB=${HDFEOS5_LIB}_debug
 
654
        HDFEOS5_OBJ=${HDFEOS5_OBJ}_debug
 
655
        HDFEOS5_BIN=${HDFEOS5_BIN}_debug
 
656
 
 
657
        hdf5lib=`echo $HDF5LIB | sed "s/${BRAND}/${BRAND}_debug/"`
 
658
        if [ -d $hdf5lib ] ; then
 
659
            HDF5LIB=$hdf5lib
 
660
        fi
 
661
 
 
662
        hdf5inc=`echo $HDF5INC | sed "s/${BRAND}/${BRAND}_debug/"`
 
663
        if [ -d $hdf5inc ] ; then
 
664
            HDF5INC=$hdf5inc
 
665
        fi
 
666
 
 
667
    fi
 
668
    fi
 
669
 
 
670
    export HDFEOS5_HOME HDFEOS5_BIN HDFEOS5_DAT HDFEOS5_INC HDFEOS5_LIB 
 
671
    export HDFEOS5_MSG  HDFEOS5_OBJ HDFEOS5_RUN HDFEOS5_SRC HDFEOS5_TST
 
672
 
 
673
# update path variables
 
674
 
 
675
    PATH=$PATH:$HDFEOS5_BIN; export PATH        # add HDFEOS5_BIN to path
 
676
    hdfeos5_path=$hdfeos5_path:$HDFEOS5_BIN     # add HDFEOS5_BIN to hdfeos5 path
 
677
    user_path=$user_path:$HDFEOS5_BIN           # add HDFEOS5_BIN to user path
 
678
 
 
679
 
 
680
else
 
681
 
 
682
    echo "You must first set the environment variable HDFEOS5_HOME"
 
683
 
 
684
fi
 
685
 
 
686
 
 
687
 
 
688
#
 
689
# restore augmented user path
 
690
#
 
691
PATH=$user_path ; export PATH
 
692
 
 
693
 
 
694
# done
 
695