Ignore:
Timestamp:
01/22/19 16:15:03 (5 years ago)
Author:
yushan
Message:

dev on ADA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/make_xios

    r1157 r1638  
    55use_oasis="false" 
    66oasis="oasis3_mct" 
     7build_path="./" 
     8build_dir="./" 
     9build_suffixed="false" 
     10use_extern_boost="false" 
     11use_extern_blitz="false" 
    712use_memtrack="false" 
    813job="1" 
    914netcdf_lib="netcdf4_par" 
    1015compil_mode="prod" 
    11 arch_path="arch" 
    12 arch_default_path="arch" 
     16arch_path=$PWD/"arch" 
     17arch_default_path=$PWD/"arch" 
    1318arch_defined="FALSE" 
    1419arch_path_defined="FALSE" 
     
    2934            echo "       [--full] : to generate dependencies and recompile from scratch" 
    3035            echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler" 
     36        echo "       [--build_path : absolute path to the build directory" 
     37        echo "       [--build_dir : name of the build directory" 
     38        echo "       [--build_suffixed : generate automatically suffixed name of the build directory (e.g. config_X64_CURIE_prod)" 
     39        echo "       [--use_extern_boost : to use external boost library" 
     40        echo "       [--use_extern_blitz : to use external blitz library" 
    3141            echo "       [--doc] : to generate Doxygen documentation (not available yet)" 
    3242            echo "       [--job ntasks] : to use parallel compilation with ntasks" 
     
    4454         "--full")  compil_full="true"  ; shift ;; 
    4555         "--use_oasis")  use_oasis="true" oasis=$2 ; shift ; shift  ;; 
     56         "--build_path")  build_path=$2     ; shift ; shift ;; 
     57         "--build_dir")  build_dir=$2     ; shift ; shift ;; 
     58         "--build_suffixed")  build_suffixed="true" ; shift  ;; 
     59         "--use_extern_boost")  use_extern_boost="true" ; shift  ;; 
     60         "--use_extern_blitz")  use_extern_blitz="true" ; shift  ;; 
    4661         "--doc")   doc="true"          ; shift ;; 
    4762         "--job")   job=$2              ; shift ; shift ;; 
    4863         "--netcdf_lib")   netcdf_lib=$2 ; shift ; shift ;; 
    4964         "--memtrack")  use_memtrack="true" memtrack=$2  ; shift ; shift ;; 
    50           *)         code="$1"           ; shift ;; 
    51        esac 
    52     done 
     65         *)         code="$1"           ; shift ;; 
     66      esac 
     67   done 
    5368 
    5469# Installation des sources 
     
    5873    echo -e "- uncompress archives ..."          
    5974    for tarname in `ls $install_dir/tools/archive/*.tar.gz` ; do 
     75        if  ( [[ ${tarname} == "${install_dir}/tools/archive/boost.tar.gz" ]] && [[ "$use_extern_boost" == "true" ]] ) || ( [[ ${tarname} == "${install_dir}/tools/archive/blitz.tar.gz" ]] && [[ "$use_extern_blitz" == "true" ]] ) 
     76        then 
     77                continue 
     78        fi 
    6079        gunzip -f "$tarname" 
    6180        tar -xf ${tarname%.gz} 
    6281    done 
    6382fi 
     83 
     84# Definition of the root directory of the build 
     85 
     86if [[ "$build_path" == "./" ]]; then 
     87  install_dir=$PWD 
     88else 
     89  install_dir=${build_path} 
     90fi 
     91 
     92if [[ "$build_suffixed" == "true" ]]; then 
     93    install_dir="${install_dir}/config_${arch}_${compil_mode}" 
     94else 
     95    install_dir="${install_dir}/${build_dir}" 
     96fi 
     97 
     98mkdir -p $install_dir 
     99 
     100rm -f ${PWD}/bld_dir.cfg 
     101echo "inc    ${install_dir}/arch.fcm" >> ${PWD}/bld_dir.cfg  
     102echo "inc    ${install_dir}/config.fcm" >> ${PWD}/bld_dir.cfg 
     103echo "dir::root  ${install_dir}"   >> ${PWD}/bld_dir.cfg 
    64104 
    65105# Vérification de la présence d'un identifiant d'architecture. 
     
    77117if [[ "$arch_defined" == "TRUE" ]] 
    78118then 
    79   rm -f arch.path 
    80   rm -f arch.fcm 
    81   rm -f arch.env 
     119  rm -f ${install_dir}/arch.path 
     120  rm -f ${install_dir}/arch.fcm 
     121  rm -f ${install_dir}/arch.env 
    82122 
    83123  if test -f $arch_path/arch-${arch}.path 
    84124  then 
    85     ln -s $arch_path/arch-${arch}.path arch.path 
     125    ln -s $arch_path/arch-${arch}.path ${install_dir}/arch.path 
    86126  elif test -f $arch_default_path/arch-${arch}.path 
    87127  then 
    88     ln -s $arch_default_path/arch-${arch}.path arch.path 
     128    ln -s $arch_default_path/arch-${arch}.path ${install_dir}/arch.path 
    89129  fi 
    90130         
    91131  if test -f $arch_path/arch-${arch}.fcm 
    92132  then 
    93     ln -s $arch_path/arch-${arch}.fcm arch.fcm 
     133    ln -s $arch_path/arch-${arch}.fcm ${install_dir}/arch.fcm 
    94134  elif test -f $arch_default_path/arch-${arch}.fcm 
    95135  then 
    96     ln -s $arch_default_path/arch-${arch}.fcm arch.fcm 
     136    ln -s $arch_default_path/arch-${arch}.fcm ${install_dir}/arch.fcm 
    97137  fi 
    98138 
    99139  if test -f $arch_path/arch-${arch}.env 
    100140  then 
    101     ln -s $arch_path/arch-${arch}.env arch.env 
     141    ln -s $arch_path/arch-${arch}.env ${install_dir}/arch.env 
    102142  elif test -f $arch_default_path/arch-${arch}.env 
    103143  then 
    104     ln -s $arch_default_path/arch-${arch}.env arch.env 
     144    ln -s $arch_default_path/arch-${arch}.env ${install_dir}/arch.env 
    105145  else 
    106     ln -s .void_file arch.env 
     146    ln -s .void_file ${install_dir}/arch.env 
    107147  fi 
    108   source arch.env 
    109   source arch.path 
     148  source ${install_dir}/arch.env 
     149  source ${install_dir}/arch.path 
    110150else 
    111151      echo "Please choose a target achitecture --> list all available architecture using make_xios --avail!" 
     
    170210fi  
    171211 
     212# Setting path for boost 
     213if [[ "$use_extern_boost" == "true" ]] 
     214then 
     215   rm -r $PWD/extern/boost 
     216   ln -s $PWD/.void_dir $PWD/extern/boost 
     217else 
     218   export BOOST_INCDIR="-I${PWD}/extern/boost" 
     219   export BOOST_LIBDIR="" 
     220   export BOOST_LIB="" 
     221fi 
     222 
     223# Setting path for blitz 
     224if [[ "$use_extern_blitz" == "true" ]] 
     225then 
     226   rm -r $PWD/extern/blitz 
     227   ln -s $PWD/.void_dir $PWD/extern/blitz 
     228else 
     229   echo "src::blitz $PWD/extern/blitz/src" >> ${PWD}/bld_dir.cfg 
     230   export BLITZ_INCDIR="-I${PWD}/extern/blitz" 
     231   export BLITZ_LIBDIR="" 
     232   export BLITZ_LIB="" 
     233fi 
     234 
     235 
    172236if [[ "$use_memtrack" == "true" ]] 
    173237   then 
    174238   XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK" 
    175    if [[ "$memtrack" == "light" ]] 
    176     then 
    177         XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK_LIGHT" 
     239 
     240    if [[ "$memtrack" == "light" ]] 
     241    then 
     242        XIOS_CPPKEY="$XIOS_CPPKEY XIOS_MEMTRACK_LIGHT" 
    178243    elif [[ "$memtrack" == "FULL"  ]] 
    179244    then 
     
    186251fi  
    187252 
    188 XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR" 
    189 XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR" 
     253XIOS_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR" 
     254XIOS_FINCDIR="$NETCDF_INCDIR $XIOS_FINCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR" 
    190255 
    191256XIOS_LIB="$XIOS_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB" 
    192257 
    193 rm -f config.fcm 
    194 echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> config.fcm 
    195 echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> config.fcm 
    196 echo "%CPP_KEY       $XIOS_CPPKEY"   >> config.fcm 
    197  
    198 echo "%CBASE_INC     $XIOS_CINCDIR" >> config.fcm      
    199 echo "%FBASE_INC     $XIOS_FINCDIR" >> config.fcm 
    200 echo "%ARCH_LD       $XIOS_LIB"     >> config.fcm  
     258rm -f ${install_dir}/config.fcm 
     259echo "%COMPIL_CFLAGS $COMPIL_CFLAGS" >> ${install_dir}/config.fcm 
     260echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> ${install_dir}/config.fcm 
     261echo "%CPP_KEY       $XIOS_CPPKEY"   >> ${install_dir}/config.fcm 
     262 
     263echo "%CBASE_INC     $XIOS_CINCDIR" >> ${install_dir}/config.fcm      
     264echo "%FBASE_INC     $XIOS_FINCDIR" >> ${install_dir}/config.fcm 
     265echo "%ARCH_LD       $XIOS_LIB"     >> ${install_dir}/config.fcm  
    201266 
    202267echo "=> Using "$compil_mode" mode for compiling under architecture \""$arch"\" !" 
Note: See TracChangeset for help on using the changeset viewer.