default 8.97 KB
Newer Older
Uwe Schulzweida's avatar
Uwe Schulzweida committed
1
2
3
4
#! /bin/sh
#
# default configuration options and compiler flags for different hosts
#
Uwe Schulzweida's avatar
Uwe Schulzweida committed
5
6
7
8
9
10
#
CONFPATH=`echo $0 | cut -c 1-6`
if [ "$CONFPATH" != "../../" ] ; then
  CONFPATH='./'
fi
#
Uwe Schulzweida's avatar
Uwe Schulzweida committed
11
set -x
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

HOSTNAME=`hostname`
#
while test $# != 0
do
  case $1 in
    CC=?*)
      COMP=`expr "X$1" : 'X[^=]*=\(.*\)'`
      ;;
    CONFIG_OPTS=?*)
      CONFIG_OPTS=`expr "X$1" : 'X[^=]*=\(.*\)'`
      ;;
    *)
          HOSTNAME=$1
          ;;
  esac
  shift
done
Uwe Schulzweida's avatar
Uwe Schulzweida committed
30
31
#
case "${HOSTNAME}" in
Uwe Schulzweida's avatar
Uwe Schulzweida committed
32
# i386-apple-darwin10
Uwe Schulzweida's avatar
Uwe Schulzweida committed
33
    icc)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
34
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
35
36
37
38
                    --enable-maintainer-mode \
                    --enable-iso-c-interface \
                    --enable-swig \
                    --enable-python \
39
                    --with-eccodes=$HOME/local/eccodes-2.6.0 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
40
                    --with-netcdf=$HOME/local/netcdf-4.4.1.1 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
41
                    --with-szlib=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
42
	            CC=icc CFLAGS="-g -D_REENTRANT -Wall -Wwrite-strings -O3 -march=native -fp-model source"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
43
	;;
44
    bailung*|d133*|d134*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
45
	${CONFPATH}configure --prefix=$HOME/local \
46
                    --enable-maintainer-mode \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
47
                    --enable-iso-c-interface \
48
                    --enable-swig \
49
                    --with-eccodes=$HOME/local/eccodes-2.17.0 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
50
                    --with-netcdf=$HOME/local/netcdf-4.4.1.1 \
51
                    --with-szlib=$HOME/local \
52
                    LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.17.0/lib" \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
53
	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3 -march=native"
54
	;;
55
    cinglung*|feilung*|wanglung*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
56
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
57
58
59
60
61
62
63
                    --enable-shared \
                    --enable-maintainer-mode \
                    --enable-swig \
                    --enable-python \
                    --with-grib_api=/opt/local \
                    --with-netcdf=/opt/local \
                    --with-szlib=/opt/local \
Thomas Jahns's avatar
Thomas Jahns committed
64
	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
65
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
66
    hama*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
67
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
68
                    --enable-maintainer-mode \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
69
                    --enable-iso-c-interface \
70
71
                    --enable-swig \
                    --enable-python \
72
                    --with-szlib=$HOME/local \
73
74
75
                    --with-eccodes=$HOME/local/eccodes-2.17.0 \
                    --with-netcdf=$HOME/local/netcdf-c-4.7.4 \
                    LDFLAGS="-Wl,-rpath,$HOME/local/eccodes-2.17.0/lib" \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
76
	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -Wwrite-strings -W -Wfloat-equal -pedantic -O3"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
77
	;;
78
79
# x86_64-squeeze-x64-linux
    thunder*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
80
        ${CONFPATH}configure --with-grib_api=/sw/squeeze-x64/grib_api-1.13.0-static-gccsys \
81
                    --with-netcdf=/sw/squeeze-x64/netcdf-4.2-static \
82
                    --disable-cf-interface \
83
84
	            CC=gcc CFLAGS="-g -Wall -O3" 
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
85
86
# ia64-nec-linux
    ds*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
87
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
88
                    --with-netcdf=/pool/ia64/netcdf/netcdf-3.6.0-p1 \
89
                    --with-szlib=$HOME/local \
Thomas Jahns's avatar
Thomas Jahns committed
90
                    CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
91
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
92
93
# i686-linux
    etch-ia32 | gata)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
94
	${CONFPATH}configure --prefix=$HOME/local/etch-ia32 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
