1 # Installing {#page_install}
5 To build librsync you will need:
7 * A C compiler and appropriate headers and libraries
11 * Some build tool supported by CMake: [Make] is most common,
14 * [popt] command line parsing library
16 * [Doxygen] - optional, to build docs
18 [popt]: http://rpm5.org/files/popt/
19 [CMake]: http://cmake.org/
20 [Doxygen]: https://www.stack.nl/~dimitri/doxygen
21 [Ninja]: http://build-ninja.org
22 [Make]: https://www.gnu.org/software/make/
26 Generate the Makefile by running
30 After building you can install `rdiff` and `librsync` for system-wide use.
34 To build and run the tests:
42 To build the documentation:
46 librsync should be widely portable. Patches to fix portability bugs are
49 If you are using GNU libc, you might like to use
51 MALLOC_CHECK_=2 ./rdiff
53 to detect some allocation bugs.
55 librsync has annotations for the SPLINT static checking tool.
60 The build is customizable by using CMake options in the configure step:
62 $ cmake -D <option-name>=<value> .
64 If you are interested in building only the `librsync` target, you can skip
65 the `rdiff` build. In this way you don't need its dependencies (e.g. `popt`).
66 To do that, set the `BUILD_RDIFF` option to `OFF`:
68 $ cmake -D BUILD_RDIFF=OFF .
70 Be aware that many tests depend on `rdiff` executable, so when it is disabled,
73 Compression support is under development (see
74 [#8](https://github.com/librsync/librsync/issues/8)). It is so disabled by
75 default. You can turn it on by using `ENABLE_COMPRESSION` option:
77 $ cmake -D ENABLE_COMPRESSION=ON .
79 To build code for debug trace messages:
81 $ cmake -D ENABLE_TRACE=ON .
85 CMake generates input files for an underlying build tool that will actually do
86 the build. Typically this is Make, but others are supported. In particular
87 [Ninja] is a nice alternative. To use it:
95 With Cygwin you can build using gcc as under a normal unix system. It
96 is also possible to compile under Cygwin using MSVC++. You must have
97 environment variables needed by MSVC set using the Vcvars32.bat