Debian Codegraph @

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

raw
1 # Common modulefile for mvapich
2 # Using "homebrewed flavors" strategy
3 # Expects the following variables to have been
4 # previously defined:
5 # version: version of mvapich
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 Mvapich $version
25
26 For testing packages depending on compilers/MPI
27
28 "
29 }
30
31 module-whatis "Dummy mvapich 4.0"
32
33 # Figure out what compiler we have loaded
34 set ctag [ GetLoadedCompiler 1 1 1 ]
35
36 # Compute the installation prefix
37 set pkgroot $swroot/mvapich
38 set vroot $pkgroot/$version
39 set prefix $vroot/$ctag
40
41 # Make sure there is a build for this openmpi version/compiler
42 # I.e. that the prefix exists
43 if ![ file exists $prefix ] {
44 # Not built for this compiler, alert user and abort
45 PrintLoadError "
46 mvapich/$version does not appear to be built for compiler $ctag
47
48 Please select a different mvapich version or different compiler.
49 "
50 }
51
52 # We need to prereq the compiler to allow autohandling to work
53 prereq $ctag
54
55 # Set environment variables
56 setenv MPI_DIR $prefix
57
58 set bindir $prefix/bin
59 set libdir $prefix/lib
60 set incdir $prefix/include
61
62 prepend-path PATH $bindir
63 prepend-path LIBRARY_PATH $libdir
64 prepend-path LD_LIBRARY_PATH $libdir
65 prepend-path CPATH $incdir