source: XIOS/extract_xios @ 2355

Last change on this file since 2355 was 368, checked in by ymipsl, 12 years ago

correction : port extractor on AIX/IBM system

YM

  • Property svn:executable set to *
File size: 4.0 KB
Line 
1#!/bin/bash
2
3compil_mode="prod"
4svnbranch="/trunk"
5doc="F"
6extdir="."
7
8interactive=false
9
10has_interactive=false
11has_rev=false
12has_user=false
13has_branch=false
14has_compil_mode=false
15has_arch=false
16has_doc=false
17has_extdir=false
18
19
20echo -e "Installing XIOS library... "
21
22# Traitement de la ligne de commande
23while (($# > 0))
24   do
25      case $1 in
26         "-h")
27            # A modifier
28            exit;;
29         "--interactive") interactive=true    ; has_interactive=true; shift ;;
30         "--rev")         svnrev=$2           ; has_rev="true"; shift; shift ;;
31         "--user")        svnuser=$2          ; has_user="true"; shift; shift ;;
32         "--branch")      svnbranch=$2        ; has_branch="true"; shift; shift ;;
33         "--prod")        compil_mode="prod"  ; has_compil_mode="true"; shift ;;
34         "--dev")         compil_mode="dev"   ; has_compil_mode="true"; shift ;;
35         "--debug")       compil_mode="debug" ; has_compil_mode="true"; shift ;;
36         "--arch")        arch=$2             ; has_arch="true"; shift; shift ;;
37         "--doc")         withdoc="Y"         ; has_doc="true"; shift ;;
38         *)               extdir="$1"           ; has_extdir=true; shift ;;
39      esac
40   done
41
42# Récupération du répertoire local d'installation
43if  [[  $interactive == "true" && $has_extdir == "false"  ]]
44   then
45      read -p "insert directory path to extract XIOS library : "$PWD"/" extdir
46fi
47
48install_dir=$PWD/$extdir
49mkdir -p $install_dir
50
51# Documentation de la distribution
52if  [[ $interactive == "true" && $has_doc == "false" ]]
53   then
54      read -p "Do you want to extract documentation ? [Y/N]: " withdoc
55fi
56
57# Architecture de compilation
58if  [[ $interactive == "true" && $has_arch == "false" ]]
59   then
60      echo -e "\r\n XIOS may be install on different computing architecture, choose witch one...\r\n "
61      echo -e "\tIA64_PLATINE        => Configuration for CCRT supercomputer Platine\r\n"
62      echo -e "\tX86_LOCGNU_FEDORA   => Local configuration for gnu compiler under fedora\r\n"
63      echo -e "\tX86_LOCINTEL_FEDORA => Local configuration for intel compiler under fedora \r\n"
64      echo -e "\tX64_TITANE          => Configuration for CCRT supercomputer Titane \r\n"
65     
66      read -p "On which architecture do you want to work ? (default : none): " arch
67fi
68
69case $arch in
70   IA64_PLATINE)       
71      echo "=> Configuration for CCRT supercomputer Platine" ;;
72   X86_LOCGNU_FEDORA)   
73      echo "=> Local configuration for gnu compiler under fedora" ;;
74   X86_LOCINTEL_FEDORA) 
75      echo "=> Local configuration for intel compiler under fedora" ;;
76   X64_TITANE) 
77      echo "=> Configuration for CCRT supercomputer Titane " ;;
78   *)                   
79      echo "=> no specific architecture choosen"
80      arch=
81esac
82
83# Récupération du login de connexion svn
84if  [[ $interactive == "true" && $has_user  == "false" ]]
85   then
86      echo -e -n "insert your svn login"
87      read -p " forge.ipsl.jussieu.fr (nothing if anonymous) : " svnuser
88fi
89
90# Récupération de la branche svn de travail
91if  [[ $interactive == "true" && $has_branch == "false" ]]
92   then
93      read -p "Which branch do tou want to extract ? (default : /trunk): " svnbranch
94fi
95
96if [[ -z $svnbranch ]]
97   then
98      svnbranch="/trunk"
99fi
100
101if [[ -z $svnuser ]]
102   then
103      connect="http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS"$svnbranch
104   else
105      connect="svn+ssh://"$svnuser"@forge.ipsl.jussieu.fr/ipsl/forge/projets/ioserver/svn/XIOS"$svnbranch
106fi
107
108# Extraction de la distribution
109echo -e "=> Connecting to svn server via \""$connect"\"..."
110
111
112if [[ $withdoc == [Yy]* ]]
113   then
114      installopt=$installopt" --doc"
115fi
116
117svn -q co $connect  $install_dir
118
119echo -e "- uncompress archives ..."
120cd $install_dir
121for tarname in $install_dir/tools/archive/*.tar.gz; do
122   gunzip -f "$tarname"
123   tar -xf ${tarname%.gz}
124done
125
126if [[ !(-z $arch) && -f $install_dir/make_xios ]]
127   then
128      echo -e "Running installation script for architecture \""$arch"\" ..."
129      installopt=$installopt" --"$compil_mode" --arch "$arch
130      cd $install_dir && ./make_xios $installopt
131fi
132
133
Note: See TracBrowser for help on using the repository browser.