Changeset 2743


Ignore:
Timestamp:
Jan 5, 2017, 4:39:47 PM (7 years ago)
Author:
Ehouarn Millour
Message:

Adapted makelmdz_fcm to be able to source an arch-*.env file, and also added option -arch_path to specify path to directory where arch files can be found.
Likewise adapted makelmdz with these options.
EM

Location:
LMDZ5/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/makelmdz

    r2690 r2743  
    3131strataer=false
    3232full=""
     33
     34arch_defined="FALSE"
     35arch_path="arch"
     36arch_default_path="arch"
    3337
    3438# guess a default 'arch'
     
    127131[-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
    128132[-ext_src path]            : path to an additional set of routines to compile with the model
     133[-arch_path path]          : path to architecture files (default: $arch_default_path)
    129134 -arch nom_arch            : target architecture
    130135 exec                      : executable to build
     
    204209
    205210      "-arch")
    206           arch=$2 ; shift ; shift ;;
     211          arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
     212
     213      "-arch_path")
     214          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
    207215
    208216      *)
     
    218226rm -rf .void_dir
    219227mkdir .void_dir
    220 rm -f arch.path
    221 if [[ -r arch/arch-${arch}.path ]]
    222 then
    223   ln -s arch/arch-${arch}.path ./arch.path
     228
     229if [[ "$arch_defined" == "TRUE" ]]
     230then
     231  rm -f arch.path
     232  rm -f arch.fcm
     233  rm -f arch.env
     234
     235  if test -f $arch_path/arch-${arch}.path
     236  then
     237    ln -s $arch_path/arch-${arch}.path arch.path
     238  elif test -f $arch_default_path/arch-${arch}.path
     239  then
     240    ln -s $arch_default_path/arch-${arch}.path arch.path
     241  fi
     242       
     243  if test -f $arch_path/arch-${arch}.fcm
     244  then
     245    ln -s $arch_path/arch-${arch}.fcm arch.fcm
     246  elif test -f $arch_default_path/arch-${arch}.fcm
     247  then
     248    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
     249  fi
     250
     251  if test -f $arch_path/arch-${arch}.env
     252  then
     253    ln -s $arch_path/arch-${arch}.env arch.env
     254  elif test -f $arch_default_path/arch-${arch}.env
     255  then
     256    ln -s $arch_default_path/arch-${arch}.env arch.env
     257  else
     258    ln -s .void_file arch.env
     259  fi
     260  # source architecture PATH and ENV files
     261  source arch.env
    224262  source arch.path
    225263else
    226   echo "Error: missing arch/arch-${arch}.path file !"
    227   exit
    228 fi
    229 rm -f arch.fcm
    230 if [[ -r arch/arch-${arch}.fcm ]]
    231 then
    232   ln -s arch/arch-${arch}.fcm arch.fcm
    233 else
    234   echo "Error: missing arch/arch-${arch}.fcm file !"
    235   exit
    236 fi
     264  echo "You must define a target architecture"
     265  exit 1
     266fi
     267
    237268########################################################################
    238269# Definition des clefs CPP, des chemins des includes et modules
  • LMDZ5/trunk/makelmdz_fcm

    r2690 r2743  
    3737full=''
    3838libphy=false
     39
     40arch_defined="FALSE"
     41arch_path="arch"
     42arch_default_path="arch"
    3943
    4044LMDGCM=`/bin/pwd`
     
    107111[-fcm_path path]           : path to the fcm tool (default: tools/fcm/bin)
    108112[-ext_src path]            : path to an additional set of routines to compile with the model
     113[-arch_path path]          : path to architecture files (default: $arch_default_path)
    109114 -arch nom_arch            : target architecture
    110115 exec                      : executable to build
     
    196201
    197202      "-arch")
    198           arch=$2 ; shift ; shift ;;
     203          arch=$2 ; arch_defined="TRUE" ; shift ; shift ;;
     204
     205      "-arch_path")
     206          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
    199207
    200208      *)
     
    226234rm -rf .void_dir
    227235mkdir .void_dir
    228 rm -f arch.path
    229 ln -s arch/arch-${arch}.path ./arch.path
    230 source arch.path
     236
     237if [[ "$arch_defined" == "TRUE" ]]
     238then
     239  rm -f arch.path
     240  rm -f arch.fcm
     241  rm -f arch.env
     242
     243  if test -f $arch_path/arch-${arch}.path
     244  then
     245    ln -s $arch_path/arch-${arch}.path arch.path
     246  elif test -f $arch_default_path/arch-${arch}.path
     247  then
     248    ln -s $arch_default_path/arch-${arch}.path arch.path
     249  fi
     250       
     251  if test -f $arch_path/arch-${arch}.fcm
     252  then
     253    ln -s $arch_path/arch-${arch}.fcm arch.fcm
     254  elif test -f $arch_default_path/arch-${arch}.fcm
     255  then
     256    ln -s $arch_default_path/arch-${arch}.fcm arch.fcm
     257  fi
     258
     259  if test -f $arch_path/arch-${arch}.env
     260  then
     261    ln -s $arch_path/arch-${arch}.env arch.env
     262  elif test -f $arch_default_path/arch-${arch}.env
     263  then
     264    ln -s $arch_default_path/arch-${arch}.env arch.env
     265  else
     266    ln -s .void_file arch.env
     267  fi
     268  # source architecture PATH and ENV files
     269  source arch.env
     270  source arch.path
     271else
     272  echo "You must define a target architecture"
     273  exit 1
     274fi
    231275
    232276########################################################################
Note: See TracChangeset for help on using the changeset viewer.