source: XIOS/dev/common/make_xios @ 1511

Last change on this file since 1511 was 301, checked in by ymipsl, 12 years ago

oublie commit précédant...

YM

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1#!/bin/bash
2
3install_dir=$PWD
4compil_full="false"
5use_oasis="false"
6
7# Traitement de la ligne de commande
8while (($# > 0))
9   do
10      case $1 in
11         "-h")
12            # A modifier
13            exit;;
14
15         "--prod")  compil_mode="prod"  ; shift ;;
16         "--dev")   compil_mode="dev"   ; shift ;;
17         "--debug") compil_mode="debug" ; shift ;;
18         "--arch")  arch=$2     ; shift ; shift ;;
19         "--full")  compil_full="true"  ; shift ; shift ;;
20         "--use_oasis")  use_oasis="true"  ; shift  ;;
21         "--doc")   doc="true"          ; shift ;;
22         *)         code="$1"           ; shift ;;
23      esac
24   done
25
26# Vérification de la présence d'un identifiant d'architecture.
27
28###############################################################
29# lecture des chemins propres à l'architecture de la machine #
30#           et configuration de l'environnement              #
31###############################################################
32
33rm -f .void_file
34echo > .void_file
35rm -rf .void_dir
36mkdir .void_dir
37
38if [[ !(-z $arch) ]]
39   then
40      rm -f  $install_dir/arch.path
41      rm -f  $install_dir/arch.fcm
42      rm -f  $install_dir/arch.env
43      ln -s  $install_dir/arch/arch-${arch}.path $install_dir/arch.path
44      ln -s  $install_dir/arch/arch-${arch}.fcm  $install_dir/arch.fcm
45
46      if test -f $install_dir/arch/arch-${arch}.env
47      then
48        ln -s $install_dir/arch/arch-${arch}.env arch.env
49      else
50        ln -s $install_dir/.void_file arch.env
51      fi
52
53      source $install_dir/arch.env
54      source $install_dir/arch.path
55  else
56      echo "Veuillez definir une architecture cible !"
57      exit 1
58fi
59
60# Vérification de la présence d'un mode de compilation.
61
62if [[ "$compil_mode" == "prod" ]]
63   then
64      COMPIL_CFLAGS="%PROD_CFLAGS"
65      COMPIL_FFLAGS="%PROD_FFLAGS"
66elif [[ "$compil_mode" == "dev" ]]
67   then
68      COMPIL_CFLAGS="%DEV_CFLAGS"
69      COMPIL_FFLAGS="%DEV_FFLAGS"
70elif [[ "$compil_mode" == "debug" ]]
71   then
72      COMPIL_CFLAGS="%DEBUG_CFLAGS"
73      COMPIL_FFLAGS="%DEBUG_FFLAGS"
74else
75   echo "Veuillez definir un mode de compilation [debug|dev|prod] !"
76   exit 1
77fi
78
79if [[ "$use_oasis" == "true" ]]
80   then
81   XMLIO_FINCDIR="$OASIS_INCDIR $XMLIO_FINCDIR"
82   XMLIO_LIB="$OASIS_LIBDIR $OASIS_LIB $XMLIO_LIB"
83   XMLIO_CPPKEY="$XMLIO_CPPKEY USE_OASIS"
84else
85  fcm build
86fi
87XMLIO_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR"
88XMLIO_FINCDIR="$XMLIO_FINCDIR $MPI_INCDIR"
89
90XMLIO_LIB="$XMLIO_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB"
91
92rm -f config.fcm
93echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> config.fcm
94echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> config.fcm
95echo "%CPP_KEY       $XMLIO_CPPKEY"  >> config.fcm
96
97echo "%CBASE_INC     $XMLIO_CINCDIR" >> config.fcm     
98echo "%FBASE_INC     $XMLIO_FINCDIR" >> config.fcm
99echo "%ARCH_LD       $XMLIO_LIB" >> config.fcm
100
101echo "=> Activation du mode "$compil_mode" pour la distribution sous l'architecture \""$arch"\" !"
102
103# Création de la documentation doxygen.
104if [[ !(-z $doc) ]]
105   then
106      echo -e "- Création de la documentation de code doxygen (désactivée)..."
107      #doxygen -s
108fi
109
110make_dir=$PWD
111
112export PATH=$PWD/tools/FCM/bin:$PATH
113
114#$make_dir/tools/preprocess_cpp $make_dir/src/xmlio/iface/interface.cpp      $make_dir/src/xmlio/iface/interface.cpp.in
115#$make_dir/tools/preprocess_f03 $make_dir/src/xmlio/fortran/ixmlioserver.f90 $make_dir/src/xmlio/fortran/ixmlioserver.f03.in
116
117if [[ "$compil_full" == "true" ]]
118   then
119   fcm build -f
120else
121  fcm build
122fi
123
124
125if [[ $? == 0 ]]
126  then
127#    cd $WORKDIR/XMLIO_NEMO_COUPLE/modeles/NEMO/WORK
128    cd $WORKDIR/XMLIO_NEMO/modeles/NEMO/WORK
129#    make
130fi
Note: See TracBrowser for help on using the repository browser.