2010-10-29 07:36:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gromacs < Formula
|
2010-10-29 07:36:17 +00:00
|
|
|
homepage 'http://www.gromacs.org/'
|
2013-08-18 12:46:06 +00:00
|
|
|
url 'ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.6.3.tar.gz'
|
|
|
|
mirror 'https://fossies.org/linux/privat/gromacs-4.6.3.tar.gz'
|
|
|
|
sha1 'bf01a19d0afdadc10b960faebbca1a68a10a4313'
|
2010-10-29 07:36:17 +00:00
|
|
|
|
2012-08-28 04:57:08 +00:00
|
|
|
option 'enable-mpi', "Enables MPI support"
|
|
|
|
option 'enable-double',"Enables double precision"
|
2013-08-18 12:46:06 +00:00
|
|
|
option 'with-x', "Enable the X11 visualizer"
|
2010-10-29 07:36:17 +00:00
|
|
|
|
2013-08-18 12:46:06 +00:00
|
|
|
depends_on 'cmake' => :build
|
2012-08-28 04:57:08 +00:00
|
|
|
depends_on 'fftw'
|
2013-08-18 12:46:06 +00:00
|
|
|
depends_on 'gsl' => :recommended
|
|
|
|
depends_on :mpi if build.include? 'enable-mpi'
|
2014-03-06 20:40:26 +00:00
|
|
|
depends_on :x11 if build.with? "x"
|
2010-10-29 07:36:17 +00:00
|
|
|
|
|
|
|
def install
|
2013-08-18 12:46:06 +00:00
|
|
|
args = std_cmake_args
|
2014-03-06 20:40:26 +00:00
|
|
|
args << "-DGMX_GSL=ON" if build.with? "gsl"
|
2013-08-18 12:46:06 +00:00
|
|
|
args << "-DGMX_MPI=ON" if build.include? 'enable-mpi'
|
|
|
|
args << "-DGMX_DOUBLE=ON" if build.include? 'enable-double'
|
2014-03-06 20:40:26 +00:00
|
|
|
args << "-DGMX_X11=ON" if build.with? "x"
|
2013-08-18 12:46:06 +00:00
|
|
|
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"
|
|
|
|
ENV.j1
|
|
|
|
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
|
2010-10-29 07:36:17 +00:00
|
|
|
end
|
|
|
|
end
|