Debian Codegraph @

doc/example/compiler-etc-dependencies/homebrewed/openmpi/common

raw
1 # Common modulefile for openmpi
2 # Using "homebrewed flavors" strategy
3 # Expects the following variables to have been
4 # previously defined:
5 # version: version of openmpi
6
7 # Declare the path where the packages are installed
8 # The reference to the environment variable is a hack
9 # for this example; normally one would hard code a path
10 set rootdir $::env(MOD_GIT_ROOTDIR)
11 set swroot $rootdir/doc/example/compiler-etc-dependencies/dummy-sw-root
12
13 # Also get location of and load common procedures
14 # This is a hack for the cookbook examples, in production
15 # one should either
16 # 1) declare the procedures in a site config file (preferred)
17 # 2) hardcode the path to $tcllibdir and common_utilities.tcl
18 set tcllibdir $rootdir/doc/example/compiler-etc-dependencies/tcllib
19 source $tcllibdir/common_utilities.tcl
20
21 proc ModulesHelp { } {
22 global version
23 puts stderr "
24 openmpi: Test dummy version of OpenMPI $version
25
26 For testing packages depending on compilers/MPI
27
28 "
29 }
30
31 module-whatis "Dummy openmpi $version"
32
33 # Figure out what compiler we have loaded
34 # Optional args ensure will default to and load/prereq default compiler
35 # if no compiler currently loaded
36 set ctag [ GetLoadedCompiler 1 1 1 ]
37
38 # Compute the installation prefix
39 set pkgroot $swroot/openmpi
40 set vroot $pkgroot/$version
41 set prefix $vroot/$ctag
42
43 # Make sure there is a build for this openmpi version/compiler
44 # I.e. that the prefix exists
45 if ![ file exists $prefix ] {
46 # Not built for this compiler, alert user and abort
47 PrintLoadError "
48 openmpi/$version does not appear to be built for compiler $ctag
49
50 Please select a different openmpi version or different compiler.
51 "
52 }
53
54 # We need to prereq the compiler to allow autohandling to work
55 prereq $ctag
56
57 # Set environment variables
58 setenv MPI_DIR $prefix
59
60 set bindir $prefix/bin
61 set libdir $prefix/lib
62 set incdir $prefix/include
63
64 prepend-path PATH $bindir
65 prepend-path LIBRARY_PATH $libdir
66 prepend-path LD_LIBRARY_PATH $libdir
67 prepend-path CPATH $incdir