forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gal-sim.rb
45 lines (37 loc) · 1.27 KB
/
gal-sim.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
require "formula"
class GalSim < Formula
homepage "https://github.com/GalSim-developers/GalSim"
url "https://github.com/GalSim-developers/GalSim/archive/v1.0.1.tar.gz"
sha1 '519c9f83c0f9092507185ba46cb21231f60df9fe'
head "https://github.com/GalSim-developers/GalSim.git"
depends_on "scons" => :build
depends_on "fftw"
depends_on "boost"
depends_on "tmv-cpp"
# pyfits should come from pip
depends_on "pyfits" => :python
depends_on "numpy" => :python
option "with-openmp", "Enable openmp support (gcc only)"
def pyver
IO.popen("python -c 'import sys; print sys.version[:3]'").read.strip
end
def install
args = []
if build.with? "openmp"
if ENV.compiler == :clang
opoo "OpenMP support will not be enabled. Use --cc=gcc-x.y if you require OpenMP."
end
args << "WITH_OPENMP=true"
end
scons *args
scons "install", "PREFIX=#{prefix}", "PYPREFIX=#{lib}/python#{pyver}"
end
def caveats; <<-EOS.undent
The GalSim installer may warn you that #{lib}/python isn't in your python
search path. You may want to add all Homebrew python packages to the
default paths by running:
sudo bash -c 'echo \"/usr/local/lib/python\" >> \\\\
/Library/Python/#{pyver}/site-packages/homebrew.pth'
EOS
end
end