source: XMLIO_SERVER/trunk/configure @ 27

Last change on this file since 27 was 27, checked in by ymipsl, 15 years ago

Correction : utilisation d'OASIS par le server

File size: 3.5 KB
Line 
1#!/bin/csh
2set verbose echo
3set has_arch_opt           = FALSE
4set has_compile_opt        = FALSE
5set default_compile_flags  = "%PROD_FFLAGS"
6set has_use_vt             = FALSE
7set has_oasis              = FALSE
8
9top:
10if ($#argv > 0) then
11    switch ($1)
12
13    case -h
14
15########################################################################
16# Manuel en ligne
17########################################################################
18more <<eod
19
20
21configure_ioserver [Options]
22
23bla, bla, bla
24eod
25exit
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
50
51    case -use_vt
52        set has_use_vt = TRUE
53        shift ; goto top
54       
55    case -oasis
56        set has_oasis = TRUE
57        shift ; goto top
58   
59   default
60        echo "unknown option "$1" , exiting..."
61        exit
62   endsw
63endif
64
65
66#define architecture files
67if ( $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
83else
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
94endif
95 
96# set compiler flags
97set FFLAGS="%BASE_FFLAGS"
98set LD_FFLAGS="%BASE_LD"
99set CPP_KEY="%FPP_DEF"
100set INCDIR=""
101set LIB=""
102
103source ./arch.path
104
105# set compiler flags for optimisation
106if ( $has_compile_opt == FALSE ) then
107  set compile_flags=$default_compile_flags
108endif
109set FFLAGS=${FFLAGS}" "$compile_flags
110
111
112# add path for xmlf90 library
113
114set INCDIR="$INCDIR $XMLF90_INCDIR"
115set LIB="$LIB $XMLF90_LIBDIR $XMLF90_LIB"
116
117# add path for ioipsl library
118set INCDIR="$INCDIR $IOIPSL_INCDIR"
119set LIB="$LIB $IOIPSL_LIBDIR $IOIPSL_LIB"
120
121# add path for netcdf library
122set INCDIR="$INCDIR $NETCDF_INCDIR"
123set LIB="$LIB $NETCDF_LIBDIR $NETCDF_LIB"
124
125if ( $has_oasis == TRUE ) then
126  set INCDIR="$INCDIR $OASIS_INCDIR"
127  set LIB="$LIB $OASIS_LIBDIR $OASIS_LIB"
128endif
129
130if ( $has_use_vt == TRUE ) then
131  set INCDIR="$INCDIR $VAMPIR_INCDIR"
132  set LIB="$LIB $VAMPIR_LIBDIR $VAMPIR_LIB"
133  set CPP_KEY="$CPP_KEY USE_VT"
134endif
135
136
137
138# build config file
139set config_fcm="config.fcm"
140rm -f $config_fcm
141
142echo "%FFLAGS        $FFLAGS"                           >  $config_fcm 
143echo "%CPP_KEY       $CPP_KEY"                          >> $config_fcm
144echo "%LD_FFLAGS     $LD_FFLAGS"                        >> $config_fcm
145echo "%INCDIR        $INCDIR"                           >> $config_fcm
146echo "%LIB           $LIB"                              >> $config_fcm
Note: See TracBrowser for help on using the repository browser.