forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getdp.rb
76 lines (66 loc) · 2.19 KB
/
getdp.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
class GetdpSvnStrategy < SubversionDownloadStrategy
def quiet_safe_system(*args)
super *args + ["--username", "getdp", "--password", "getdp"]
end
end
class Getdp < Formula
desc "Open source finite element solver using mixed elements."
homepage "https://www.geuz.org/getdp/"
url "https://getdp.info/src/getdp-2.11.1-source.tgz"
sha256 "bb32d1d24e110eab209e57701d0754289f62402d5ee6672be596310b1a359997"
revision 3
head "https://geuz.org/svn/getdp/trunk", :using => GetdpSvnStrategy
bottle :disable, "needs to be rebuilt with latest open-mpi"
option "without-test", "skip build-time tests (not recommended)"
deprecated_option "without-check" => "without-test"
depends_on "cmake" => :build
depends_on :fortran
depends_on :mpi => [:cc, :cxx, :f90, :recommended]
if build.with? "mpi"
depends_on "arpack" => [:recommended, "with-mpi"]
else
depends_on "arpack" => :recommended
end
depends_on "gmsh" => :recommended
depends_on "gsl" => :recommended
depends_on "hdf5" => :recommended
if build.with? "mpi"
depends_on "hdf5" => [:recommended, "with-mpi"]
else
depends_on "hdf5" => :recommended
end
depends_on "metis" => :recommended
depends_on "mumps" => :recommended
depends_on "petsc" => :recommended
depends_on "slepc" => :recommended
def install
args = std_cmake_args
args << "-DENABLE_BUILD_SHARED=ON"
args << "-DENABLE_ARPACK=OFF" if build.without? "arpack"
args << "-DENABLE_GMSH=OFF" if build.without? "gmsh"
args << "-DENABLE_GSL=OFF" if build.without? "gsl"
if build.with? "petsc"
ENV["PETSC_DIR"] = Formula["petsc"].opt_prefix
ENV["PETSC_ARCH"] = "real"
else
args << "-DENABLE_PETSC=OFF"
end
if build.with? "slepc"
ENV["SLEPC_DIR"] = "#{Formula["slepc"].opt_prefix}/real"
else
args << "-DENABLE_SLEPC=OFF"
end
if (build.with? "petsc") || (build.with? "slepc")
args << "-DENABLE_MPI=ON" if build.with? :mpi
end
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
system "make", "test" if build.with? "check"
end
end
test do
system "#{bin}/getdp", "#{share}/doc/getdp/demos/magnet.pro"
end
end