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