1 | #!/bin/csh |
---|
2 | set verbose echo |
---|
3 | set has_arch_opt = FALSE |
---|
4 | set has_compile_opt = FALSE |
---|
5 | set default_compile_flags = "%PROD_FFLAGS" |
---|
6 | set has_use_vt = FALSE |
---|
7 | set has_oasis = FALSE |
---|
8 | set has_no_mpi = FALSE |
---|
9 | |
---|
10 | top: |
---|
11 | if ($#argv > 0) then |
---|
12 | switch ($1) |
---|
13 | |
---|
14 | case -h |
---|
15 | |
---|
16 | ######################################################################## |
---|
17 | # Manuel en ligne |
---|
18 | ######################################################################## |
---|
19 | more <<eod |
---|
20 | |
---|
21 | |
---|
22 | configure_ioserver [Options] |
---|
23 | |
---|
24 | bla, bla, bla |
---|
25 | eod |
---|
26 | exit |
---|
27 | |
---|
28 | ######################################################################## |
---|
29 | # Lecture des differentes options |
---|
30 | ######################################################################## |
---|
31 | |
---|
32 | case -a |
---|
33 | case -arch |
---|
34 | set has_arch_opt = TRUE |
---|
35 | set arch="$2" ; shift ; shift ; goto top |
---|
36 | |
---|
37 | case -prod |
---|
38 | set has_compile_opt = TRUE |
---|
39 | set compile_flags="%PROD_FFLAGS" |
---|
40 | shift ; goto top |
---|
41 | |
---|
42 | case -dev |
---|
43 | set has_compile_opt = TRUE |
---|
44 | set compile_flags="%DEV_FFLAGS" |
---|
45 | shift ; goto top |
---|
46 | |
---|
47 | case -debug |
---|
48 | set has_compile_opt = TRUE |
---|
49 | set compile_flags="%DEBUG_FFLAGS" |
---|
50 | shift ; goto top |
---|
51 | |
---|
52 | case -use_vt |
---|
53 | set has_use_vt = TRUE |
---|
54 | shift ; goto top |
---|
55 | |
---|
56 | case -oasis |
---|
57 | set has_oasis = TRUE |
---|
58 | shift ; goto top |
---|
59 | |
---|
60 | case -no_mpi |
---|
61 | set has_no_mpi = TRUE |
---|
62 | shift ; goto top |
---|
63 | |
---|
64 | default |
---|
65 | echo "unknown option "$1" , exiting..." |
---|
66 | exit |
---|
67 | endsw |
---|
68 | endif |
---|
69 | |
---|
70 | |
---|
71 | #define architecture files |
---|
72 | if ( $has_arch_opt == TRUE) then |
---|
73 | if ( -e arch/arch-${arch}.fcm ) then |
---|
74 | rm -f arch.fcm |
---|
75 | ln -s arch/arch-${arch}.fcm arch.fcm |
---|
76 | else |
---|
77 | echo "architecture file : << arch/arch-${arch}.fcm >> is missing, exiting...." |
---|
78 | exit |
---|
79 | endif |
---|
80 | |
---|
81 | if ( -e arch/arch-${arch}.path ) then |
---|
82 | rm -f arch.path |
---|
83 | ln -s arch/arch-${arch}.path arch.path |
---|
84 | else |
---|
85 | echo "architecture file : << arch/arch-${arch}.path >> is missing, exiting...." |
---|
86 | exit |
---|
87 | endif |
---|
88 | else |
---|
89 | echo "Warning : architecture not specified, taking default file <<arch.fcm>> and <<arch.path>>" |
---|
90 | if ( ! -e arch.fcm ) then |
---|
91 | echo "architecture file : << arch.fcm >> is missing, exiting...." |
---|
92 | exit |
---|
93 | endif |
---|
94 | |
---|
95 | if ( ! -e arch.fcm ) then |
---|
96 | echo "architecture file : << arch.path >> is missing, exiting...." |
---|
97 | exit |
---|
98 | endif |
---|
99 | endif |
---|
100 | |
---|
101 | # set compiler flags |
---|
102 | set FFLAGS="%BASE_FFLAGS" |
---|
103 | set LD_FFLAGS="%BASE_LD %MPI_LD" |
---|
104 | set CPP_KEY="%FPP_DEF" |
---|
105 | set INCDIR="" |
---|
106 | set LIB="" |
---|
107 | |
---|
108 | source ./arch.path |
---|
109 | |
---|
110 | # set compiler flags for optimisation |
---|
111 | if ( $has_compile_opt == FALSE ) then |
---|
112 | set compile_flags=$default_compile_flags |
---|
113 | endif |
---|
114 | set FFLAGS=${FFLAGS}" %MPI_FFLAGS "$compile_flags |
---|
115 | |
---|
116 | |
---|
117 | # add path for xmlf90 library |
---|
118 | |
---|
119 | set INCDIR="$INCDIR $XMLF90_INCDIR" |
---|
120 | set LIB="$LIB $XMLF90_LIBDIR $XMLF90_LIB" |
---|
121 | |
---|
122 | # add path for ioipsl library |
---|
123 | set INCDIR="$INCDIR $IOIPSL_INCDIR" |
---|
124 | set LIB="$LIB $IOIPSL_LIBDIR $IOIPSL_LIB" |
---|
125 | |
---|
126 | # add path for netcdf library |
---|
127 | set INCDIR="$INCDIR $NETCDF_INCDIR" |
---|
128 | set LIB="$LIB $NETCDF_LIBDIR $NETCDF_LIB" |
---|
129 | |
---|
130 | if ( $has_oasis == TRUE ) then |
---|
131 | set INCDIR="$INCDIR $OASIS_INCDIR" |
---|
132 | set LIB="$LIB $OASIS_LIBDIR $OASIS_LIB" |
---|
133 | set CPP_KEY="$CPP_KEY USE_OASIS" |
---|
134 | endif |
---|
135 | |
---|
136 | if ( $has_use_vt == TRUE ) then |
---|
137 | set INCDIR="$INCDIR $VAMPIR_INCDIR" |
---|
138 | set LIB="$LIB $VAMPIR_LIBDIR $VAMPIR_LIB" |
---|
139 | set CPP_KEY="$CPP_KEY USE_VT" |
---|
140 | endif |
---|
141 | |
---|
142 | if ( $has_no_mpi == TRUE ) then |
---|
143 | set CPP_KEY="NO_MPI $CPP_KEY" |
---|
144 | endif |
---|
145 | |
---|
146 | |
---|
147 | # build config file |
---|
148 | set config_fcm="config.fcm" |
---|
149 | rm -f $config_fcm |
---|
150 | |
---|
151 | echo "%FFLAGS $FFLAGS" > $config_fcm |
---|
152 | echo "%CPP_KEY $CPP_KEY" >> $config_fcm |
---|
153 | echo "%LD_FFLAGS $LD_FFLAGS" >> $config_fcm |
---|
154 | echo "%INCDIR $INCDIR" >> $config_fcm |
---|
155 | echo "%LIB $LIB" >> $config_fcm |
---|