source: XMLIO_SERVER/trunk/configure @ 32

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

Portage sur Vargas + correction sur IOSERVER : finalisation de la derniÚre requÚte

File size: 3.5 KB
RevLine 
[8]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
[27]7set has_oasis              = FALSE
[8]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
[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
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"
[32]98set LD_FFLAGS="%BASE_LD %MPI_LD"
[8]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
[32]109set FFLAGS=${FFLAGS}" %MPI_FFLAGS "$compile_flags
[8]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
[16]121# add path for netcdf library
122set INCDIR="$INCDIR $NETCDF_INCDIR"
123set LIB="$LIB $NETCDF_LIBDIR $NETCDF_LIB"
124
[27]125if ( $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]129endif
130
[8]131if ( $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]135endif
136
137
[27]138
[8]139# build config file
140set config_fcm="config.fcm"
141rm -f $config_fcm
142
143echo "%FFLAGS        $FFLAGS"                           >  $config_fcm 
144echo "%CPP_KEY       $CPP_KEY"                          >> $config_fcm
145echo "%LD_FFLAGS     $LD_FFLAGS"                        >> $config_fcm
146echo "%INCDIR        $INCDIR"                           >> $config_fcm
147echo "%LIB           $LIB"                              >> $config_fcm
Note: See TracBrowser for help on using the repository browser.