Cegis unif register evaluation points (#1878)
[cvc5.git] / INSTALL
1 CVC4 release version 1.5.
2
3 *** Quick-start instructions
4
5 *** Build dependences
6
7 The following tools and libraries are required to build and run CVC4.
8 Versions given are minimum versions; more recent versions should be
9 compatible.
10
11 GNU C and C++ (gcc and g++), reasonably recent versions
12 GNU Make
13 GNU Bash
14 GMP v4.2 (GNU Multi-Precision arithmetic library)
15 MacPorts [only if on a Mac; see below]
16 libantlr3c v3.2 or v3.4 (ANTLR parser generator C support library)
17 The Boost C++ base libraries
18
19 The hardest to obtain and install is the libantlr3c requirement, so
20 that one is explained next.
21
22 On a Mac, you need to additionally install MacPorts (see
23 http://www.macports.org/). Doing so is easy. Then, simply run the
24 script contrib/mac-build, which installs a few ports from the MacPorts
25 repository, then compiles and installs antlr3c using the get-antlr-3.4
26 script (as described next). The mac-build script should set you up
27 with all requirements, and will tell you how to configure CVC4 when it
28 completes successfully.
29
30 If "make" is non-GNU on your system, make sure to invoke "gmake" (or
31 whatever GNU Make is installed as). If your usual shell is not Bash,
32 the configure script should auto-correct this. If it does not, you'll
33 see strange shell syntax errors, and you may need to explicitly set
34 SHELL or CONFIG_SHELL to the location of bash on your system.
35
36 *** Installing libantlr3c: ANTLR parser generator C support library
37
38 For libantlr3c, you can use the convenience script in
39 contrib/get-antlr-3.4 --this will download, patch, and install
40 libantlr3c. On a 32-bit machine, or if you have difficulty building
41 libantlr3c (or difficulty getting CVC4 to link against it later), you
42 may need to remove the --enable-64bit part in the script. (If you're
43 curious, the manual instructions are at
44 http://cvc4.cs.stanford.edu/wiki/Developer%27s_Guide#ANTLR3 .)
45
46 *** Building CVC4
47
48 The hardest build dependence to satisfy is libantlr3c; that's why it
49 is explained above. Problems in satisfying other build dependences are
50 explained below.
51
52 Once the build dependences are satisfied, you should be able to
53 configure, make, make check, and make install without incident:
54
55 ./configure [use --prefix to specify a prefix; default /usr/local]
56 make
57 make check [optional but a good idea!]
58
59 To build from a repository checkout (rather than a distributed CVC4
60 tarball), there are additional dependences; see below.
61
62 You can then "make install" to install in the prefix you gave to
63 the configure script (/usr/local by default). ** You should run
64 "make check" ** before installation to ensure that CVC4 has been
65 built correctly. In particular, GCC version 4.5.1 seems to have a
66 bug in the optimizer that results in incorrect behavior (and wrong
67 results) in many builds. This is a known problem for Minisat, and
68 since Minisat is at the core of CVC4, a problem for CVC4. "make check"
69 easily detects this problem (by showing a number of FAILed test cases).
70 It is ok if the unit tests aren't run as part of "make check", but all
71 system tests and regression tests should pass without incident.
72
73 To build API documentation, use "make doc". Documentation is produced
74 under doc/ but is not installed by "make install".
75
76 Examples and tutorials are not installed with "make install." You may
77 want to "make install-examples". See below.
78
79 For more information about the build system itself (probably not
80 necessary for casual users), see the Appendix at the bottom of this
81 file.
82
83 *** Installing the Boost C++ base libraries
84
85 A Boost package is available on most Linux distributions; check yours
86 for a package named something like libboost-dev or boost-devel. There
87 are a number of additional Boost packages in some distributions, but
88 this "basic" one should be sufficient for building CVC4.
89
90 Should you want to install Boost manually, or to learn more about the
91 Boost project, please visit http://www.boost.org/.
92
93 *** Optional requirements
94
95 None of these is required, but can improve CVC4 as described below:
96
97 Optional: SWIG 2.0.x (Simplified Wrapper and Interface Generator)
98 Optional: CLN v1.3 or newer (Class Library for Numbers)
99 Optional: glpk-cut-log (A fork of the GNU Linear Programming Kit)
100 Optional: ABC library (for improved bitvector support)
101 Optional: GNU Readline library (for an improved interactive experience)
102 Optional: The Boost C++ threading library (libboost_thread)
103 Optional: CxxTest unit testing framework
104
105 SWIG is necessary to build the Java API (and of course a JDK is
106 necessary, too). SWIG 1.x won't work; you'll need 2.0, and the more
107 recent the better. On Mac, we've seen SWIG segfault when generating
108 CVC4 language bindings; version 2.0.8 or higher is recommended to
109 avoid this. See "Language bindings" below for build instructions.
110
111 CLN is an alternative multiprecision arithmetic package that can offer
112 better performance and memory footprint than GMP. CLN is covered by
113 the GNU General Public License, version 3; so if you choose to use
114 CVC4 with CLN support, you are licensing CVC4 under that same license.
115 (Usually CVC4's license is more permissive than GPL is; see the file
116 COPYING in the CVC4 source distribution for details.) Please visit
117 http://www.ginac.de/CLN/ for more details about CLN.
118
119 glpk-cut-log is a fork of GLPK (the GNU Linear Programming Kit).
120 This can be used to speed up certain classes of problems for the arithmetic
121 implementation in CVC4. (This is not recommended for most users.) The source
122 code for glpk-cut-log is available at:
123 https://github.com/timothy-king/glpk-cut-log/
124 The only option for installation of glpk-cut-log is downloading the library,
125 compiling and installing it manually. CVC4 is no longer compatible with the
126 main GLPK library. GLPK and glpk-cut-log are covered by the GNU General Public
127 License, version 3; so if you choose to use CVC4 with GLPK support, you are
128 licensing CVC4 under that same license.
129 (Usually CVC4's license is more permissive; see above discussion.)
130 Please visit http://www.gnu.org/software/glpk/ for more details about GLPK.
131
132 ABC: A System for Sequential Synthesis and Verification is a library
133 for synthesis and verification of logic circuits. This can be used to
134 speed up the eager bit-vector solver by first encoding the bit-blasted
135 formula into AIG format and then using ABC to simplify the AIG. To
136 install abc run the contrib/get-abc script which will download and
137 install a compatible version of ABC in the cvc4 directory. To configure
138 CVC4 to use abc configure with --with-abc and --with-abc-dir=PATH, where
139 PATH corresponds to the install path of ABC. To run CVC4 using ABC use
140 the --bitblast-aig command line argument.
141 Please visit http://www.eecs.berkeley.edu/~alanmi/abc/ for more details
142 on ABC.
143
144 The GNU Readline library is optionally used to provide command
145 editing, tab completion, and history functionality at the CVC prompt
146 (when running in interactive mode). Check your distribution for a
147 package named "libreadline-dev" or "readline-devel" or similar. This
148 library is covered by the GNU General Public License, version 3. Like
149 the above-mentioned libraries, if you choose to use CVC4 with readline
150 support, you are licensing CVC4 under that same license. (Please visit
151 http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html for more
152 details about readline.)
153
154 The Boost C++ threading library (often packaged independently of the
155 Boost base library) is needed to run CVC4 in "portfolio"
156 (multithreaded) mode. Check your distribution for a package named
157 "libboost-thread-dev" or similar.
158
159 CxxTest is necessary to run CVC4's unit tests (included with the
160 distribution). Running these is not really required for users of
161 CVC4; "make check" will skip unit tests if CxxTest isn't available,
162 and go on to run the extensive system- and regression-tests in the
163 source tree. However, if you're interested, you can download CxxTest
164 at http://cxxtest.com/ .
165
166 *** Language bindings
167
168 There are several options available for using CVC4 from the API.
169
170 First, CVC4 offers a complete and flexible API for manipulating
171 expressions, maintaining a stack of assertions, and checking
172 satisfiability, and related things. The C++ libraries (libcvc4.so and
173 libcvc4parser.so) and required headers are installed normally via a
174 "make install". This API is also available from Java (via CVC4.jar
175 and libcvc4jni.so) by configuring with --enable-language-bindings=java.
176 You'll also need SWIG 2.0 installed (and you might need to help
177 configure find it if you installed it in a nonstandard place with
178 --with-swig-dir=/path/to/swig/installation). You may also need to
179 give the configure script the path to your Java headers (in
180 particular, jni.h). You might do so with (for example):
181
182 ./configure --enable-language-bindings=java \
183 JAVA_CPPFLAGS=-I/usr/lib/jvm/java-6-openjdk-amd64/include
184
185 There is also a "C++ compatibility API" (#include <cvc4/cvc3_compat.h>
186 and link against libcvc4compat.so) that attempts to maintain
187 source-level backwards-compatibility with the CVC3 C++ API. The
188 compatibility library is built by default, and
189 --enable-language-bindings=java enables the Java compatibility library
190 (CVC4compat.jar and libcvc4compatjni.so).
191 --enable-language-bindings=c enables the C compatibility library
192 (#include <cvc4/bindings/compat/c/c_interface.h> and link against
193 libcvc4bindings_c_compat.so), and if you want both C and Java
194 bindings, use --enable-language-bindings=c,java. These compatibility
195 language bindings do NOT require SWIG.
196
197 The examples/ directory includes some basic examples (the "simple vc"
198 and "simple vc compat" family of examples) of all these interfaces.
199
200 In principle, since we use SWIG to generate the native Java API, we
201 could support other languages as well. However, using CVC4 from other
202 languages is not supported, nor expected to work, at this time. If
203 you're interested in helping to develop, maintain, and test a language
204 binding, please contact one of the project leaders.
205
206 *** Building CVC4 from a repository checkout
207
208 CVC4's main repository is kept on GitHub at:
209
210 https://github.com/CVC4/CVC4
211
212 and there are numerous experimental forks housed on GitHub as well,
213 by different developers, implementing various features.
214
215 The following tools and libraries are additionally required to build
216 CVC4 from from a repository checkout rather than from a prepared
217 source tarball.
218
219 Automake v1.11 or later
220 Autoconf v2.61 or later
221 Libtool v2.2 or later
222 ANTLR3 v3.2 or v3.4
223
224 First, use "./autogen.sh" to create the configure script. Then
225 proceed as normal for any distribution tarball. The parsers are
226 pre-generated for the tarballs, but don't exist in the repository;
227 hence the extra ANTLR3 requirement to generate the source code for the
228 parsers, when building from the repository.
229
230 *** Examples and tutorials are not built or installed
231
232 Examples are not built by "make" or "make install". See
233 examples/README for information on what to find in the examples/
234 directory, as well as information about building and installing them.
235
236 *** Appendix: Build architecture
237
238 The build system is generated by automake, libtool, and autoconf. It
239 is somewhat nonstandard, though, which (for one thing) requires that
240 GNU Make be used. If you ./configure in the top-level source
241 directory, the objects will actually all appear in
242 builds/${arch}/${build_id}. This is to allow multiple, separate
243 builds in the same place (e.g., an assertions-enabled debugging build
244 alongside a production build), without changing directories at the
245 shell. The "current" build is maintained until you re-configure.
246
247 You can also create your own build directory inside or outside of the
248 source tree and configure from there. All objects will then be built
249 in that directory, and you'll ultimately find the "cvc4" binary in
250 src/main/, and the libraries under src/ and src/parser/.