source: XIOS/trunk/make_xios @ 331

Last change on this file since 331 was 313, checked in by ymipsl, 12 years ago

Fortran attribut interface are now automaticaly generated.
Add get attribut fonctionnality from fortran.

YM

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