#%Module1.0###################################################################

##===----------------------------------------------------------------------===##
#
# Copyright (C) Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# This file incorporates work covered by the following copyright and permission
# notice:
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
#
##===----------------------------------------------------------------------===##

# This modulefile requires Environment Modules 4.1 or later.
# Type `module --version` to determine the current installed version.

set min_tcl_ver 8.4
if { $tcl_version < $min_tcl_ver } {
    puts stderr " "
    puts stderr "ERROR: This modulefile requires tcl $min_tcl_ver or greater."
    puts stderr "Your system reports that tclsh version $tcl_version is installed."
    exit 1
}

# if modulefile script name is a symlink, resolve it to get the fully
# qualified pathname that points to the actual modulefile script
# see: https://wiki.tcl-lang.org/page/file+normalize
set scriptpath "${ModulesCurrentModulefile}"
set scriptpath "[file dirname [file normalize "$scriptpath/___"]]"

# define componentroot, modulefilepath, modulefilename and modulefilever
set modulefilename "[file tail [file dirname "${scriptpath}"]]"
set modulefilever "[file tail "${scriptpath}"]"
set modulefilepath "${scriptpath}"
set componentroot "[file dirname [file dirname [file dirname [file dirname "${scriptpath}"]]]]"

##############################################################################

module-whatis "Name: Intel(R) oneAPI DPC++ Library (oneDPL)"
module-whatis "Version: $modulefilename/$modulefilever"
module-whatis "Description: Intel(R) oneAPI DPC++ Library provides an alternative for C++ developers who create heterogeneous applications and solutions. Its APIs are based on familiar standards - C++ STL, Parallel STL (PSTL), Boost.Compute, and SYCL* - to maximize productivity and performance across CPUs, GPUs, and FPGAs."
module-whatis "URL: https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-library.html"
module-whatis "Dependencies: none"

set moduleinfoname [file dirname [module-info name]]

proc ModulesHelp { } {
    global moduleinfoname
    puts "module whatis ${moduleinfoname}"
}

##############################################################################

# Define environment variables needed for an isolated component install.

set dpl_root "$componentroot"
setenv DPL_ROOT "$dpl_root"
setenv DPLROOT "$dpl_root"
prepend-path CPLUS_INCLUDE_PATH "$dpl_root/include"
prepend-path CMAKE_PREFIX_PATH "$dpl_root/lib/cmake/oneDPL"
prepend-path PKG_CONFIG_PATH "$dpl_root/lib/pkgconfig"
