Coccinelle release 1.0.0-rc15
[bpt/coccinelle.git] / install.txt
CommitLineData
755320b0
C
1 ** News **
2
3- Coccinelle no longer needs ocaml-sexplib nor ocaml-extlib.
4- Parallel building is possible when you do not build the bytecode
5 and native version of spatch simultaneously.
6
174d1640
C
7
8 ** Compilation **
9
10You must first install a recent version of
d6ce1786 11 - OCaml (at least 3.10),
34e49164 12 see http://caml.inria.fr/download.en.html
d6ce1786 13 At least, OCaml 3.12 is required to use the OCaml scripting
174d1640
C
14 feature in the SmPL code.
15 - The Menhir parser generator (at least 20080912),
34e49164
C
16 see http://cristal.inria.fr/~fpottier/menhir/
17 (unless you got a version of the coccinelle source with
18 the SmPL parser pre-generated)
19 - Python and its development files (python-dev)
20 (unless you run configure with the --without-python option)
34e49164 21
c491d8ee 22On Debian/Ubuntu, install the following packages
d6ce1786 23 - pkg-config (optional, but strongly recommended)
c491d8ee 24 - ocaml-native-compilers (or alternatively ocaml)
ca417fcf
C
25 - ocaml-findlib
26 - libpycaml-ocaml-dev
c491d8ee
C
27 - menhir and libmenhir-ocaml-dev
28
f537ebc4 29On Fedora, install the following packages
d6ce1786 30 - pkgconfig (optional, but strongly recommended)
755320b0 31 - chrpath
f537ebc4
C
32 - ocaml
33 - ocaml-findlib
755320b0
C
34 - ocaml-camlp4-devel
35 - ocaml-findlib-devel
36 - ocaml-ocamldoc
37 - ocaml-pcre-devel
f537ebc4 38
d6ce1786
C
39Note that on Fedora, there is currently not a
40package for menhir and pycaml. However, coccinelle
41bundles the sources of these packages and will use them
42when needed. The bundled pycaml package has support for
43python 3.
c491d8ee 44
174d1640 45Then simply type
d6ce1786 46 ./configure --enable-release
34e49164
C
47 make
48 make install
49
b1b2de81 50
d6ce1786
C
51Other configuration flags of interest:
52--prefix default: /usr/local
53--disable-opt build the bytecode version
54--with-python=PATH choose a specific python executable
55--without-python no python scripting
56--disable-ocaml no ocaml scripting
57--disable-pycaml uses the bundled pycaml package instead of
58 a installed pycaml package.
59--disable-pcre-syntax no pcre regexp syntax
60--enable-release=world builds the optimized and unoptimized
61 version of spatch
62See ./configure --help for more options
708f4980
C
63
64
65
d6ce1786
C
66
67When the --enable-release flag was given to ./configure, 'make' will
68build in release configuration (no debugging symbols, etc.). It
69defaults to the optimized version, unless --disable-opt is given
70to configure. You could use 'make opt-only' to compile the
71optimized version only. Similarly, you can use 'make byte-only' for
72the unoptimized version. 'make install' installs whichever version
73was compiled, and installs a script 'spatch' (the frontend) that invokes
74the 'best' one with proper environment variables.
75You can also use 'make world' to compile the bytecode
174d1640
C
76and the optimized code version.
77
d6ce1786
C
78Make targets of interest:
79opt-only, opt compiles just the optimized version
80byt-only, byte compiles just the bytecode version
81world compiles both + frontends + docs
82all-release compiles the optimized version + frontends + docs
83all-dev compiles the bytecode version + frontends
84all default target: alias for either all-dev or all-release
85all.opt compiles the optimized version + frontends
86check run tests (note: not all tests are expected to succeed)
87As these make targets may change in the future, it is preferred to set the
88appropriate default using the --enable-release flag.
89
174d1640
C
90We provide the files generated by menhir in the tarball. However,
91'make distclean' will remove them. You could either restore them from
92the tarball or install menhir. Using 'make clean' should be safe with
93regards to these files.
94
95Note: The test target is intended for developers. In particular, you
96 should not expect that every test will pass.
97
d6ce1786 98In order to use the OCaml scripting feature in SmPL, you must compile
174d1640
C
99Coccinelle with at least OCaml version 3.11.
100
101
aba5c457
C
102
103 ** Bash integration **
104
105 To have completion under Bash, you can execute the following command:
106
107 make install-bash
108
109 It will install the shell script 'scripts/spatch.bash_completion'
110 in /etc/bash_completion.d/spatch
111
112 You can manually copy that file elsewhere if you have a different
113 bash_completion directory.
114
115
116
174d1640
C
117 ** Runtime dependencies **
118
119 - Basic shell commands:
120 - ls, cat, cp, mv, rm, grep, mkdir, find
121 - Developper tool: diff
122
123
124 ** Optional runtime dependencies **
125
126 - To quickly apply the semantic patches
127 - glimpse indexer
128
129 - To use OCaml scripting feature in SmPL
130 - ocaml-native-compilers or ocaml-nox
131 - ocaml-findlib
132
133 - To generate a PDF of the control flow graph with '-graphical_trace'
134 - pdftk and graphviz (with PDF support)
135
d6ce1786
C
136If runtime tools are not in $PATH, paths to some
137of them can be specified with 'configure' or via
138commandline parameters to spatch.
139
174d1640 140
708f4980 141
174d1640 142 ** Dependencies for additional tools **
9f8e26f4 143
174d1640 144 git, pushd, popd, sed, diffstat, cpp
aba5c457
C
145
146 ** Uninstall **
147
148 To uninstall Coccinelle, you should use the following command
149
150 make uninstall
151
152
153 To also remove the bash completion script, run
154
155 make uninstall-bash