File: vpl

package info (click to toggle)
onevpl 2023.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,300 kB
  • sloc: cpp: 119,395; python: 7,297; ansic: 6,495; sh: 1,105; makefile: 11
file content (99 lines) | stat: -rw-r--r-- 3,446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#%Module1.0###################################################################

# Copyright (c) Intel Corporation
# SPDX-License-Identifier: MIT
# https://opensource.org/licenses/MIT

# Why all the directory and filename boilerplate code? It is needed in order
# to properly remove symbolic links used in assembly of the modulefiles
# folder as well as those found within the oneAPI installation folders.
# Without it many modulefiles will fail to work as expected.

# IMPORTANT: quotes around "$variables" and "[expressions]" are there
# to insure that paths/filenames which include spaces are handled properly.

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

# get full pathname for this script file
set scriptpath "${ModulesCurrentModulefile}"

# if modulefile script name is a symlink, resolve it
if { "[file type "$scriptpath"]" eq "link" } {
    set scriptpath "[file readlink "$scriptpath"]"
}

# if fullpath contains links, resolve them
set scriptpath "[file normalize "$scriptpath"]"

# get directory holding this modulefile script and others
set modulefileroot "[file dirname "$scriptpath"]"

# get name of modulefile script we are loading
set modulefilename "[file tail "$scriptpath"]"

# determine modulefile script version
set modulefilever "[file dirname "$modulefileroot"]"
set modulefilever "[file tail "$modulefilever"]"

# point to component top-level root folder
set componentroot "[file dirname "$modulefileroot"]"
set componentroot "[file dirname "$componentroot"]"

# get component folder name
set componentname "[file tail "$componentroot"]"

# get oneAPI top-level root folder
set oneapiroot "[file dirname "$componentroot"]"

# disallow loading multiple versions of this modulefile
# disallow loading multiple architectures of this modulefile
# if only 64-bit architecture exists the test still works
set mname32 $modulefilename
set mname64 [string trimright $mname32 "32"]
if { [string equal "$mname32" "$mname64"] } {
    append mname32 "32"
}
conflict $mname32
conflict $mname64


# On load print component name and version being loaded
if { [ module-info mode load ] } {
    puts stderr "Loading $modulefilename version $modulefilever"
}

# On `module unload` print component module name and version being removed
# Include `module list` message only if this modulefile loads dependent modules
if { [ module-info mode ] == "unload" || [ module-info mode ] == "remove" } {
    puts stderr "Removing $modulefilename version $modulefilever"
    puts stderr "Use `module list` to view any remaining dependent modules."
}


# ###### Component Specific env vars setup ###################################

set vpl_prefix "$componentroot/$modulefilever"

module-whatis "Intel(R) oneAPI Video Processing Library."

set vpl_include "$vpl_prefix/include"
set vpl_lib "$vpl_prefix/lib"
set vpl_bin "$vpl_prefix/bin"

# ### Add VPL to common path envars ###

prepend-path CPATH "$vpl_include"
prepend-path LIBRARY_PATH "$vpl_lib"
prepend-path PATH "$vpl_bin"
prepend-path LD_LIBRARY_PATH "$vpl_lib"
prepend-path CMAKE_PREFIX_PATH "$vpl_lib"
prepend-path PKG_CONFIG_PATH "$vpl_lib/pkgconfig"