summaryrefslogtreecommitdiff
path: root/lib/make/known-architectures/irix
blob: ee7cc34243e0dc24e655213b0f75843079d86bd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#! /bin/sh
#  /*@@
#    @file      irix
#    @date      Thu Feb 25 12:20:53 1999
#    @author    Tom Goodale
#    @desc 
#   
#    @enddesc 
#    @version $Header: /mnt/data2/cvs2svn/cvs-repositories/Cactus/lib/make/known-architectures/irix,v 1.19 2000-04-17 19:25:18 goodale Exp $
#  @@*/

if test "$CCTK_CONFIG_STAGE" = "preferred-compilers" ; then

# extract the CPU type from hinv output
# (assumes all processors are of equal type :-)
  IRIX_CPU="`hinv -t cpu | tail -1 | sed 's/^[^R]*R\([01-9]*\).*$/\1/'`"

  if test -n "`uname | grep 64`" ; then
     IRIX_BITS=64
  else
     IRIX_BITS=32
  fi

#case "$IRIX_BITS:$CC" in
#    64:gcc)
#    echo gcc can\'t compile 64 bit, changing to cc
#    CC=cc
#    CXX=CC
#    LD=CC
#    ;;
#esac

#  if test "$CC" = "gcc" ; then
#      echo "There seem to be some problems with the GNU compiler under irix, switching to cc"
#      echo "If you don't like this, you can edit your make.config.defn file."
#      CC=cc
#      CXX=CC
#      LD=CC
#  fi

  if test -z "$CC"; then
    echo Setting C compiler to cc
    CC="cc"
  fi

  if test -z "$CXX"; then
    echo Setting C++ compiler to CC
    CXX="CC"
  fi

  if test -z "$LD"; then
    echo Setting linker to CC
    LD="CC"
  fi



else

  case "$IRIX_BITS:$CC" in
    64:cc)
      CFLAGS="$CFLAGS -64 -mips4 -r10000"
      CXXFLAGS="$CXXFLAGS -64 -mips4 -r10000"
      C_OPTIMISE_FLAGS="-O3"
      CXX_OPTIMISE_FLAGS="-O3"
      C_DEBUG_FLAGS="-g"
      CXX_DEBUG_FLAGS="-g"
      ;;
    32:cc)
      CFLAGS="$CFLAGS -n32 -mips3"
      CXXFLAGS="$CXXFLAGS -n32 -mips3"
      C_OPTIMISE_FLAGS="-O3"
      CXX_OPTIMISE_FLAGS="-O3"
      C_DEBUG_FLAGS="-g"
      CXX_DEBUG_FLAGS="-g"
      ;;
    *)
      ;;
  esac

  case "$IRIX_BITS" in
    64)
      F90FLAGS="$F90FLAGS  \
	-OPT:roundoff=3:IEEE_arithmetic=3:const_copy_limit=100000 \
	-r10000 -TARG:proc=r10000 \
	-64 -mips4"
      F77FLAGS="$F90FLAGS"
      F90_OPTIMISE_FLAGS="-O3"
      F77_OPTIMISE_FLAGS="-O3"
      F90_DEBUG_FLAGS="-g"
      F77_DEBUG_FLAGS="-g"
      ;;
    32)
      F90FLAGS="\
	    -OPT:roundoff=3:IEEE_arithmetic=3:fold_arith_limit=10000:const_copy_limit=100000 \
	    -n32 -mips3"
      F77FLAGS="$F90FLAGS" 
      F90_OPTIMISE_FLAGS="-O3"
      F77_OPTIMISE_FLAGS="-O3"
      F90_DEBUG_FLAGS="-g"
      F77_DEBUG_FLAGS="-g"
      ;;
    *)
      ;;
esac

case "$IRIX_BITS:$LD" in
    64:CC)
      LDFLAGS="$LDFLAGS -64 -Wl,\"-woff 84\",\"-woff 85\""
      ;;
    32:CC)
      LDFLAGS="$LDFLAGS -n32 -Wl,\"-woff 84\",\"-woff 85\""
      ;;
    *)
      ;;
esac

# Find out which version of the Fortran compilers is installed

  IRIX_FVERSION="`versions ftn_dev | grep , | tail -1 | sed 's:.*, ::'`"

  IRIX_FMAJ="`echo $IRIX_FVERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\1:'`"
  IRIX_FMIN="`echo $IRIX_FVERSION | sed 's:\([^. ]*\)\.\([^. ]*\).*:\2:'`"

  if test $IRIX_FMAJ -gt 7 -o \( $IRIX_FMAJ -eq 7 -a $IRIX_FMIN -ge 2 \) ; then
    IRIX_FLIBS="fortran ftn ftn90"
  else
    IRIX_FLIBS="ftn ftn90"
  fi

  case $IRIX_BITS in
    64)
      LIBS="$LIBS malloc perfex fpe $IRIX_FLIBS m"
      ;;
    32)
      LIBS="$LIBS malloc fpe $IRIX_FLIBS m"
      ;;
    *)
      ;;
  esac

# Cache stuff
  if test -z "$L2_CACHELINE_BYTES" ; then
    L2_CACHELINE_BYTES=128
    echo "Setting L2_CACHELINE_BYTES to $L2_CACHELINE_BYTES"
  fi

  if test -z "$L2_CACHE_SIZE" ; then
    TEMP_CACHE_SIZE="`hinv | perl -ne 'if (m/Secondary.*cache/) { s/^.*: (.*)( on P.*)?$/$1/ ; s/ Mbyte.*/\*1024/ ; s/ Kbyte.*//; print}'`"
    if test -n "$TEMP_CACHE_SIZE" ; then
      L2_CACHE_SIZE="$TEMP_CACHE_SIZE*1024"
      echo "Setting L2_CACHE_SIZE to $L2_CACHE_SIZE bytes"
    else
      echo "Unable to determine L2 Cache size on this machine. "
    fi
  fi

# MPI stuff

  if test -n "$MPI" ; then
    NATIVE_MPI_LIBS="mpi"
  fi

fi