Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Logging into the Marconi :

    Code Block
    ssh <USER_NAME>@login.marconi.cineca.it


  2. Change location to $WORK directory, which should point to /marconi_work/FUSIO_HLST :

    Code Block
    $: cd $WORK
    $: pwd
    /marconi_work/FUSIO_HLST


  3. Load GCC 7.3.0:

    Code Block
    module load gnu/7.3.0


  4. Prepare directories:

    Code Block
    $: mkdir -p IMAS_software/{cache,libs,modules,spack,stage}-{gcc,intel}
    $: mkdir -p IMAS_software/cache-{gcc,intel}/{cache,var,test}
    $: tree IMAS_software/
    IMAS_software/
    ├── cache-gcc
    │   ├── cache
    │   ├── test
    │   └── var
    ├── cache-intel
    │   ├── cache
    │   ├── test
    │   └── var
    ├── libs-gcc
    ├── libs-intel
    ├── modules-gcc
    ├── modules-intel
    ├── spack-gcc
    ├── spack-intel
    ├── stage-gcc
    └── stage-intel


  5. Clone spack repository to spack-gcc :

    Code Block
    git clone https://github.com/spack/spack.git spack-gcc


  6. Go into spack-gcc directory:

    Code Block
    cd spack-gcc


  7. Checkout desired version of spack :

    Code Block
    git checkout v0.19.0


  8. Set-up spack configuration:

    1. Go to directory where default configuration files are stored (assuming you're still inside spack-gcc repository):

      Code Block
      cd etc/spack/defaults/


    2. Edit config.yaml :

      Code Block
      vim config.yaml

      You need to change the root of the install_tree, projections for allbuild_stage dir, test_stage dir, source_cache dir and misc_cache dir.
      Example:

      1. root of the install_tree :

        Code Block
        config:
          # This is the path to the root of the Spack install tree.
          # You can use $spack here to refer to the root of the spack instance.
          install_tree:
            root: /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc


      2. projections :

        Code Block
        projections:
              all: "${PACKAGE}/${VERSION}/${COMPILERNAME}/${COMPILERVER}/${HASH}"


      3. build_stage :

        Code Block
          build_stage:
            - /marconi_work/FUSIO_HLST/IMAS_software/stage-gcc


      4. test_stage :

        Code Block
          test_stage: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/test


      5. source_cache :

        Code Block
          source_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/var/cache


      6. misc_cache :

        Code Block
          misc_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/cache


    3. Edit modules.yaml :

      Code Block
      vim modules.yaml

      Change the roots for the tcl modules:

      1. Example: 

        Code Block
          # These are configurations for the module set named "default"
          default:
            # Where to install modules
            roots:
             tcl:    /marconi_work/FUSIO_HLST/IMAS_software/modules-gcc


    4. Edit linux/modules.yaml :

      Code Block
      vim linux/modules.yaml

      Here you have to fill the whole body just to set the module structure projections:


      Code Block
      modules:
        default:
          arch_folder: false
          tcl:
            projections:
              all: '{name}/{version}/{compiler.name}/{compiler.version}/sha'
          prefix_inspections:
            lib:
              - LD_LIBRARY_PATH
            lib64:
              - LD_LIBRARY_PATH



  9. Change the directory to the top of the spack repository:

    Code Block
    cd ../../../
    


  10. Source spack :

    Code Block
    source share/spack/setup-env.sh


  11. Check the spack version - should be 0.19.0 :

    Code Block
    spack --version


  12. Install Lapack :

    Code Block
    spack install netlib-lapack %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  13. Install Blas :

    Code Block
    spack install -j 1 netlib-xblas %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  14. Install Python with tkinter support:

    Code Block
    spack install python +tkinter %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  15. Install py-scipy :

    Code Block
    spack install --fail-fast py-scipy %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  16. Install py-matplotlib :

    Code Block
    spack install --fail-fast py-matplotlib backend=tkagg %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  17. Install py-pyyaml :

    Code Block
    spack install --fail-fast py-pyyaml %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  18. Install hdf5 :

    Code Block
    spack install --fail-fast hdf5@1.12.2 %gcc@7.3.0 +threadsafe +cxx +fortran cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"


  19. Install boost :

    Code Block
    spack install --fail-fast boost %gcc@7.3.0 +python +numpy cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"


  20. Install blitz :

    Code Block
    spack install --fail-fast blitz@1.0.1 %gcc@7.3.0 cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"


  21. Install mdsplus :

    Code Block
    spack install --fail-fast mdsplus %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"


  22. Download Saxon :
    - it's required by IMAS, but Spack is missing proper recipe

    Code Block
    $: mkdir -p libs-gcc/saxon
    $: cd libs-gcc/saxon
    $: wget https://sourceforge.net/projects/saxon/files/Saxon-HE/9.9/SaxonHE9-9-1-5J.zip/download
    $: unzip download

    Create two softlinks:

    Code Block
    $: ln -s saxon9-test.jar saxon9he-test.jar
    $: ln -s saxon9-xqj.jar saxon9he-xqj.jar

    And set the saxon files available:

    Code Block
    chmod -R 777 .


  23. Prepare Saxon module:

    Code Block
    $: cd ../../
    $: mkdir -p modules-gcc/saxon
    $: vim modules-gcc/saxon/9.9

    And fill the created module with below content:

    Code Block
    #%Module
    ##
    ##      Modulefile for saxon
    ##	Maciej Smukowski 2022
    ##
    set fpath	[file dirname $ModulesCurrentModulefile]
    set VERSION	[file tail $ModulesCurrentModulefile]
    
    module-whatis "Enable the usage of saxon $VERSION.
    \tKeywords: math tool matlab"
    
    
    proc ModulesDisplay {} {
    }
    
    conflict saxon
    
    set SAXON_HOME /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/saxon
    prepend-path SAXON_HOME /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/saxon
    
    prepend-path    CLASSPATH $SAXON_HOME/saxon9he.jar
    prepend-path    CLASSPATH $SAXON_HOME/saxon9-test.jar
    prepend-path    CLASSPATH $SAXON_HOME/saxon9-xqj.jar
    prepend-path    CLASSPATH $SAXON_HOME/saxon9he-test.jar
    prepend-path    CLASSPATH $SAXON_HOME/saxon9he-xqj.jar


  24. Prepare spack-imasenv module prototype:

    Code Block
    $: mkdir -p modules/spack-imasenv/3.37.0/gcc
    $: vim modules/spack-imasenv/3.37.0/gcc/7.3.0

    And fill the created module with below content:

    Code Block
    #%Module
    ##
    ##      Modulefile for imasenv
    ##	Maciej Smukowski 2022
    ##
    
    module-whatis "One IMASENV module to rule them all"
    
    
    proc ModulesDisplay {} {
    }
    
    conflict imasenv
    
    # Add spack modules to MODULEPATH
    module use /marconi_work/FUSIO_HLST/IMAS_software/modules-gcc
    
    module load gnu/7.3.0
    module load cmake/3.25.0/gcc/7.3.0/sha-a4xv7cs
    module load pkgconf/1.8.0/gcc/7.3.0/sha-haasdgy
    module load netlib-lapack/3.10.1/gcc/7.3.0/sha-qyarwjw
    module load netlib-xblas/1.0.248/gcc/7.3.0/sha-7hrl4sf
    module load python/3.10.8/gcc/7.3.0/sha-ns7dn4v
    module load py-pip/22.2.2/gcc/7.3.0/sha-a3eh27l
    module load py-setuptools/59.4.0/gcc/7.3.0/sha-6ufe5bh
    module load py-wheel/0.37.1/gcc/7.3.0/sha-lw533jd
    module load py-cython/0.29.32/gcc/7.3.0/sha-ucdjw62
    module load py-pyyaml/6.0/gcc/7.3.0/sha-s7dm72x
    module load py-numpy/1.23.4/gcc/7.3.0/sha-4nr26mj
    module load py-scipy/1.8.1/gcc/7.3.0/sha-c5puafq
    module load py-matplotlib/3.6.2/gcc/7.3.0/sha-2sxscln
    module load hdf5/1.12.2/gcc/7.3.0/sha-hxkrksx
    module load openjdk/11.0.17_8/gcc/7.3.0/sha-impa6zh
    module load git
    module load blitz/1.0.1/gcc/7.3.0/sha-5jpnc3r
    module load boost/1.80.0/gcc/7.3.0/sha-nwvpbv4
    module load mdsplus/stable_release-7-96-17/gcc/7.3.0/sha-zwraez5
    module load libxml2/2.10.3/gcc/7.3.0/sha-p5tucjm

    DISCLAIMER!: If you're doing your spack installation from scratch be cautious about module names. The pattern is "sha-{hash}" , where hash is generated during installation, therefore your hashes will be different than mine.

  25. Load spack-imasenv module:

    Code Block
    $: module use /marconi_work/FUSIO_HLST/IMAS_software/modules
    $: module load spack-imasenv/3.37.0/gcc/7.3.0


  26. Load Saxon module:

    Code Block
    module load saxon/9.9


  27. Clone IMAS Installer :

    Code Block
    git clone ssh://git@git.iter.org/imas/installer.git imas-installer-gcc

    for convenience, let's loosen the read and write permissions for all files:

    Code Block
    chmod -R 777 .

    The top directory should look somewhat like this:

    Code Block
    drwxrwxrwx   6 interactive  4096 Dec  7 14:00 cache-gcc
    drwxrwxrwx   3 interactive  4096 Nov 16 13:47 cache-intel
    drwxrwxrwx   7 interactive  4096 Dec  8 12:19 imas-installer-gcc
    drwxrwxrwx 132 interactive 32768 Dec  8 11:50 libs-gcc
    drwxrwxrwx 120 interactive 32768 Nov 16 13:56 libs-intel
    drwxrwxrwx   3 interactive  4096 Dec  8 11:45 modules
    drwxrwxrwx 130 interactive 32768 Dec  8 12:19 modules-gcc
    drwxrwxrwx 120 interactive 32768 Nov 16 13:48 modules-intel
    drwxrwxrwx   3 interactive  4096 Nov 16 13:47 spack
    drwxrwxrwx   9 interactive  4096 Dec  7 23:44 spack-gcc
    drwxrwxrwx   3 interactive  4096 Dec  7 14:31 stage-gcc
    drwxrwxrwx   3 interactive  4096 Nov 16 13:43 stage-intel


  28. Create IMAS configuration script:

    Code Block
    vim imas-installer-gcc/3.37.0_4.11.0.sh

    and fill it with below content:

    Code Block
    export TAG_DD=3.37.0
    
    export TAG_AL=4.11.0
    # make sure these branches exist
    
    export VER_DD=$TAG_DD
    export VER_AL=$TAG_AL
    export IMAS_VERSION=$TAG_DD
    export UAL_VERSION=$TAG_AL
    export MODULE_FULL_VERSION=$VER_DD/AL/$VER_AL
    
    
    export IMAS_HOME=/marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/IMAS
    
    export IMAS_UDA=fat
    export IMAS_HDC=no
    
    export IMAS_CPP=yes
    
    export IMAS_FORTRAN=yes
    export IMAS_G95=no
    export IMAS_PGI=no
    export IMAS_IFORT=no
    export IMAS_GFORTRAN=yes
    export IMAS_NAGFOR=no
    
    export IMAS_JAVA=yes
    
    export IMAS_MATLAB=no
    export IMAS_PYTHON=yes
    export IMAS_PYTHON2=no
    export IMAS_PYTHON3=yes
    
    
    # After Installation Environment
    eval `./tools/imasdb.in test`
    
    export UAL=$(realpath ./src/$IMAS_VERSION/ual/$UAL_VERSION)
    export MY_INSTALL=$IMAS_HOME/core/IMAS/${VER_DD}/AL/${VER_AL}
    export IMAS_INSTALL_DIR=$MY_INSTALL
    export PYTHONPATH=$MY_INSTALL/python/lib/:$PYTHONPATH
    export CLASSPATH=$UAL/javainterface/build/:$CLASSPATH
    export IMAS_PREFIX=$MY_INSTALL/
    export ids_path="$MDSPLUS_TREE_BASE_0;$MY_INSTALL/models/mdsplus/;$ids_path"
    export LD_LIBRARY_PATH=$MY_INSTALL/lib:$LD_LIBRARY_PATH
    export TOKAMAKNAME=test
    export DATAVERSION=3

    Note that there are at least 3 places that should be customized:

    1. export TAG_DD=<desired_data_dictionary_tag>
    2. export TAG_AL=<desired_access_layer_tag>
    3. export IMAS_HOME=<your_IMAS_HOME_path>

  29. Go inside imas-installer-gcc directory:

    Code Block
    cd imas-installer-gcc


  30. Source IMAS configuration script:

    Code Block
    source 3.37.0_4.11.0.sh


  31. Download build files:

    Code Block
    make cache


  32. Check if everything is set-up correctly:

    Code Block
    make help


  33. Build and install IMAS :

    Code Block
    make install


Marconi + SPACK + INTEL

Gateway + SPACK + GNU

...