Detailed specification of the task, requirements and comments are here: https://trello.com/c/c5tyJ2ke

After task is finished, this page should contain step by step instruction for each and every installation

1.  Installation of SPACK

  1. Load GCC 7.3.0:

    module load gnu/7.3.0
  2. Prepare directories:

    $: mkdir -p <ROOT_DIR>/{cache,libs,modules,spack,stage}-{<compiler_names>}
    $: mkdir -p <ROOT_DIR>/cache-{<compiler_names>}/{cache,var,test}
    $: tree <ROOT_DIR/
    <ROOT_DIR>/
    ├── cache-compiler_x
    │   ├── cache
    │   ├── test
    │   └── var
    ├── cache-compiler_y
    │   ├── cache
    │   ├── test
    │   └── var
    ├── libs-compiler_x
    ├── libs-compiler_y
    ├── modules-compiler_x
    ├── modules-compiler_y
    ├── spack-compiler_x
    ├── spack-compiler_y
    ├── stage-compiler_x
    └── stage-compiler_y
  3. Clone spack repository to spack-gcc :

    git clone https://github.com/spack/spack.git spack-compiler_name
  4. Go into spack-gcc directory:

    cd spack-compiler_name
  5. Checkout desired version of spack :

    git checkout v0.19.0
  6. Set-up spack configuration:

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

      cd etc/spack/defaults/
    2. Edit config.yaml :

      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 :

        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: <path_prefix>/<ROOT_DIR>/libs-compiler_name
      2. projections :

        projections:
              all: "${PACKAGE}/${VERSION}/${COMPILERNAME}/${COMPILERVER}/${HASH}"
      3. build_stage :

          build_stage:
            - <path_prefix>/<ROOT_DIR>/stage-compiler_name
      4. test_stage :

          test_stage: <path_prefix>/<ROOT_DIR>/cache-compiler_name/test
      5. source_cache :

          source_cache: <path_prefix>/<ROOT_DIR>/cache-compiler_name/var/cache
      6. misc_cache :

          misc_cache: <path_prefix>/<ROOT_DIR>/cache-compiler_name/cache
    3. Edit modules.yaml :

      vim modules.yaml

      Change the roots for the tcl modules:

      1. Example: 

          # These are configurations for the module set named "default"
          default:
            # Where to install modules
            roots:
             tcl:    <path_prefix>/<ROOT_DIR>/modules-compiler_name
    4. Edit linux/modules.yaml :

      vim linux/modules.yaml

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

      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
  7. Change the directory to the top of the spack repository:

    cd ../../../
    
  8. Source spack :

    source share/spack/setup-env.sh
  9. Check the spack version - should be 0.19.0 :

    spack --version

2. Marconi + SPACK + GNU

