aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/cantera.rb
blob: 2d6b597260099fd497981d484ea36cf4773e4e2e (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
require 'formula'

class Cantera < Formula
  homepage 'http://code.google.com/p/cantera/'
  url 'http://cantera.googlecode.com/files/cantera-1.8.0-beta.tar.gz'
  md5 '53d923922535c64b7e6b9f07bbfcf866'
  head 'http://cantera.googlecode.com/svn/cantera18/trunk/'

  depends_on 'numpy' => :python
  depends_on 'graphviz'

  # fixes the Makefiles in Cantera/cxx/demos/ that have broken install commands
  def patches
    DATA
  end

  def install
    if MacOS.prefer_64_bit?
      # There is probably a better way to do this, but this seems to work for my purposes:
      ENV['CFLAGS'] += " -arch x86_64"
      ENV['CXX_OPT'] = "-arch x86_64"
      ENV['ARCHFLAGS'] = "-arch x86_64"
      # Maybe this does all that's needed?
      ENV['BITCOMPILE'] = '64'
      buildname = "x86_64-apple-darwin"
    else
      buildname = nil # let autoconf guess
    end

    # These are the Cantera settings that I want:
    ENV['DEBUG_MODE'] = 'y'
    ENV['PYTHON_PACKAGE'] = "full"
    ENV['USE_NUMPY'] = "y"
    ENV['BUILD_MATLAB_TOOLBOX'] = 'n'
    ENV['WITH_PRIME'] = 'y'
    ENV['WITH_H298MODIFY_CAPABILITY'] = 'y'
    ENV['WITH_VCSNONIDEAL'] = 'y'
    ENV['ARCHIVE'] = "libtool -static -o"
    # I'm not entirely sure that this is required,
    # but it doesn't seem to hurt and I used to need something like it:
    ENV['NUMPY_INC_DIR'] = `python -c "from numpy import get_include; print get_include()"`.strip

    # The Makefile doesn't like to run in parallel
    ENV.deparallelize

    # Put the manuals in the right place
    inreplace 'configure', 'ct_mandir=${prefix}', "ct_mandir=#{man}"

    system "./preconfig", "--disable-debug",
                          "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--mandir=#{man}",
                          (buildname ? "--build=#{buildname}" : "")
    system "make"
    system "make install"
  end

  def caveats; <<-EOS.undent
    The license, demos, tutorials, data, etc. can be found in:
      #{prefix}

    Try the following in python to find the equilibrium composition of a
    stoichiometric methane/air mixture at 1000 K and 1 atm:
    >>> import Cantera
    >>> g=Cantera.GRI30()
    >>> g.set(X='CH4:1, O2:2, N2:8', T=1000, P=Cantera.OneAtm)
    >>> g.equilibrate('TP')
    >>> g
    EOS
  end
end

__END__
diff --git a/Cantera/cxx/demos/Makefile.in b/Cantera/cxx/demos/Makefile.in
index acd0a0b..554dd54 100644
--- a/Cantera/cxx/demos/Makefile.in
+++ b/Cantera/cxx/demos/Makefile.in
@@ -19,7 +19,7 @@ test:
 
 install:
 	@INSTALL@ -d       @ct_demodir@/cxx
-	@INSTALL@ Makefile -m ug+rw,o+r @ct_demodir@/cxx
+	@INSTALL@ -m ug+rw,o+r Makefile @ct_demodir@/cxx
 	cd combustor;       @MAKE@ install
 	cd flamespeed;      @MAKE@ install
 	cd kinetics1;       @MAKE@ install
diff --git a/Cantera/cxx/demos/NASA_coeffs/Makefile.in b/Cantera/cxx/demos/NASA_coeffs/Makefile.in
index 4038fa2..4ccc46d 100644
--- a/Cantera/cxx/demos/NASA_coeffs/Makefile.in
+++ b/Cantera/cxx/demos/NASA_coeffs/Makefile.in
@@ -89,8 +89,8 @@ install:
 	@INSTALL@ -d     $(INSTALL_DIR)
 	@INSTALL@       -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
 	@(for ihhh in *.cpp  *blessed* ; do  \
-             @INSTALL@        $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
-             echo "@INSTALL@  $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
+             @INSTALL@        -m ug+rw,o+r $${ihhh} $(INSTALL_DIR) ; \
+             echo "@INSTALL@  -m ug+rw,o+r $${ihhh} $(INSTALL_DIR)" ; \
          done )
 	 @INSTALL@        runtest  $(INSTALL_DIR) ; 
 
diff --git a/Cantera/cxx/demos/combustor/Makefile.in b/Cantera/cxx/demos/combustor/Makefile.in
index 1a46070..d603a7f 100644
--- a/Cantera/cxx/demos/combustor/Makefile.in
+++ b/Cantera/cxx/demos/combustor/Makefile.in
@@ -88,8 +88,8 @@ install:
 	@INSTALL@ -d     $(INSTALL_DIR)
 	@INSTALL@       -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
 	@(for ihhh in *.cpp  *blessed* ; do  \
-             @INSTALL@        $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
-             echo "@INSTALL@  $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
+             @INSTALL@        -m ug+rw,o+r $${ihhh} $(INSTALL_DIR) ; \
+             echo "@INSTALL@  -m ug+rw,o+r $${ihhh} $(INSTALL_DIR)" ; \
          done )
 	 @INSTALL@        runtest  $(INSTALL_DIR) ; 
 
diff --git a/Cantera/cxx/demos/flamespeed/Makefile.in b/Cantera/cxx/demos/flamespeed/Makefile.in
index b55941e..10828a4 100644
--- a/Cantera/cxx/demos/flamespeed/Makefile.in
+++ b/Cantera/cxx/demos/flamespeed/Makefile.in
@@ -89,8 +89,8 @@ install:
 	@INSTALL@ -d     $(INSTALL_DIR)
 	@INSTALL@       -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
 	@(for ihhh in *.cpp  *blessed* ; do  \
-             @INSTALL@        $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
-             echo "@INSTALL@  $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
+             @INSTALL@        -m ug+rw,o+r $${ihhh} $(INSTALL_DIR) ; \
+             echo "@INSTALL@  -m ug+rw,o+r $${ihhh} $(INSTALL_DIR)" ; \
          done )
 	 @INSTALL@        runtest  $(INSTALL_DIR) ; 
 
diff --git a/Cantera/cxx/demos/kinetics1/Makefile.in b/Cantera/cxx/demos/kinetics1/Makefile.in
index 336a2eb..ac5c891 100644
--- a/Cantera/cxx/demos/kinetics1/Makefile.in
+++ b/Cantera/cxx/demos/kinetics1/Makefile.in
@@ -89,8 +89,8 @@ install:
 	@INSTALL@ -d     $(INSTALL_DIR)
 	@INSTALL@       -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
 	@(for ihhh in *.cpp *.h  *blessed* ; do  \
-             @INSTALL@        $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
-             echo "@INSTALL@  $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
+             @INSTALL@        -m ug+rw,o+r $${ihhh} $(INSTALL_DIR) ; \
+             echo "@INSTALL@  -m ug+rw,o+r $${ihhh} $(INSTALL_DIR)" ; \
          done )
 	 @INSTALL@        runtest  $(INSTALL_DIR) ; 
 
diff --git a/Cantera/cxx/demos/rankine/Makefile.in b/Cantera/cxx/demos/rankine/Makefile.in
index 05d776a..0892cdc 100644
--- a/Cantera/cxx/demos/rankine/Makefile.in
+++ b/Cantera/cxx/demos/rankine/Makefile.in
@@ -89,8 +89,8 @@ install:
 	@INSTALL@ -d     $(INSTALL_DIR)
 	@INSTALL@       -c -m ug+rw,o+r Makefile.install $(INSTALL_DIR)/Makefile
 	@(for ihhh in *.cpp  *blessed* ; do  \
-             @INSTALL@        $${ihhh} -m ug+rw,o+r $(INSTALL_DIR) ; \
-             echo "@INSTALL@  $${ihhh} -m ug+rw,o+r $(INSTALL_DIR)" ; \
+             @INSTALL@        -m ug+rw,o+r $${ihhh} $(INSTALL_DIR) ; \
+             echo "@INSTALL@  -m ug+rw,o+r $${ihhh} $(INSTALL_DIR)" ; \
          done )
 	 @INSTALL@        runtest  $(INSTALL_DIR) ;