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