Coccinelle release 1.0.0-rc14
[bpt/coccinelle.git] / install.txt
CommitLineData
174d1640
C
1
2 ** Compilation **
3
4You must first install a recent version of
d6ce1786 5 - OCaml (at least 3.10),
34e49164 6 see http://caml.inria.fr/download.en.html
d6ce1786 7 At least, OCaml 3.12 is required to use the OCaml scripting
174d1640
C
8 feature in the SmPL code.
9 - The Menhir parser generator (at least 20080912),
34e49164
C
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)
34e49164 15
c491d8ee 16On Debian/Ubuntu, install the following packages
d6ce1786 17 - pkg-config (optional, but strongly recommended)
c491d8ee 18 - ocaml-native-compilers (or alternatively ocaml)
ca417fcf
C
19 - ocaml-findlib
20 - libpycaml-ocaml-dev
c491d8ee
C
21 - libsexplib-camlp4-dev
22 - menhir and libmenhir-ocaml-dev
23
f537ebc4 24On Fedora, install the following packages
d6ce1786 25 - pkgconfig (optional, but strongly recommended)
f537ebc4
C
26 - ocaml
27 - ocaml-findlib
28 - ocaml-sexplib-devel
29
d6ce1786
C
30Note that on Fedora, there is currently not a
31package for menhir and pycaml. However, coccinelle
32bundles the sources of these packages and will use them
33when needed. The bundled pycaml package has support for
34python 3.
c491d8ee 35
174d1640 36Then simply type
d6ce1786 37 ./configure --enable-release
34e49164
C
38 make
39 make install
40
b1b2de81 41
d6ce1786
C
42Other 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
53See ./configure --help for more options
708f4980
C
54
55
56
d6ce1786
C
57
58When the --enable-release flag was given to ./configure, 'make' will
59build in release configuration (no debugging symbols, etc.). It
60defaults to the optimized version, unless --disable-opt is given
61to configure. You could use 'make opt-only' to compile the
62optimized version only. Similarly, you can use 'make byte-only' for
63the unoptimized version. 'make install' installs whichever version
64was compiled, and installs a script 'spatch' (the frontend) that invokes
65the 'best' one with proper environment variables.
66You can also use 'make world' to compile the bytecode
174d1640
C
67and the optimized code version.
68
d6ce1786
C
69Make targets of interest:
70opt-only, opt compiles just the optimized version
71byt-only, byte compiles just the bytecode version
72world compiles both + frontends + docs
73all-release compiles the optimized version + frontends + docs
74all-dev compiles the bytecode version + frontends
75all default target: alias for either all-dev or all-release
76all.opt compiles the optimized version + frontends
77check run tests (note: not all tests are expected to succeed)
78As these make targets may change in the future, it is preferred to set the
79appropriate default using the --enable-release flag.
80
174d1640
C
81We provide the files generated by menhir in the tarball. However,
82'make distclean' will remove them. You could either restore them from
83the tarball or install menhir. Using 'make clean' should be safe with
84regards to these files.
85
86Note: The test target is intended for developers. In particular, you
87 should not expect that every test will pass.
88
d6ce1786 89In order to use the OCaml scripting feature in SmPL, you must compile
174d1640
C
90Coccinelle with at least OCaml version 3.11.
91
92
aba5c457
C
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
174d1640
C
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
d6ce1786
C
127If runtime tools are not in $PATH, paths to some
128of them can be specified with 'configure' or via
129commandline parameters to spatch.
130
174d1640 131
708f4980 132
174d1640 133 ** Dependencies for additional tools **
9f8e26f4 134
174d1640 135 git, pushd, popd, sed, diffstat, cpp
aba5c457
C
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