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