95
                    --enable-maintainer-mode \
96
                    --enable-all-static \
97
98
                    --enable-swig \
                    --enable-python \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
99
                    --with-grib_api=$HOME/local/etch-ia32/grib_api-1.9.8 \
100
	            --with-netcdf=/sw/etch-ia32/netcdf-4.0.1 \
101
                    --with-szlib=$HOME/local/etch-ia32 \
102
	            CC=gcc CFLAGS="-g -O2 -Wall -W -Wfloat-equal -pedantic"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
103
	;;
Ralf Müller's avatar
Ralf Müller committed
104
    melian)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
105
      ${CONFPATH}configure --prefix=`pwd`/build \
Ralf Müller's avatar
Ralf Müller committed
106
107
108
	            --with-netcdf \
                     --with-szlib \
                  --with-eccodes \
109
                      --with-pic --enable-swig --enable-ruby --enable-python \
110
                      CC=gcc CFLAGS="-g -O2 -Wall" LIBS=-lopenjpeg
Ralf Mueller's avatar
Ralf Mueller committed
111
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
112
113
# sparc-sun-solaris2.9
    executor | yang | yin)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
114
	${CONFPATH}configure --prefix=$HOME/local/SUN64 \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
115
                    --with-netcdf=/scratch/small/m214/m214089/local/SunOS64 \
116
                    --with-szlib=$HOME/local/solaris10 \
117
                    CC=cc CFLAGS="-g -mt -xO3 -xtarget=native -m64"
Uwe Schulzweida's avatar
Uwe Schulzweida committed
118
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
119
120
# sx6-nec-superux12.2
    cs*)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
121
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
122
123
124
125
126
         	    --with-netcdf=/pool/netcdf/netcdf-3.6.0-p1 \
		    CC=c++ \
                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
	;;
    sx6)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
127
	${CONFPATH}configure --host=sx6 --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
128
129
130
131
                    --with-netcdf=/pool/SX-6/netcdf/netcdf-3.6.0-p1 \
		    CC=sxc++ AR=sxar RANLIB=ls \
                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
	;;
132
133
    lxe0*)
        echo 'Please choose compiler modules! Checkout with "module av"!'
Uwe Schulzweida's avatar
Uwe Schulzweida committed
134
        ${CONFPATH}configure --prefix=$(pwd)/build-SX  --host=sx9-nec-superux \
135
136
137
138
139
              --with-netcdf=/usr/local/pkg-sx9 \
              --with-grib_api=/usr/local/pkg-sx9/grib_api   CC=sxc++ FC=sxf90 \
              LD=/SX/opt/crosskit/inst/bin/sxld AR=/SX/opt/crosskit/inst/bin/sxar \
              RANLIB=echo
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
140
141
# mips-sgi-irix6.5
    ecgate1)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
142
	${CONFPATH}configure --prefix=$HOME/local \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
143
144
145
146
147
 	            --with-netcdf=/home/ms/spdekplb/hmk/include,/home/ms/spdekplb/hmk/lib64 \
	            CC=cc CFLAGS="-O -n32"
	;;
# 5000-fujitsu-uxpv4.1_ES
    vpp5)
Uwe Schulzweida's avatar
Uwe Schulzweida committed
148
	${CONFPATH}configure --prefix=$HOME \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
149
150
	            CC=vcc CFLAGS="-O -Wv,-m3 -K4"
	;;
151
# powerpc-ibm-aix6.1.0.0
Uwe Schulzweida's avatar
Uwe Schulzweida committed
152
    blizzard*)
153
        CONFIG_SHELL=/bin/bash /bin/bash \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
154
                    ${CONFPATH}configure --prefix=$HOME/local \
155
156
157
                    --with-netcdf=/sw/aix61/netcdf-4.2 \
                    --with-szlib=/sw/aix61/szip-2.1-threadsafe \
                    AR="ar -X 64" LDFLAGS="-brtl" FC=xlf2003_r CC=xlc_r \
Thomas Jahns's avatar
Thomas Jahns committed
158
                    CFLAGS="-g -O3 -qhot -q64 -qarch=auto -qtune=auto -qlistfmt=html=transforms -DHAVE_MMAP" \
