forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgromacs.rb
47 lines (39 loc) · 1.49 KB
/
gromacs.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
require 'formula'
class Gromacs < Formula
homepage 'http://www.gromacs.org/'
url 'ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.5.tar.gz'
mirror 'https://fossies.org/linux/privat/gromacs-4.6.5.tar.gz'
sha1 '6bf86bb514e5488bda988d5b0e98867706d4ecd4'
option 'enable-mpi', "Enables MPI support"
option 'enable-double',"Enables double precision"
option 'with-x', "Enable the X11 visualizer"
option 'without-check', "Skip build-time tests (not recommended)"
depends_on 'cmake' => :build
depends_on 'fftw'
depends_on 'gsl' => :recommended
depends_on :mpi if build.include? 'enable-mpi'
depends_on :x11 if build.with? "x"
def install
args = std_cmake_args
args << "-DGMX_GSL=ON" if build.with? "gsl"
args << "-DGMX_MPI=ON" if build.include? 'enable-mpi'
args << "-DGMX_DOUBLE=ON" if build.include? 'enable-double'
args << "-DGMX_X11=ON" if build.with? "x"
args << "-DGMX_CPU_ACCELERATION=None" if MacOS.version <= :snow_leopard
inreplace 'scripts/CMakeLists.txt', 'BIN_INSTALL_DIR', 'DATA_INSTALL_DIR'
cd "src" do
system "cmake", "..", *args
system "make"
system "make", "test" if build.with? "check"
ENV.deparallelize
system "make", "install"
end
bash_completion.install 'scripts/completion.bash' => 'gromacs-completion.bash'
zsh_completion.install 'scripts/completion.zsh' => '_gromacs'
end
def caveats; <<-EOS.undent
GMXRC and other scripts installed to:
#{HOMEBREW_PREFIX}/share/gromacs
EOS
end
end