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