Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel3
outlinefalse
stylenone
typelist
printabletrue

...

0. Define local module command (only once)

To utilize local modules, we suggest creating a bash command such as localmod that contains essential setup within your $HOME/.bashrc. The provided set of commands below will create a local module directory based on LOCALMOD_DIR and then define the localmod command in your $HOME/.bashrc.

...

Code Block
languagebash
LOCALMOD_DIR=$HOME/localmod           # *** EDITABLE, set to an empty path ***

mkdir -p ${LOCALMOD_DIR}              # Create the directory if not already exist
cat << Eof >> $HOME/.bashrc           # Define the below "localmod" function in your .bashrc
function localmod(){
  export EASYBUILD_PREFIX=${LOCALMOD_DIR}   
  module use \${EASYBUILD_PREFIX}/modules/all
  export EASYBUILD_OPTARCH=x86-milan
  echo "*** Import modules at \${EASYBUILD_PREFIX} on LANTA ***"
}
Eof
Expand
titleNote & Check
  • If you copy the above localmod function directly and paste it in your .bashrc, don’t forget to remove \ before $.

  • After this step, if you execute cat $HOME/.bashrc, the output should contain.

    Code Block
    languagebash
    function localmod(){
      export EASYBUILD_PREFIX=<Path-to-your-specified-directory>   
      module use ${EASYBUILD_PREFIX}/modules/all
      export EASYBUILD_OPTARCH=x86-milan
      echo "*** Import modules at ${EASYBUILD_PREFIX} on LANTA ***"
    }
Expand
titleMore explanation
  • module use will import extra modules to your Lmod system, i.e., MODULEPATH.

  • EASYBUILD_PREFIX variable is for setting default paths when using EasyBuild.

  • EASYBUILD_OPTARCH variable must be set to x86-milan to be consistent with LANTA hardware.

...

  • Enable local module by executing the command defined in Step 0localmod

  • Load EasyBuild → module load EasyBuild

  • Check your current EasyBuild configuration → eb --show-config.
    The Note: the installpath should be set to a local directory that you have write permission.

...

Open the .eb file using a text editor such as vi, then edit the following

  1. toolchain
    Correct the toolchain information, e.g., toolchain = {'name': 'cpeCray', 'version': '23.03'}. This must be consistent with the CPE toolchain and file name chosen in Step 2.

  2. builddependencies and/or dependencies
    Check if the software dependencies are available in ThaiSC modules by using module spider <dep-name>.
    For example, module spider binutils. If available, you could use them by editing each dependency information ('<dep-name>', '<dep-version>', '<dep-suffix>', <dep-toolchain>) where

    • <dep-name> is the dependency name, e.g., binutils.

    • <dep-version> is the dependency version, e.g., 2.40.

    • <dep-suffix> and <dep-toolchain> are optional. The default will use the same toolchain as in Step 3.1 without any suffix. This is recommended. For more details, visit writing .eb.

...

  • Execute eb -D --robot-paths=$(pwd) <the-eb-file>.eb to do a short dry run and check for dependencies.

    • If the command run successfully, it will display build status of the software’s dependencies.
      (You could ignore warning like WARNING: Failed to determine toolchain hierarchy for ...)

    • On the other hand, if you get ERROR: Missing dependencies: xxx/yyy-zzz, this means that the EasyConfig file of the library/software name xxx with version yyy using toolchain zzz is missing. You need to get the EasyConfig file for the dependency xxx/yyy-zzz by doing Step 2 and 3 again. That is, you also need to repeatedly do Step 2 and 3 for all unavailable dependencies required by the target software, and put them in the same directory.

  • To install the software, execute

    Code Block
    languagebash
    eb -r --robot-paths=$(pwd) --parallel=1 --trace --tmpdir=$(pwd) <the-eb-file>.eb
Expand
titleMore explanation
  • -D :
    Do a short dry run to check EasyConfig hierarchy. No modules will be installed.

  • --robot-paths=$(pwd):
    Add all EasyConfig files in the current directory to EasyBuild search path

  • -r:
    Robot. Recursively install dependencies prior to the target software.
    Note: You you may use -r $(pwd) instead of -r --robot-paths=$(pwd).

  • --parallel=N:
    Build the software using N CPU cores, e.g., make -j N

  • --trace --tmpdir=$(pwd): (Optional)
    Provide more information on progress (--trace) and save logs to the current path (--tmpdir=$(pwd)). Recommend using them together.

  • For more information, execute eb --help, eb -a and others in eb --help | grep 'avail'If you need further assistance, contact ThaiSC support service.

Note

--parallel=N where N<8 is essential since the default 128 would put a burden on the frontend node, prompting admins to kill your process.

Some software may not support parallel build; therefore, --parallel=1 is recommended.

...