\label{page_install_md_doc_install}%
\Hypertarget{page_install_md_doc_install}%
 \hypertarget{page_install_autotoc_md60}{}\doxysubsection{Requirements}\label{page_install_autotoc_md60}
To build librsync you will need\+:


\begin{DoxyItemize}
\item A C compiler and appropriate headers and libraries
\item \href{http://cmake.org/}{\texttt{ CMake}}
\item Some build tool supported by CMake\+: \href{https://www.gnu.org/software/make/}{\texttt{ Make}} is most common, \href{http://build-ninja.org}{\texttt{ Ninja}} is nicer.
\item \href{http://rpm5.org/files/popt/}{\texttt{ popt}} command line parsing library
\item \href{https://www.stack.nl/~dimitri/doxygen}{\texttt{ Doxygen}} -\/ optional, to build docs
\end{DoxyItemize}\hypertarget{page_install_autotoc_md61}{}\doxysubsection{Building}\label{page_install_autotoc_md61}
Generate the Makefile by running \begin{DoxyVerb}$ cmake .
\end{DoxyVerb}
 After building you can install {\ttfamily rdiff} and {\ttfamily librsync} for system-\/wide use. \begin{DoxyVerb}$ make
\end{DoxyVerb}
 To build and run the tests\+: \begin{DoxyVerb}$ make check
\end{DoxyVerb}
 To install\+: \begin{DoxyVerb}$ sudo make install
\end{DoxyVerb}
 To build the documentation\+: \begin{DoxyVerb}$ make doc
\end{DoxyVerb}
 librsync should be widely portable. Patches to fix portability bugs are welcome.

If you are using GNU libc, you might like to use \begin{DoxyVerb}MALLOC_CHECK_=2 ./rdiff
\end{DoxyVerb}
 to detect some allocation bugs.

librsync has annotations for the SPLINT static checking tool.\hypertarget{page_install_autotoc_md62}{}\doxysubsection{Build options}\label{page_install_autotoc_md62}
The build is customizable by using CMake options in the configure step\+: \begin{DoxyVerb}$ cmake -D <option-name>=<value> .
\end{DoxyVerb}
 If you are interested in building only the {\ttfamily librsync} target, you can skip the {\ttfamily rdiff} build. In this way you don\textquotesingle{}t need its dependencies (e.\+g. {\ttfamily popt}). To do that, set the {\ttfamily BUILD\+\_\+\+RDIFF} option to {\ttfamily OFF}\+: \begin{DoxyVerb}$ cmake -D BUILD_RDIFF=OFF .
\end{DoxyVerb}
 Be aware that many tests depend on {\ttfamily rdiff} executable, so when it is disabled, also those tests are.

Compression support is under development (see \href{https://github.com/librsync/librsync/issues/8}{\texttt{ \#8}}). It is so disabled by default. You can turn it on by using {\ttfamily ENABLE\+\_\+\+COMPRESSION} option\+: \begin{DoxyVerb}$ cmake -D ENABLE_COMPRESSION=ON .
\end{DoxyVerb}
 To build code for debug trace messages\+: \begin{DoxyVerb}$ cmake -D ENABLE_TRACE=ON .
\end{DoxyVerb}
 \hypertarget{page_install_autotoc_md63}{}\doxysubsection{Ninja builds}\label{page_install_autotoc_md63}
CMake generates input files for an underlying build tool that will actually do the build. Typically this is Make, but others are supported. In particular \href{http://build-ninja.org}{\texttt{ Ninja}} is a nice alternative. To use it\+: \begin{DoxyVerb}$ cmake -G Ninja .
$ ninja check
\end{DoxyVerb}
\hypertarget{page_install_autotoc_md64}{}\doxysubsection{Cygwin}\label{page_install_autotoc_md64}
With Cygwin you can build using gcc as under a normal unix system. It is also possible to compile under Cygwin using MSVC++. You must have environment variables needed by MSVC set using the Vcvars32.\+bat script. 