This instruction covers all actions and commands from logging into the Marconi server to installing imasenv.

  1. Logging into the Marconi :

    ssh <USER_NAME>@login.marconi.cineca.it
  2. Change location to $WORK directory, which should point to /marconi_work/FUSIO_HLST :

    $: cd $WORK
    $: pwd
    /marconi_work/FUSIO_HLST
  3. Load GCC 7.3.0:

    module load gnu/7.3.0
  4. Prepare directories:

    $: 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. Go into IMAS_software directory:

    cd IMAS_software
  6. Clone spack repository to spack-gcc :

    git clone https://github.com/spack/spack.git spack-gcc
  7. Go into spack-gcc directory:

    cd spack-gcc
  8. Checkout desired version of spack :

    git checkout v0.19.0
  9. Set-up spack configuration:

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

      cd etc/spack/defaults/
    2. Edit config.yaml :

      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 :

        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 :

        projections:
              all: "${PACKAGE}/${VERSION}/${COMPILERNAME}/${COMPILERVER}/${HASH}"
      3. build_stage :

          build_stage:
            - /marconi_work/FUSIO_HLST/IMAS_software/stage-gcc
      4. test_stage :

          test_stage: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/test
      5. source_cache :

          source_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/var/cache
      6. misc_cache :

          misc_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-gcc/cache
    3. Edit modules.yaml :

      vim modules.yaml

      Change the roots for the tcl modules:

      1. Example: 

          # 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 :

      vim linux/modules.yaml

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

      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
  10. Change the directory to the top of the spack repository:

    cd ../../../
    
  11. Source spack :

    source share/spack/setup-env.sh
  12. Check the spack version - should be 0.19.0 :

    spack --version
  13. Install Lapack :

    spack install netlib-lapack %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  14. Install Blas :

    spack install -j 1 netlib-xblas %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  15. Install Python with tkinter support:

    spack install python +tkinter %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  16. Install py-scipy :

    spack install --fail-fast py-scipy %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  17. Install py-matplotlib :

    spack install --fail-fast py-matplotlib backend=tkagg %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  18. Install py-pyyaml :

    spack install --fail-fast py-pyyaml %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  19. Install hdf5 :

    spack install --fail-fast hdf5@1.12.2 %gcc@7.3.0 +threadsafe +cxx +fortran cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  20. Install boost :

    spack install --fail-fast boost %gcc@7.3.0 +python +numpy cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  21. Install blitz :

    spack install --fail-fast blitz@1.0.1 %gcc@7.3.0 cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  22. Install mdsplus :

    spack install --fail-fast mdsplus %gcc@7.3.0 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  23. Download Saxon :
    - it's required by IMAS, but Spack is missing proper recipe

    $: 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:

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

    And set the saxon files available:

    chmod -R 777 .
  24. Prepare Saxon module:

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

    And fill the created module with below content:

    #%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
  25. Prepare spack-imasenv module prototype:

    $: 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:

    #%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.

  26. Load spack-imasenv module:

    $: module use /marconi_work/FUSIO_HLST/IMAS_software/modules
    $: module load spack-imasenv/3.37.0/gcc/7.3.0
  27. Load Saxon module:

    module load saxon/9.9
  28. Clone IMAS Installer :

    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:

    chmod -R 777 .

    The top directory should look somewhat like this:

    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
  29. Create IMAS configuration script:

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

    and fill it with below content:

    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>

  30. Go inside imas-installer-gcc directory:

    cd imas-installer-gcc
  31. Source IMAS configuration script:

    source 3.37.0_4.11.0.sh
  32. Download build files:

    make cache
  33. Check if everything is set-up correctly:

    make help
  34. Build and install IMAS :

    make install
  35. Leave the imas-installer-gcc directory:

    cd ..
  36. Extend spack-imasenv modulefile:

    vim modules/spack-imasenv/3.37.0/gcc/7.3.0
    1. Add path to IMAS module:

      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/IMAS/etc/modulefiles
    2. Add loading of the IMAS module:

      module load IMAS/3.37.0/AL/4.11.0
    3. Final spack-imasenv module:

      #%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 use /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/IMAS/etc/modulefiles
      
      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-c5ljmas
      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
      
      module load IMAS/3.37.0/AL/4.11.0

3. Marconi + SPACK + INTEL

