-
Notifications
You must be signed in to change notification settings - Fork 17
/
configure
executable file
·110 lines (96 loc) · 3.06 KB
/
configure
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
#!/bin/bash
MAKEFILEIN='makefile.in'
MAKEFILEIN_NCD=`mktemp makefile.in.ncd.XXXXX`
MAKEFILEIN_SYS=`mktemp makefile.in.sys.XXXXX`
MAKEFILEIN_ARC=`mktemp makefile.in.arc.XXXXX`
finish () {
rm -f $MAKEFILEIN_NCD
rm -f $MAKEFILEIN_SYS
rm -f $MAKEFILEIN_ARC
exit 0
}
trap finish EXIT
# Configure NetCDF
echo "" > $MAKEFILEIN_NCD
if [ -n "$NETCDF_INC" ] ; then
ncincstr="-I$NETCDF_INC"
elif [ -n "$NETCDF" ] ; then
ncincstr="-I$NETCDF/include"
else
ncincstr=`nc-config --fflags 2>/dev/null`
if [ -z "$ncincstr" ] ; then
ncincstr='-I'`pkg-config netcdf-fortran --variable=includedir`
fi
fi
if [ -n "$ncincstr" ] ; then
echo 'NETCDFINC = '"$ncincstr" >> $MAKEFILEIN_NCD
else
echo "ERROR in NETCDFINC"
fi
if [ -n "$NETCDF_LIB" ] ; then
nclibstr="-L$NETCDF_LIB"
elif [ -n "$NETCDF" ] ; then
nclibstr="-L$NETCDF/lib"
else
nclibstr=`nc-config --flibs 2>/dev/null | sed 's/-lnetcdff//g' | sed 's/-lnetcdf//g'`
if [ -z "$nclibstr" ] ; then
nclibstr='-L'`pkg-config netcdf-fortran --variable=libdir`
fi
fi
if [ -n "$nclibstr" ] ; then
echo 'NETCDFLIB = '"$nclibstr -lnetcdff -lnetcdf" >> $MAKEFILEIN_NCD
else
echo "ERROR in NETCDFLIB"
fi
cat $MAKEFILEIN_NCD
echo ""
# Configure System
echo "" > $MAKEFILEIN_SYS
if [ -n "$WRF_HYDRO" ] && [ "$WRF_HYDRO" -ne "0" ] ; then
wrfhydrostr='-DWRF_HYDRO'
elif [ -n "$WRF_HYDRO_RAPID" ] && [ "$WRF_HYDRO_RAPID" -ne "0" ] ; then
wrfhydrostr='-DWRF_HYDRO -DWRF_HYDRO_RAPID'
else
wrfhydrostr=''
fi
echo 'WRF_HYDRO = '"$wrfhydrostr" >> $MAKEFILEIN_SYS
if [ -n "$HYDRO_D" ] && [ "$HYDRO_D" -ne "0" ] ; then
hydrodstr='-DHYDRO_D $(WRF_HYDRO)'
else
hydrodstr='$(WRF_HYDRO)'
fi
echo 'HYDRO_D = '"$hydrodstr" >> $MAKEFILEIN_SYS
if [ -n "$WRFIO_NCD_LARGE_FILE_SUPPORT" ] && [ "$WRFIO_NCD_LARGE_FILE_SUPPORT" -eq 1 ] ; then
largefilestr='-DWRFIO_NCD_LARGE_FILE_SUPPORT'
else
largefilestr=''
fi
echo 'WRFIO_NCD_LARGE_FILE_SUPPORT = '"$largefilestr" >> $MAKEFILEIN_SYS
# Compiling Options
echo "Please select from following supported options."
echo " 1. Linux GCC seq"
echo " 2. Linux GCC dmpar"
echo " 3. Linux Intel seq"
echo " 4. Linux Intel dmpar"
echo " 21. Darwin GCC seq"
echo " 22. Darwin GCC seq"
echo " 0. exit only"
echo ""
echo -n "Enter selection: "
read option
# Compiling Configurations
case $option in
1 ) cp arch/makefile.in.linux.seq.gcc $MAKEFILEIN_ARC ;;
2 ) cp arch/makefile.in.linux.mpp.gcc $MAKEFILEIN_ARC ;;
3 ) cp arch/makefile.in.linux.seq.intel $MAKEFILEIN_ARC ;;
4 ) cp arch/makefile.in.linux.mpp.intel $MAKEFILEIN_ARC ;;
5 ) cp arch/makefile.in.linux.seq.pgi $MAKEFILEIN_ARC ;;
6 ) cp arch/makefile.in.linux.mpp.pgi $MAKEFILEIN_ARC ;;
11 ) cp arch/makefile.in.ibm.seq.xlf90_r $MAKEFILEIN_ARC ;;
12 ) cp arch/makefile.in.ibm.mpp.xlf90_r $MAKEFILEIN_ARC ;;
21 ) cp arch/makefile.in.darwin.seq.gcc $MAKEFILEIN_ARC ;;
22 ) cp arch/makefile.in.darwin.mpp.gcc $MAKEFILEIN_ARC ;;
0 ) exit ;;
* ) echo 'ERROR: Unknown option!' ; exit 1 ;;
esac
cat $MAKEFILEIN_NCD $MAKEFILEIN_SYS $MAKEFILEIN_ARC > $MAKEFILEIN