Procedure - Build XIOS

  1. Checkout xios-1.0 from the Xios SVN repository:

    svn co -r 703 http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-1.0 xios-1.0
  2. Within the XIOS 1.0 top-level directory (xios-1.0), navigate to the arch directory. Create three arch files for AArch64:

    • arch-AARCH64_ARM_LINUX.env

      Containing the key environment variables:

      export HDF5_INC_DIR=$HDF_INCLUDE_DIR
      export HDF5_LIB_DIR=$HDF_LIBRARY_DIR
      
      export NETCDF_INC_DIR=$NETCDF_INCLUDE_DIR
      export NETCDF_LIB_DIR=$NETCDF_LIBRARY_DIR
      
      export BOOST_INC_DIR=$BOOST_INCLUDEDIR
      export BOOST_LIB_DIR=$BOOST_LIBRARYDIR
      
      export BLITZ_INC_DIR=$BLITZ_INCLUDEDIR
      export BLITZ_LIB_DIR=""
    • arch-AARCH64_ARM_LINUX.path

      Containing the include and lib locations:

      NETCDF_INCDIR="-I $NETCDF_INC_DIR"
      NETCDF_LIBDIR="-L $NETCDF_LIB_DIR"
      NETCDF_LIB="-lnetcdff -lnetcdf"
      
      MPI_INCDIR=""
      MPI_LIBDIR=""
      MPI_LIB="-lcurl"
      
      HDF5_INCDIR="-I $HDF5_INC_DIR"
      HDF5_LIBDIR="-L $HDF5_LIB_DIR"
      HDF5_LIB="-lhdf5_hl -lhdf5 -lhdf5 -lz"
      
      BOOST_INCDIR="-I $BOOST_INC_DIR"
      BOOST_LIBDIR="-L $BOOST_LIB_DIR"
      BOOST_LIB=""
      
      BLITZ_INCDIR="-I $BLITZ_INC_DIR"
      BLITZ_LIBDIR=""
      BLITZ_LIB=""
    • arch-AARCH64_ARM_LINUX.fcm

      Containing the details of the compiler build and flags:

      #####################################################################
      #############        Projet xios - xmlioserver       ################
      #####################################################################
          %CCOMPILER      mpicc
          %FCOMPILER      mpifort
          %LINKER         mpifort
          %BASE_CFLAGS    -ansi -w -D_GLIBCXX_USE_CXX11_ABI=0
          %PROD_CFLAGS    -O3 -DBOOST_DISABLE_ASSERTS
          %DEV_CFLAGS     -g -O2
          %DEBUG_CFLAGS   -g
          %BASE_FFLAGS    -D__NONE__
          %PROD_FFLAGS    -O3
          %DEV_FFLAGS     -g -O2
          %DEBUG_FFLAGS   -g
          %BASE_INC       -D__NONE__
          %BASE_LD        -lstdc++
          %CPP            cpp
          %FPP            cpp -P
          %MAKE           gmake
  3. To allow building with external boost and blitz++ libraries, in the top-level xios-1.0 directory:

    1. Modify the bld.cfg file:

      sed -i -e 's/src::date/#src::date/' bld.cfg
      sed -i -e 's/src::blitz/#src::blitz/' bld.cfg
    2. Update the make_xios file by applying this patch:

      --- make_xios.old   2018-07-18 12:30:04.735527495 +0100
      +++ make_xios   2018-04-10 16:33:51.000000000 +0100
      @@ -3,6 +3,8 @@
       install_dir=$PWD
       compil_full="false"
       use_oasis="false"
      +use_extern_boost="false"
      +use_extern_blitz="false"
       oasis="oasis3_mct"
       use_memtrack="false"
       job="1"
      @@ -24,6 +26,8 @@
              echo "       [--avail] : to know available target architectures "
              echo "       [--full] : to generate dependencies and recompile from scratch"
              echo "       [--use_oasis 'oasis3' 'oasis3_mct' : default oasis3_mct] : to use Oasis coupler"
      +        echo "       [--use_extern_boost : to use external boost library"
      +        echo "       [--use_extern_blitz : to use external blitz library"
              echo "       [--doc] : to generate Doxygen documentation (not available yet)"
              echo "       [--job ntasks] : to use parallel compilation with ntasks"
              echo "       [--netcdf_lib 'netcdf4_par'/'netcdf4_seq'/'netcdf4_internal' : default netcdf4_par] : choice of netcdf library"
      @@ -38,6 +42,8 @@
                "--avail") ls arch/*.fcm | cut -d"-" -f2 | cut -d"." -f1 ; exit ;;
                "--full")  compil_full="true"  ; shift ;;
                "--use_oasis")  use_oasis="true" oasis=$2 ; shift ; shift  ;;
      +         "--use_extern_boost")  use_extern_boost="true" ; shift  ;;
      +         "--use_extern_blitz")  use_extern_blitz="true" ; shift  ;;
                "--doc")   doc="true"          ; shift ;;
                "--job")   job=$2              ; shift ; shift ;;
                "--netcdf_lib")   netcdf_lib=$2 ; shift ; shift ;;
      @@ -52,6 +58,10 @@
       then
           echo -e "- uncompress archives ..."        
           for tarname in `ls $install_dir/tools/archive/*.tar.gz` ; do
      +        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" ]] )
      +        then
      +                continue
      +        fi
          gunzip -f "$tarname"
          tar -xf ${tarname%.gz}
           done
      @@ -148,13 +158,38 @@
           XMLIO_LIB="$OASIS_LIBDIR $OASIS_LIB $XMLIO_LIB"
       fi

      +# Setting path for boost
      +if [[ "$use_extern_boost" == "true" ]]
      +then
      +   rm -r $PWD/extern/boost
      +   ln -s $PWD/.void_dir $PWD/extern/boost
      +else
      +   export BOOST_INCDIR="-I${PWD}/extern/boost"
      +   export BOOST_LIBDIR=""
      +   export BOOST_LIB=""
      +fi
      +
      +# Setting path for blitz
      +if [[ "$use_extern_blitz" == "true" ]]
      +then
      +   rm -r $PWD/extern/blitz
      +   ln -s $PWD/.void_dir $PWD/extern/blitz
      +else
      +   export BLITZ_INCDIR="-I${PWD}/extern/blitz"
      +   export BLITZ_LIBDIR=""
      +   export BLITZ_LIB=""
      +fi
      +
      +
      +
       if [[ "$use_memtrack" == "true" ]]
          then
          XMLIO_LIB="$ADDR2LINE_LIBDIR $ADDR2LINE_LIB $XMLIO_LIB"
          XMLIO_CPPKEY="$XMLIO_CPPKEY XIOS_MEMTRACK"
       fi

      -XMLIO_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR"
      +# XMLIO_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR"
      +XMLIO_CINCDIR="$NETCDF_INCDIR $HDF5_INCDIR $MPI_INCDIR $BOOST_INCDIR $BLITZ_INCDIR"
       XMLIO_FINCDIR="$XMLIO_FINCDIR $MPI_INCDIR"

       XMLIO_LIB="$XMLIO_LIB $NETCDF_LIBDIR $HDF5_LIBDIR $MPI_LIBDIR $NETCDF_LIB $HDF5_LIB $MPI_LIB
  4. Build the XIOS library, and set the XIOS_DIR environment variable:

    ./make_xios --dev --job 32 --full --arch AARCH64_ARM_LINUX
    export XIOS_DIR=`pwd`
Previous Next