This instruction covers all actions and commands from logging into the Marconi server to installing imasenv.

  1. Logging into the Marconi :

    ssh <USER_NAME>@login.marconi.cineca.it
  2. Change location to $WORK directory, which should point to /marconi_work/FUSIO_HLST :

    $: cd $WORK
    $: pwd
    /marconi_work/FUSIO_HLST
  3. Load GCC 7.3.0 and then INTEL 2020:

    $: module load gnu/7.3.0
    $: module load intel/pe-xe-2020--binary
  4. Prepare directories:

    $: 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. Go into IMAS_software directory:

    cd IMAS_software
  6. Clone spack repository to spack-intel :

    git clone https://github.com/spack/spack.git spack-intel
  7. Go into spack-intel directory:

    cd spack-intel
  8. Checkout desired version of spack :

    git checkout v0.19.0
  9. Set-up spack configuration:

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

      cd etc/spack/defaults/
    2. Edit config.yaml :

      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 :

        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-intel
      2. projections :

        projections:
              all: "${PACKAGE}/${VERSION}/${COMPILERNAME}/${COMPILERVER}/${HASH}"
      3. build_stage :

          build_stage:
            - /marconi_work/FUSIO_HLST/IMAS_software/stage-intel
      4. test_stage :

          test_stage: /marconi_work/FUSIO_HLST/IMAS_software/cache-intel/test
      5. source_cache :

          source_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-intel/var/cache
      6. misc_cache :

          misc_cache: /marconi_work/FUSIO_HLST/IMAS_software/cache-intel/cache
    3. Edit modules.yaml :

      vim modules.yaml

      Change the roots for the tcl modules:

      1. Example: 

          # These are configurations for the module set named "default"
          default:
            # Where to install modules
            roots:
             tcl:    /marconi_work/FUSIO_HLST/IMAS_software/modules-intel
    4. Edit linux/modules.yaml :

      vim linux/modules.yaml

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

      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
  10. Change the directory to the top of the spack repository:

    cd ../../../
    
  11. Source spack :

    source share/spack/setup-env.sh
  12. Check the spack version - should be 0.19.0 :

    spack --version
  13. Install Lapack :

    spack install netlib-lapack %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  14. Install Blas :

    spack install -j 1 netlib-xblas %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  15. Install Python with tkinter support:

    spack install python +tkinter %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  16. Install py-scipy :

    spack install --fail-fast py-scipy %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  17. Install py-matplotlib :

    spack install --fail-fast py-matplotlib backend=tkagg %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  18. Install py-pyyaml :

    spack install --fail-fast py-pyyaml %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  19. Install hdf5 :

    spack install --fail-fast hdf5@1.12.2 %intel@19.1.3.304 +threadsafe +cxx +fortran cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  20. Install boost :

    spack install --fail-fast boost %intel@19.1.3.304 +python +numpy cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  21. Install blitz :

    spack install --fail-fast blitz@1.0.1 %intel@19.1.3.304 cflags="'-fPIC -pthread'" cxxflags="'-fPIC -pthread'" cppflags="'-fPIC -pthread'"
  22. Install mdsplus :

    spack install --fail-fast mdsplus %intel@19.1.3.304 cflags="-fPIC" cxxflags="-fPIC" cppflags="-fPIC"
  23. Download Saxon :
    - it's required by IMAS, but Spack is missing proper recipe

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

    Create two softlinks:

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

    And set the saxon files available:

    chmod -R 777 .
  24. Prepare Saxon module:

    $: cd ../../
    $: mkdir -p modules-intel/saxon
    $: vim modules-intel/saxon/9.9

    And fill the created module with below content:

    #%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-intel/saxon
    prepend-path SAXON_HOME /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/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
  25. Prepare spack-imasenv module prototype:

    $: mkdir -p modules/spack-imasenv/3.37.0/intel
    $: vim modules/spack-imasenv/3.37.0/intel/2020

    And fill the created module with below content:

    #%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 use /marconi_work/FUSIO_HLST/IMAS_software/modules-intel
    
    module load gnu/7.3.0
    module load intel/pe-xe-2020--binary
    module load intelmpi/2020--binary
    module load cmake/3.25.0/gcc/7.3.0/sha-a4xv7cs
    module load pkgconf/1.8.0/intel/19.1.3.304/sha-fbevp5q
    module load netlib-lapack/3.10.1/intel/19.1.3.304/sha-g4e3xak
    module load netlib-xblas/1.0.248/intel/19.1.3.304/sha-zp4t7zq
    module load python/3.10.8/intel/19.1.3.304/sha-ufy2r2o
    module load py-pip/22.2.2/intel/19.1.3.304/sha-ksiszmp
    module load py-setuptools/59.4.0/intel/19.1.3.304/sha-p6m2okz
    module load py-wheel/0.37.1/intel/19.1.3.304/sha-h5qnby4
    module load py-cython/0.29.32/intel/19.1.3.304/sha-ekt45in
    module load py-pyyaml/6.0/intel/19.1.3.304/sha-e7pj6rd
    module load py-numpy/1.22.4/intel/19.1.3.304/sha-vtkr2zd
    module load py-scipy/1.8.1/intel/19.1.3.304/sha-j7sstl3
    module load py-matplotlib/3.6.2/intel/19.1.3.304/sha-wbwigpl
    module load hdf5/1.12.2/intel/19.1.3.304/sha-lpavud5
    module load openjdk/11.0.17_8/intel/19.1.3.304/sha-nwh5yaq
    module load git
    module load blitz/1.0.1/intel/19.1.3.304/sha-gpct7uz
    module load boost/1.80.0/intel/19.1.3.304/sha-6erl3nf
    module load mdsplus/stable_release-7-96-17/intel/19.1.3.304/sha-jiasz6w
    module load libxml2/2.10.1/intel/19.1.3.304/sha-3te5l7z

    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.

  26. Load spack-imasenv module:

    $: module use /marconi_work/FUSIO_HLST/IMAS_software/modules
    $: module load spack-imasenv/3.37.0/intel/2020
  27. Load Saxon module:

    module load saxon/9.9
  28. Clone IMAS Installer :

    git clone ssh://git@git.iter.org/imas/installer.git imas-installer-intel

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

    chmod -R 777 .

    The top directory should look somewhat like this:

    drwxrwxrwx   6 interactive  4096 Dec  7 14:00 cache-gcc
    drwxrwxrwx   4 interactive  4096 Dec 10 16:45 cache-intel
    drwxrwxrwx  10 interactive  4096 Dec  8 15:42 imas-installer-gcc
    drwxrwxrwx   7 interactive  4096 Dec 11 22:43 imas-installer-intel
    drwxrwxrwx 135 interactive 32768 Dec 10 16:28 libs-gcc
    drwxrwxrwx 118 interactive 32768 Dec 11 22:29 libs-intel
    drwxrwxrwx   3 interactive  4096 Dec  8 11:45 modules
    drwxrwxrwx 132 interactive 32768 Dec 10 16:28 modules-gcc
    drwxrwxrwx 124 interactive 32768 Dec 11 22:30 modules-intel
    drwxrwxrwx   9 interactive  4096 Dec  7 23:44 spack-gcc
    drwxr-xr-x   9 interactive  4096 Dec 10 16:38 spack-intel
    drwxrwxrwx   3 interactive  4096 Dec  7 14:31 stage-gcc
    drwxrwxrwx   3 interactive  4096 Dec 10 16:44 stage-intel
  29. Create IMAS configuration script:

    vim imas-installer-intel/3.37.0_4.11.0.sh

    and fill it with below content:

    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-intel/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=yes
    export IMAS_GFORTRAN=no
    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>

  30. Go inside imas-installer-intel directory:

    cd imas-installer-intel
  31. Source IMAS configuration script:

    source 3.37.0_4.11.0.sh
  32. Download build files:

    make cache
  33. Edit Makefile.common file to not use GNU compilers by default:

    src/3.37.0/ual/4.11.0/Makefile.common
    1. Line 105 change to:

      CC ?= gcc
    2. Line 106 change to: 

      CXX ?= g++
  34. Check if everything is set-up correctly:

    make help
  35. Build and install IMAS :

    make install
    1. Caution!
      During IMAS installation under INTEL-2020 compiler you may encounter following error:

      #error Blitz is configured with --enable-threadsafe, but no compiler thread support is found. Did you forget, e.g., "--pthread"?

      Issue description: Known issues - Intel 2020#BLITZandmissing-pthreadflag

      FIX:

      1. Edit Blitz pkgconfig:

        vim /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/blitz/1.0.1/intel/19.1.3.304/gpct7uzeeiprapilq7oygmwdthhvcw24/lib/pkgconfig/blitz.pc
      2. Set 12 line to use pthread Cflag:

        Cflags: -I${includedir} -pthread
  36. Leave the imas-installer-intel directory:

    cd ..
  37. Extend spack-imasenv modulefile:

    vim modules/spack-imasenv/3.37.0/intel/2020
    1. Add path to IMAS module:

      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/etc/modulefiles
    2. Add loading of the IMAS module:

      module load IMAS/3.37.0/AL/4.11.0
    3. Final spack-imasenv module:

      #%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 use /marconi_work/FUSIO_HLST/IMAS_software/modules-intel
      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/etc/modulefiles
      
      module load gnu/7.3.0
      module load intel/pe-xe-2020--binary
      module load intelmpi/2020--binary
      module load cmake/3.25.0/gcc/7.3.0/sha-a4xv7cs
      module load pkgconf/1.8.0/intel/19.1.3.304/sha-fbevp5q
      module load netlib-lapack/3.10.1/intel/19.1.3.304/sha-g4e3xak
      module load netlib-xblas/1.0.248/intel/19.1.3.304/sha-zp4t7zq
      module load python/3.10.8/intel/19.1.3.304/sha-ufy2r2o
      module load py-pip/22.2.2/intel/19.1.3.304/sha-ksiszmp
      module load py-setuptools/59.4.0/intel/19.1.3.304/sha-p6m2okz
      module load py-wheel/0.37.1/intel/19.1.3.304/sha-h5qnby4
      module load py-cython/0.29.32/intel/19.1.3.304/sha-ekt45in
      module load py-pyyaml/6.0/intel/19.1.3.304/sha-e7pj6rd
      module load py-numpy/1.22.4/intel/19.1.3.304/sha-vtkr2zd
      module load py-scipy/1.8.1/intel/19.1.3.304/sha-j7sstl3
      module load py-matplotlib/3.6.2/intel/19.1.3.304/sha-wbwigpl
      module load hdf5/1.12.2/intel/19.1.3.304/sha-lpavud5
      module load openjdk/11.0.17_8/intel/19.1.3.304/sha-nwh5yaq
      module load git
      module load blitz/1.0.1/intel/19.1.3.304/sha-gpct7uz
      module load boost/1.80.0/intel/19.1.3.304/sha-6erl3nf
      module load mdsplus/stable_release-7-96-17/intel/19.1.3.304/sha-jiasz6w
      module load libxml2/2.10.1/intel/19.1.3.304/sha-3te5l7z
      
      module load IMAS/3.37.0/AL/4.11.0
  38. Create temp-intel  directory:

    mkdir temp-intel
  39. Go inside temp-intel directory:

    cd temp-intel
  40. Clone IDStools :

    git clone ssh://git@git.iter.org/imas/idstools.git
  41. Go into IDStools directory:

    cd idstools
  42. Build IDStools :

    make all
  43. Install IDStools :

    make install
  44. Leave temp directory:

    cd ../..
  45. Update spack-imasenv/3.37.0/intel/2020 module to use IDStools :

    vim modules/spack-imasenv/3.37.0/intel/2020
    1. Use path to IDStools module:

      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/etc/modulefiles
    2. Load IDStools modules:

      module load idstools/1.13.1
    3. Updated spack-imasenv/3.37.0/intel/2020 module:

      #%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 use /marconi_work/FUSIO_HLST/IMAS_software/modules-intel
      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/etc/modulefiles
      
      module load gnu/7.3.0
      module load intel/pe-xe-2020--binary
      module load intelmpi/2020--binary
      module load cmake/3.25.0/gcc/7.3.0/sha-a4xv7cs
      module load pkgconf/1.8.0/intel/19.1.3.304/sha-fbevp5q
      module load netlib-lapack/3.10.1/intel/19.1.3.304/sha-g4e3xak
      module load netlib-xblas/1.0.248/intel/19.1.3.304/sha-zp4t7zq
      module load python/3.10.8/intel/19.1.3.304/sha-ufy2r2o
      module load py-pip/22.2.2/intel/19.1.3.304/sha-ksiszmp
      module load py-setuptools/59.4.0/intel/19.1.3.304/sha-p6m2okz
      module load py-wheel/0.37.1/intel/19.1.3.304/sha-h5qnby4
      module load py-cython/0.29.32/intel/19.1.3.304/sha-ekt45in
      module load py-pyyaml/6.0/intel/19.1.3.304/sha-e7pj6rd
      module load py-numpy/1.22.4/intel/19.1.3.304/sha-vtkr2zd
      module load py-scipy/1.8.1/intel/19.1.3.304/sha-j7sstl3
      module load py-matplotlib/3.6.2/intel/19.1.3.304/sha-wbwigpl
      module load hdf5/1.12.2/intel/19.1.3.304/sha-lpavud5
      module load openjdk/11.0.17_8/intel/19.1.3.304/sha-nwh5yaq
      module load git
      module load blitz/1.0.1/intel/19.1.3.304/sha-gpct7uz
      module load boost/1.80.0/intel/19.1.3.304/sha-6erl3nf
      module load mdsplus/stable_release-7-96-17/intel/19.1.3.304/sha-jiasz6w
      module load libxml2/2.10.1/intel/19.1.3.304/sha-3te5l7z
      
      module load IMAS/3.37.0/AL/4.11.0
      module load idstools/1.13.1
  46. Reaload the spack-imasenv/3.37.0/intel/2020 and check the idsdump command to verify IDStools installation:

    $: module purge
    $: module load spack-imasenv/3.37.0/intel/2020
    $: idsdump --help
    1. If normal help manual is printed then the installation is correct.
    2. In case of the following error:

      -bash: /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/core/idstools/1.13.1/bin/idsdump: /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/python/3.10.8/intel/19.1.3.3: bad interpreter: No such file or directory

      The shebang line with python interpreter is longer than 128 characters which is usually a limit set by the kernel. Workaround:

      1. Go to the python installation directory, under the compiler name directory:

        cd /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/python/3.10.8/intel/
      2. Create a symlink with shorter name than 19.1.3.304, e.g. 2020 :

        ln -s 19.1.3.304 2020
      3. Now you have to edit each IDStools command script and replace the shebang line with symlink line:

        vim /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/core/idstools/1.13.1/bin/idsdump

        Delete line:

        DEL: #!/marconi_work/FUSIO_HLST/IMAS_software/libs-intel/python/3.10.8/intel/19.1.3.304/ufy2r2oat5k6zgn7w5ci26pillyjqtfd/./bin/python

        Insert line:

        INSERT: #!/marconi_work/FUSIO_HLST/IMAS_software/libs-intel/python/3.10.8/intel/2020/ufy2r2oat5k6zgn7w5ci26pillyjqtfd/./bin/python

        The two actions above has to be repeated for each IDStools command that fails to use the Intel-Python interpreter!

  47. Get back to the IMAS_software directory:

    cd /marconi_work/FUSIO_HLST/IMAS_software/
  48. Create directory for XMLLIB - INTEL installation:

    mkdir -p libs-intel/xmllib/3.3.1/intel/19.1.3.304
  49. Go to the temp-intel directory:

    cd temp-intel
  50. Clone XMLLIB :

    git clone ssh://git@git.iter.org/lib/xmllib.git
  51. Change directory to xmllib :

    cd xmllib
  52. Checkout 3.3.1 version:

    git checkout 3.3.1
  53. Clean up all:

    git clean -f -x -d
  54. Optionally launch bootsrap:

    ./bootstrap
  55. Run configure :

    ./configure --prefix=/marconi_work/FUSIO_HLST/IMAS_software/libs-intel/xmllib/3.3.1/intel/19.1.3.304 FC=ifort CC=icc
  56. Build XMLLIB :

    make all
  57. Check XMLLIB build:

    make check
  58. Install XMLLIB :

    make install
  59. Leave directory:

    cd ../..
  60. Create modulefile for XMLLIB :

    1. Create module directory:

      mkdir -p modules-intel/xmllib/3.3.1/intel/
    2. Create modulefile:

      vim modules-intel/xmllib/3.3.1/intel/19.1.3.304
    3. Fill it with below content:

      #%Module1.0#####################################################################
      ##
      ## xmllib modulefile
      ##
      set ver 3.3.1
      set name xmllib
      set loading [module-info mode load]
      set desc "Library to assist parsing of XML data"
      proc ModulesHelp { } {
      puts stderr "\tThis module sets the environment for $name v$ver"
      }
      conflict $name
      
      prereq   intel/pe-xe-2020--binary
      
      
      module-whatis "$desc (v$ver)"
      set prefix /marconi_work/FUSIO_HLST/IMAS_software/libs-gcc/xmllib/3.3.1/intel/19.1.3.304
      set exec_prefix ${prefix}
      prepend-path CPATH ${prefix}/include
      prepend-path LD_LIBRARY_PATH ${exec_prefix}/lib
      prepend-path PKG_CONFIG_PATH ${exec_prefix}/lib/pkgconfig
  61. Update spack-imasenv/3.37.0/intel/2020 :

    vim modules/spack-imasenv/3.37.0/intel/2020
    1. Add load of the XMLLIB  module:

      module load xmllib/3.3.1/intel/19.1.3.304
    2. Full module:

      #%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 use /marconi_work/FUSIO_HLST/IMAS_software/modules-intel
      module use /marconi_work/FUSIO_HLST/IMAS_software/libs-intel/IMAS/etc/modulefiles
      
      module load gnu/7.3.0
      module load intel/pe-xe-2020--binary
      module load intelmpi/2020--binary
      module load cmake/3.25.0/gcc/7.3.0/sha-a4xv7cs
      module load pkgconf/1.8.0/intel/19.1.3.304/sha-fbevp5q
      module load netlib-lapack/3.10.1/intel/19.1.3.304/sha-g4e3xak
      module load netlib-xblas/1.0.248/intel/19.1.3.304/sha-zp4t7zq
      module load python/3.10.8/intel/19.1.3.304/sha-ufy2r2o
      module load py-pip/22.2.2/intel/19.1.3.304/sha-ksiszmp
      module load py-setuptools/59.4.0/intel/19.1.3.304/sha-p6m2okz
      module load py-wheel/0.37.1/intel/19.1.3.304/sha-h5qnby4
      module load py-cython/0.29.32/intel/19.1.3.304/sha-ekt45in
      module load py-pyyaml/6.0/intel/19.1.3.304/sha-e7pj6rd
      module load py-numpy/1.22.4/intel/19.1.3.304/sha-vtkr2zd
      module load py-scipy/1.8.1/intel/19.1.3.304/sha-j7sstl3
      module load py-matplotlib/3.6.2/intel/19.1.3.304/sha-wbwigpl
      module load hdf5/1.12.2/intel/19.1.3.304/sha-lpavud5
      module load openjdk/11.0.17_8/intel/19.1.3.304/sha-nwh5yaq
      module load git
      module load blitz/1.0.1/intel/19.1.3.304/sha-gpct7uz
      module load boost/1.80.0/intel/19.1.3.304/sha-6erl3nf
      module load mdsplus/stable_release-7-96-17/intel/19.1.3.304/sha-jiasz6w
      module load libxml2/2.10.1/intel/19.1.3.304/sha-3te5l7z
      
      module load IMAS/3.37.0/AL/4.11.0
      module load idstools/1.13.1
      
      module load xmllib/3.3.1/intel/19.1.3.304

4. Gateway + SPACK + GNU

5. Gateway + SPACK + INTEL


This work has been carried out within the framework of the EUROfusion Consortium, funded by the European Union via the Euratom Research and Training Programme (Grant Agreement No. 101052200—EUROfusion).  Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those  of the European Union or the European Commission. Neither the European Union nor the European Commission can be held responsible for them. The project activities are co-financed by Polish Ministry of Science and Higher Education from financial resources of the programme entitled "PMW" in 2021, 2022.

  • No labels