Add packages to INSTALL.md; put INSTALL.md on ftp site
[rsync.git] / INSTALL.md
1 # How to build and install rsync
2
3 When building rsync, you'll want to install various libraries in order to get
4 all the new features enabled.  The configure script will alert you when the
5 newest libraries are missing and tell you the appropriate `--disable-LIB`
6 option to use if you want to just skip that feature.  What follows are various
7 support libraries that you may want to install to build rsync with the maximum
8 features (the impatient can skip down to the package summary):
9
10 ## The basic setup
11
12 You need to have a C compiler installed and optionally a C++ compiler in order
13 to try to build some hardware-accelerated checksum routines.  If you're
14 installing from the git repo (instead of a release tar file) you'll also need
15 the GNU autotools (autoconf & automake) and your choice of 2 python3 markdown
16 libraries: cmarkgfm or commonmark (needed to generate the man pages).
17
18 If your OS doesn't provide a python3-cmarkgfm or python3-commonmark package,
19 you can run the following to install the commonmark python library for your
20 build user (after installing python3's pip package):
21
22 >     pip3 install --user commonmark
23
24 ## ACL support
25
26 To support copying ACL file information, make sure you have an acl
27 development library installed. It also helps to have the helper programs
28 installed to manipulate ACLs and to run the rsync testsuite.
29
30 ## Xattr support
31
32 To support copying xattr file information, make sure you have an xattr
33 development library installed. It also helps to have the helper programs
34 installed to manipulate xattrs and to run the rsync testsuite.
35
36 ## xxhash
37
38 The [xxHash library](https://cyan4973.github.io/xxHash/) provides extremely
39 fast checksum functions that can make the "rsync algorithm" run much more
40 quickly, especially when matching blocks in large files.  Installing this
41 development library adds xxhash checksums as the default checksum algorithm.
42
43 ## zstd
44
45 The [zstd library](http://facebook.github.io/zstd/) compression algorithm that
46 uses a lot less CPU than the default zlib algorithm at the same compression
47 level.  Note that you need at least version 1.4, so you might need to skip the
48 zstd compression if you can only install a 1.3 release.  Installing this
49 development library adds zstd compression as the default compression algorithm.
50
51 ## lz4
52
53 The [lz4 library](https://lz4.github.io/lz4/) compression algorithm that uses
54 very little CPU, though it also has the smallest compression ratio of other
55 algorithms.  Installing this development library adds lz4 compression as an
56 available compression algorithm.
57
58 ## openssl crypto
59
60 The [openssl crypto library](https://www.openssl.org/docs/man1.0.2/man3/crypto.html)
61 provides some hardware accelerated checksum algorithms for MD4 and MD5.
62 Installing this development library makes rsync use the (potentially) faster
63 checksum routines when computing MD4 & MD5 checksums.
64
65 ## Package summary
66
67 To sum up, here are some package install commands for various OSes:
68
69  -  For Debian and Ubuntu (Debian Buster users may want to briefly(?) enable
70     buster-backports to update zstd from 1.3 to 1.4):
71
72     >     sudo apt install gcc g++ autoconf automake python3-cmarkgfm
73     >     sudo apt install acl libacl1-dev
74     >     sudo apt install attr libattr1-dev
75     >     sudo apt install libxxhash-dev
76     >     sudo apt install libzstd-dev
77     >     sudo apt install libzlz4-dev
78     >     sudo apt install libssl-dev
79
80  -  For CentOS (use EPEL for python3-pip):
81
82     >     sudo yum install epel-release
83     >     sudo yum install gcc g++ autoconf automake python3-pip
84     >     sudo yum install acl libacl-devel
85     >     sudo yum install attr libattr-devel
86     >     sudo yum install xxhash-devel
87     >     sudo yum install libzstd-devel
88     >     sudo yum install lz4-devel
89     >     sudo yum install openssl-devel
90     >     pip3 install --user commonmark
91
92  -  For FreeBSD (this assumes that the python3 version is 3.7):
93
94     >     sudo pkg install -y gcc g++ autotools python3
95     >     sudo pkg install -y xxhash
96     >     sudo pkg install -y zstd
97     >     sudo pkg install -y liblz4
98     >     sudo pkg install -y py37-CommonMark
99
100  -  For macOS:
101
102     >     brew install automake
103     >     brew install xxhash
104     >     brew install zstd
105     >     brew install lz4
106     >     brew install openssl
107
108 ## Build and install
109
110 After installing the various libraries, you need to configure, build, and
111 install the source:
112
113 >      ./configure
114 >      make
115 >      sudo make install
116
117 You may set the installation directory and other parameters by options
118 to ./configure.  To see them, use:
119
120 >     ./configure --help
121
122 Configure tries to figure out if the local system uses group "nobody" or
123 "nogroup" by looking in the /etc/group file.  (This is only used for the
124 default group of an rsync daemon, which attempts to run with "nobody"
125 user and group permissions.)  You can change the default user and group
126 for the daemon by editing the NOBODY_USER and NOBODY_GROUP defines in
127 config.h, or just override them in your /etc/rsyncd.conf file.
128
129 As of 2.4.7, rsync uses Eric Troan's popt option-parsing library.  A
130 cut-down copy of a recent release is included in the rsync distribution,
131 and will be used if there is no popt library on your build host, or if
132 the --with-included-popt option is passed to ./configure.
133
134 If you configure using --enable-maintainer-mode, then rsync will try
135 to pop up an xterm on DISPLAY=:0 if it crashes.  You might find this
136 useful, but it should be turned off for production builds.
137
138 If you want to automatically use a separate "build" directory based on
139 the current git branch name, start with a pristine git checkout and run
140 "mkdir auto-build-save" before you run the first ./configure command.
141 That will cause a fresh build dir to spring into existence along with a
142 special Makefile symlink that allows you to run "make" and "./configure"
143 from the source dir (the "build" dir gets auto switched based on branch).
144 This is helpful when using the branch-from-patch and patch-update scripts
145 to maintain the official rsync patches.  If you ever need to build from
146 a "detached head" git position then you'll need to manually chdir into
147 the build dir to run make.  I also like to create 2 more symlinks in the
148 sourc dir:  ln -s build/rsync . ; ln -s build/testtmp .
149
150 ## Make compatibility
151
152 Note that Makefile.in has a rule that uses a wildcard in a prerequisite.  If
153 your make has a problem with this rule, you will see an error like this:
154
155     Don't know how to make ./*.c
156
157 You can change the "proto.h-tstamp" target in Makefile.in to list all the \*.c
158 filenames explicitly in order to avoid this issue.
159
160 ## RPM notes
161
162 Under packaging you will find .spec files for several distributions.
163 The .spec file in packaging/lsb can be used for Linux systems that
164 adhere to the Linux Standards Base (e.g., RedHat and others).
165
166 ## HP-UX notes
167
168 The HP-UX 10.10 "bundled" C compiler seems not to be able to cope with
169 ANSI C.  You may see this error message in config.log if ./configure
170 fails:
171
172     (Bundled) cc: "configure", line 2162: error 1705: Function prototypes are an ANSI feature.
173
174 Install gcc or HP's "ANSI/C Compiler".
175
176 ## Mac OS X notes
177
178 Some versions of Mac OS X (Darwin) seem to have an IPv6 stack, but do
179 not completely implement the "New Sockets" API.
180
181 [This site](http://www.ipv6.org/impl/mac.html) says that Apple started to
182 support IPv6 in 10.2 (Jaguar).  If your build fails, try again after running
183 configure with --disable-ipv6.
184
185 ## IBM AIX notes
186
187 IBM AIX has a largefile problem with mkstemp.  See IBM PR-51921.
188 The workaround is to append the following to config.h:
189
190 >     #ifdef _LARGE_FILES
191 >     #undef HAVE_SECURE_MKSTEMP
192 >     #endif