-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinterval_check_formula.rb
59 lines (45 loc) · 1.47 KB
/
interval_check_formula.rb
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
class IntervalCheckFormula < Formula
homepage "https://github.com/AdamSimpson/IntervalCheck.git"
url "none"
concern for_version("dev") do
included do
url "none"
module_commands do
commands = [ "unload PrgEnv-gnu PrgEnv-pgi PrgEnv-cray PrgEnv-intel" ]
commands << "load PrgEnv-gnu" if build_name =~ /gnu/
commands << "swap gcc gcc/#{$1}" if build_name =~ /gnu([\d\.]+)/
commands << "load cudatoolkit"
commands << "load dynamic-link"
commands << "load cmake3"
commands << "load git"
commands
end
def install
module_list
Dir.chdir "#{prefix}"
system "rm -rf source"
system "git clone https://github.com/AdamSimpson/IntervalCheck.git source"
Dir.chdir "#{prefix}/source"
system "rm -rf build; mkdir build"
Dir.chdir "build"
system "cmake -DCMAKE_INSTALL_PREFIX=#{prefix} .."
system "make"
system "make install"
end
end
end
modulefile <<-MODULEFILE.strip_heredoc
#%Module
proc ModulesHelp { } {
puts stderr "<%= @package.name %> <%= @package.version %>"
puts stderr ""
}
# One line description
module-whatis "<%= @package.name %> <%= @package.version %>"
set PREFIX <%= @package.prefix %>
prepend-path LD_LIBRARY_PATH $PREFIX/lib
prepend-path LD_LIBRARY_PATH $PREFIX/plugins/lib
setenv IC_PRELOAD $PREFIX/lib/libIntervalCheck.so
prepend-path PATH $PREFIX/bin
MODULEFILE
end