#%Module###########################################
#===============================================================================
# Copyright 2019-2020 Intel Corporation.
#
# This software and the related documents are Intel copyrighted  materials,  and
# your use of  them is  governed by the  express license  under which  they were
# provided to you (License).  Unless the License provides otherwise, you may not
# use, modify, copy, publish, distribute,  disclose or transmit this software or
# the related documents without Intel's prior written permission.
#
# This software and the related documents  are provided as  is,  with no express
# or implied  warranties,  other  than those  that are  expressly stated  in the
# License.
#===============================================================================

# Intel MKL IA-32 modulefile
# Sets up environment with Intel MKL

# Show module info
module-whatis "Sets up environment for Intel MKL IA-32"

# Get absolute path to this modulefile
set    __module_path         [ file dirname [ exec readlink -f ${ModulesCurrentModulefile} ] ]

# Intermediate variables
set    __install_root        ${__module_path}/../..
set    __mklroot             ${__install_root}/mkl
set    __target_arch         "ia32_lin"

# Setup environment variables
setenv          MKLROOT            ${__mklroot}
prepend-path    LD_LIBRARY_PATH    ${__mklroot}/lib/${__target_arch}
prepend-path    LIBRARY_PATH       ${__mklroot}/lib/${__target_arch}
prepend-path    CPATH              ${__mklroot}/include
prepend-path    PKG_CONFIG_PATH    ${__mklroot}/bin/pkgconfig

# NLSPATH needs to be set to load correct message catalog.
# Refer $man locale and $man catopen for more details on NLSPATH
prepend-path    NLSPATH            ${__mklroot}/lib/${__target_arch}/locale/%l_%t/%N


# Add Compiler to Path
prepend-path    LD_LIBRARY_PATH    ${__install_root}/compiler/lib/${__target_arch}
prepend-path    LIBRARY_PATH       ${__install_root}/compiler/lib/${__target_arch}


# Add TBB to path
setenv          TBBROOT            ${__install_root}/tbb
prepend-path    LD_LIBRARY_PATH    ${__install_root}/tbb/lib/${__target_arch}
prepend-path    CPATH              ${__install_root}/tbb/include
