Changeset 4924


Ignore:
Timestamp:
02/12/20 12:06:14 (4 years ago)
Author:
jgipsl
Message:

Ajoute help, commentaire en anglais, compressed un peu le code. Nettoyage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • IOIPSL/trunk/makeioipsl_fcm

    r4432 r4924  
    33export PATH=$ROOT/tools/FCM_V1.2/bin:${PATH} 
    44 
    5 compil_mode_defined="FALSE" 
    65compil_mode="prod" 
    76 
     
    1413CPP_KEY="CPP_NONE"  
    1514 
    16 while (($# > 0)) 
    17   do 
     15while (($# > 0)) ; do 
    1816  case $1 in 
    19       "-h") cat <<fin 
    20 Usage : 
    21 makegcm [options] -m arch exec 
    22 [-h]                       : help 
    23 [-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug . 
    24  -arch nom_arch            : nom de l\'architecture cible 
    25 fin 
     17      "-h") cat <<end_help 
     18######################################################################## 
     19# Usage of the script makeioipsl_fcm 
     20# 
     21# makeioipsl_fcm compiles IOIPSL using the Fcm software developed 
     22# by the Hadley Centre. Fcm is stored in tools directory.  
     23# Platform specific compile options are found in the arch directory.  
     24######################################################################## 
     25 
     26Usage: 
     27 
     28./makeioipsl_fcm -arch XXX [Options]  
     29 
     30 
     31Mandatory argument: 
     32 
     33-arch XXX  : name of the archicture file containg platform dependent compile options.  
     34             The files arch/arch-XXX.fcm and arch/arch-XXX.path must exist. If the  
     35             file arch/arch-XXX.env exist, it'll be sourced before compilation starts. 
     36 
     37Main options: 
     38[-h]             : show this help 
     39[ -full ]        : activate full recompiling  
     40[ -arch_path XXX ] : directory of the archicture file containg platform dependent compile options.  
     41                     Default is ./arch directory. If the files are not found in the folder given by arch_path,  
     42                     the default ./arch folder will be used.  
     43 
     44Options for optimization, choose only one of the following 
     45[ -prod ]        : compilation for production (all optimization) 
     46[ -dev ]         : compilation for development (low optimization and -g) 
     47[ -debug ]       : compilation for debugging (no optmization and all debug options) 
     48 
     49[ -job x ]       : activate parallel compiling on x task, default is 1 task 
     50 
     51 
     52end_help 
    2653          exit;; 
    27  
    28       "-prod") 
    29           compil_mode="prod" ; shift ;; 
    30  
    31       "-dev") 
    32           compil_mode="dev" ; shift ;; 
    33  
    34       "-debug") 
    35           compil_mode="debug" ; shift ;; 
    36  
    37       "-arch") 
    38           arch=$2 ; arch_defined="TRUE"; shift ; shift ;; 
    39   
    40       "-arch_path") 
    41           arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;; 
    42  
    43       "-job") 
    44           job=$2 ; shift ; shift;; 
    45  
    46       "-full") 
    47           full_defined="TRUE" ; shift ;; 
    48  
     54      "-prod")        compil_mode="prod" ; shift ;; 
     55      "-dev")         compil_mode="dev" ; shift ;; 
     56      "-debug")       compil_mode="debug" ; shift ;; 
     57      "-arch")        arch=$2 ; arch_defined="TRUE"; shift ; shift ;; 
     58      "-arch_path")   arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;; 
     59      "-job")         job=$2 ; shift ; shift;; 
     60      "-full")        full_defined="TRUE" ; shift ;; 
    4961      *) 
    5062          code="$1" ; shift ;; 
     
    5769mkdir .void_dir 
    5870 
    59 if [[ "$arch_defined" == "TRUE" ]] 
    60 then 
     71if [[ "$arch_defined" == "TRUE" ]] ; then 
    6172  rm -f arch.path 
    6273  rm -f arch.fcm 
    6374  rm -f arch.env 
    6475 
    65   if test -f $arch_path/arch-${arch}.path 
    66   then 
     76  if [ -f $arch_path/arch-${arch}.path ] ;   then 
    6777    ln -s $arch_path/arch-${arch}.path arch.path 
    68   elif test -f $arch_default_path/arch-${arch}.path 
    69   then 
     78  elif [ -f $arch_default_path/arch-${arch}.path ] ;  then 
    7079    ln -s $arch_default_path/arch-${arch}.path arch.path 
    7180  else 
     
    7483  fi 
    7584         
    76   if test -f $arch_path/arch-${arch}.fcm 
    77   then 
     85  if [ -f $arch_path/arch-${arch}.fcm ] ; then 
    7886    ln -s $arch_path/arch-${arch}.fcm arch.fcm 
    79   elif test -f $arch_default_path/arch-${arch}.fcm 
    80   then 
     87  elif [ -f $arch_default_path/arch-${arch}.fcm ] ; then 
    8188    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm 
    8289  fi 
    8390 
    84   if test -f $arch_path/arch-${arch}.env 
    85   then 
     91  if [ -f $arch_path/arch-${arch}.env ] ; then 
    8692    ln -s $arch_path/arch-${arch}.env arch.env 
    87   elif test -f $arch_default_path/arch-${arch}.env 
    88   then 
     93  elif [ -f $arch_default_path/arch-${arch}.env ] ; then 
    8994    ln -s $arch_default_path/arch-${arch}.env arch.env 
    9095  else 
     
    9499  source arch.path 
    95100else 
    96   echo "Veuillez definir une architecture cible" 
     101  echo "You must define the architecture files using makeioipsl_fcm -arch XXX" 
     102  echo "Show help using: ./makeioipsl_fcm -h" 
    97103  exit 1 
    98104fi 
    99105LD_FLAGS="%BASE_LD" 
    100106 
    101 if [[ "$compil_mode" == "prod" ]] 
    102 then 
     107if [[ "$compil_mode" == "prod" ]] ; then 
    103108  COMPIL_FFLAGS="%PROD_FFLAGS" 
    104 elif [[ "$compil_mode" == "dev" ]] 
    105 then 
     109elif [[ "$compil_mode" == "dev" ]] ; then 
    106110  COMPIL_FFLAGS="%DEV_FFLAGS" 
    107 elif [[ "$compil_mode" == "debug" ]] 
    108 then 
     111elif [[ "$compil_mode" == "debug" ]] ; then 
    109112  COMPIL_FFLAGS="%DEBUG_FFLAGS" 
    110113fi 
     
    120123echo "%LIB $IOIPSL_LIB">> config.fcm 
    121124 
    122 if [[ "$full_defined" == "TRUE" ]] 
    123 then 
     125if [[ "$full_defined" == "TRUE" ]] ; then 
    124126  ./build.sh --job $job --full 
    125127else 
Note: See TracChangeset for help on using the changeset viewer.