Uwe Schulzweida's avatar
Uwe Schulzweida committed
159
                    FCFLAGS="-qsuffix=cpp=f90 -qextname" \
160
                    SHELL=/bin/bash
161
        ;;
162
163
164
165
    breeze*)
        CDILIBS="--with-eccodes=/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys \
                 --with-netcdf=/sw/jessie-x64/netcdf-4.3.3.1-gccsys"
        PREFIX="--prefix=$(pwd)/build/${COMP}"
Ralf Müller's avatar
Ralf Müller committed
166
        LD_ADD="-Wl,-rpath,/sw/jessie-x64/eccodes/eccodes-2.4.1-gccsys/lib"
167

168
        if  test "$COMP" = intel ; then
Ralf Müller's avatar
Ralf Müller committed
169
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
170
                    CC=icc FC=ifort CFLAGS="-g -Wall -O2 -qopt-report=5 -march=native"
171
        elif  test "$COMP" = gnu ; then
Ralf Müller's avatar
Ralf Müller committed
172
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
173
                    CC=gcc FC=gfortran F77=gfortran CFLAGS="-g -Wall -O2 -march=native"
174
        elif  test "$COMP" = pgi ; then
Ralf Müller's avatar
Ralf Müller committed
175
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
176
177
                    CC=pgcc FC=pgf90 F77=pgf90 CFLAGS="-g"
        elif  test "$COMP" = clang ; then
Ralf Müller's avatar
Ralf Müller committed
178
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS $LDFLAGS\
179
180
                    CC=clang FC=gfortran CFLAGS="-g -O2"
        elif  test "$COMP" = nag ; then
Ralf Müller's avatar
Ralf Müller committed
181
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS LDFLAGS="$LD_ADD $LDFLAGS" \
182
183
184
185
186
187
188
189
190
                    CC=gcc FC=nagfor F77=nagfor CFLAGS="-g -O2"
        elif  test "$COMP" = nagClang ; then
          ${CONFPATH}configure $CONFIG_OPTS $PREFIX $CDILIBS \
                    CC=clang FC=nagfor F77=nagfor CFLAGS="-g -Wall -02"
        else
          echo "no config found for host: $HOSTNAME, COMP: $COMP !!"
        fi;

      ;;
191
192
    mlogin*)
        CDILIBS="--with-eccodes=/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48 \
Ralf Müller's avatar
Ralf Müller committed
193
                 --with-netcdf=/sw/rhel6-x64/netcdf/netcdf_c-4.3.2-gcc48"
194
195
196
        PREFIX="--prefix=$(pwd)/build/${COMP}"

        if  test "$COMP" = intel ; then
197
          ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
198
199
200
201
                    LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
                    F77=ifort FC=ifort FFLAGS="-g -O2" \
	            CC=icc   CFLAGS="-g -Wall -O2 -qopt-report=5 -march=core-avx2"
        elif  test "$COMP" = pgi ; then
202
          ${CONFPATH}configure  $PREFIX $CONFIG_OPTS $CDILIBS \
203
204
205
206
                    LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
	            CXX=pgc++ CXXFLAGS="-g -fast" \
	            CC=pgcc   CFLAGS="-g -fast"
        elif  test "$COMP" = gnu_pic ; then
207
          ${CONFPATH}configure $PREFIX $CONFIG_OPTS $CDILIBS \
208
209
210
211
                    LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
                    FC=gfortran F77=gfortran FFLAGS="-g -O2" \
                    CC=gcc  CFLAGS='-g -Wall -O3 -march=native -mavx2 -fPIC'
	else
212
          ${CONFPATH}configure $PREFIX $CONFIG_OPTS  $CDILIBS \
213
214
215
216
217
                    LDFLAGS="-Wl,-rpath,/sw/rhel6-x64/eccodes/eccodes-2.3.0-gcc48/lib" \
                    FC=gfortran F77=gfortran FFLAGS="-g -O2" \
                    CC=gcc  CFLAGS='-g -Wall -O3 -march=native -mavx2'
	fi
	;;
Uwe Schulzweida's avatar
Uwe Schulzweida committed
218
219
220
221
    *)
	echo "configuration for hostname $HOSTNAME not found!"
	;;
esac