'How to full (with all features - ACL support / Xattr support / xxhash library/ zstd library) install (compiling) rsync v3.2.3 on Mac?

I am trying to install rsync 3.2.3 on Mac by compiling it. But, I would like to install with all features. For that, it needs some libraries which in here (https://download.samba.org/pub/rsync/INSTALL) does not explain how can I install and/or compile them.

By the way, when I "./prepare-source", I get this message:

make: Nothing to be done for `conf'.

Is this right?

By running "./configure" I get this message:

Configure found the following issues:

  • Failed to find openssl/md4.h and openssl/md5.h for openssl crypto lib support.
  • Failed to find xxhash.h for xxhash checksum support.
  • Failed to find zstd.h for zstd compression support.
  • Failed to find lz4.h for lz4 compression support.

See the INSTALL file for hints on how to install the missing libraries and/or how to generate (or fetch) man pages: https://github.com/WayneD/rsync/blob/master/INSTALL.md

To disable one or more features, the relevant configure options are: --disable-openssl --disable-xxhash --disable-zstd --disable-lz4

configure.sh: error: Aborting configure run

So, like I said before, I would like to install all the features (ACL support / Xattr support / xxhash library/ zstd library).

Helps are very apreciated!

Thanks in advance!



Solution 1:[1]

First, install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

And then execute the following command:

brew install xxhash; brew install zstd; brew install lz4; brew install openssl;
export LDFLAGS="-L/usr/local/opt/[email protected]/lib";
export CPPFLAGS="-I/usr/local/opt/[email protected]/include";
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc;

Try again to execute: ./configure

UPDATE -- 06/05/2021

You can try to paste the following script into the terminal and run:

cd ~/Desktop;
curl -OL https://github.com/Cyan4973/xxHash/archive/v0.8.0.tar.gz;
tar -xvf v0.8.0.tar.gz;
cd xxHash-0.8.0;
make -j4;
sudo make install;

cd ~/Desktop;
curl -OL https://github.com/lz4/lz4/archive/v1.9.3.tar.gz;
tar -xvf v1.9.3.tar.gz;
cd lz4-1.9.3;
make -j4;
sudo make install;

cd ~/Desktop;
curl -OL https://www.openssl.org/source/openssl-1.1.1k.tar.gz;
tar -xvf openssl-1.1.1k.tar.gz;
cd openssl-1.1.1k ;
./config;
make -j4;
sudo make install;

cd ~/Desktop;
curl -OL https://github.com/facebook/zstd/archive/v1.5.0.tar.gz;
tar -xvf v1.5.0.tar.gz;
cd zstd-1.5.0 ;
make -j4;
sudo make install;

cd ~/Desktop;
curl -OL https://rsync.samba.org/ftp/rsync/src/rsync-3.2.3.tar.gz;
tar -xvf rsync-3.2.3.tar.gz;
cd rsync-3.2.3;
./configure;
make -j4;
sudo make install;

cd /usr/local/bin;
./rsync --version;

Finding all the software package source code download url is a tedious job. If you are a "script purist," you can indeed do this. But I think Homebrew can really free the programmer's hands and get rid of the nightmare of "submerged in the ocean of curl and printlog".

How do I know the download url of each package? Google a few days, in the end still have to refer to the Homebrew formulae Code:

xxhash?https://formulae.brew.sh/formula/xxhash#default

lz4: https://formulae.brew.sh/formula/lz4#default

openssl1.1: https://formulae.brew.sh/formula/[email protected]#default

zstd: https://formulae.brew.sh/formula/zstd#default

Solution 2:[2]

While I think that @Janyee gave the correct answer and should get credited, maybe this helps others that ran into a similar issue of library linking errors, too.

Compiling rsync 3.2.4 (the same happens for rsync 3.2.3) on macOS 10.12.x Sierra with manual installed external libraries xxHash, zstd, lz4, openssl, popt, zlib in non standard folders gave the following error on make, even though ./configure reported rsync 3.2.4 configuration successful:

$ make
awk -f ./daemon-parm.awk ./daemon-parm.txt
awk -f ./mkproto.awk ./*.c ./lib/compat.c daemon-parm.h
In file included from ./rounding.c:20:
./rsync.h:643:3: error: Could not find a 32-bit integer variable
# error Could not find a 32-bit integer variable
  ^
./rsync.h:712:2: error: unknown type name 'int32'
        int32 size, entries;
        ^
./rsync.h:713:8: error: expected ';' at end of declaration list
        uint32 node_size;
              ^
              ;
./rsync.h:719:2: error: unknown type name 'int32'
        int32 key;
        ^
./rsync.h:803:3: error: Character pointers are not 4 or 8 bytes.
# error Character pointers are not 4 or 8 bytes.
  ^
./rsync.h:816:2: error: unknown type name 'int32'
        int32 num;
        ^
./rsync.h:817:8: error: expected ';' at end of declaration list
        uint32 unum;
              ^
              ;
./rsync.h:833:8: error: expected ';' at end of declaration list
        uint32 len32;           /* Lowest 32 bits of the file's length */
              ^
              ;
./rsync.h:992:2: error: unknown type name 'int32'
        int32 len;              /**< length of chunk of file */
        ^
./rsync.h:993:8: error: expected ';' at end of declaration list
        uint32 sum1;            /**< simple checksum */
              ^
              ;
./rsync.h:994:2: error: unknown type name 'int32'
        int32 chain;            /**< next hash-table collision */
        ^
./rsync.h:1002:2: error: unknown type name 'int32'
        int32 count;            /**< how many chunks */
        ^
./rsync.h:1003:2: error: unknown type name 'int32'
        int32 blength;          /**< block_length */
        ^
./rsync.h:1004:2: error: unknown type name 'int32'
        int32 remainder;        /**< flength % block_length */
        ^
./rsync.h:1013:2: error: unknown type name 'int32'
        int32 p_size;           /* Largest window size we allocated     */
        ^
./rsync.h:1014:2: error: unknown type name 'int32'
        int32 p_len;            /* Latest (rounded) window size         */
        ^
./rsync.h:1015:2: error: unknown type name 'int32'
        int32 def_window_size;  /* Default window size                  */
        ^
./rsync.h:1051:8: error: expected ';' at end of declaration list
        uint32 rflags;
              ^
              ;
In file included from ./rounding.c:20:
In file included from ./rsync.h:1148:
./byteorder.h:75:8: error: 'inline' can only appear on functions
static inline uint32
       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Failed to create rounding.h!
make: *** [rounding.h] Error

Compiling without extra libs worked:

$ ./configure --prefix=/NonStandardDir/rsync/rsync-3.2.4 --disable-openssl --disable-xxhash --disable-zstd --disable-lz4 --disable-roll-simd --disable-md2man

The config.log and the ./configure script output gave hints on missing libraries. Executing make generated files like ~/Library/Logs/DiagnosticReports/conftest_….crash. Those reports clearly that the library is searched in the wrong standard place: Library not loaded: /usr/local/lib/liblz4.1.dylib

That the dynamic libraries liblz4.1.9.3.dylib, libzstd.1.5.2.dylib and libxxhash.0.8.1.dylib were linked incorrectly could also be proofed by:

$ otool -L /NonStandardFolder/lz4/lz4-1.9.3/usr/local/lib/liblz4.1.9.3.dylib  
# -> Output: … /usr/local/lib/liblz4.1.dylib (compatibility version 1.0.0, current version 1.9.3)…

As popt, openssl and zlib weren't affected, because --prefix was set in the ./configure command, the solution is to recompile the incorrectly linked libs with the right prefix for the destination:

$ export PREFIX="/NonStandardFolder/lz4/lz4-1.9.3" && make && make install

The mistake was to set DESTDIR instead of PREFIX while executing the make command.

Check the dynamic library again and it should be correctly linked:

$ otool -L /NonStandardFolder/lz4/lz4-1.9.3/lib/liblz4.1.9.3.dylib 
# -> Output: … /NonStandardFolder/lz4/lz4-1.9.3/lib/liblz4.1.dylib (compatibility version 1.0.0, current version 1.9.3)…

After recompiling the libs lz4, xxHash, zstd, something like the following (adapt to your folder structure) should work to compile rsync:

$ cd /SourcecodeFolder/rsync/rsync-3.2.4

$ make clean

$ ./configure --prefix=/NonStandardDir/rsync/rsync-3.2.4 --disable-debug --disable-md2man --with-rsyncd-conf=/NonStandardDir/rsync/rsync-3.2.4/configuration/rsyncd.conf --with-included-popt=no --with-included-zlib=no --enable-ipv6 --disable-roll-simd CPPFLAGS="-I/NonStandardDir/openssl/openssl-1.1.1n/include -I/NonStandardDir/lz4/lz4-1.9.3/usr/local/include -I/NonStandardDir/zstd/zstd-1.5.2/include -I/NonStandardDir/xxHash/xxHash-0.8.1/include -I/NonStandardDir/popt/popt-1.18/include -I/NonStandardDir/zlib/zlib-1.2.11/include" LDFLAGS="-L/NonStandardDir/openssl/openssl-1.1.1n/lib -L/NonStandardDir/lz4/lz4-1.9.3/lib -L/NonStandardDir/zstd/zstd-1.5.2/lib -L/NonStandardDir/xxHash/xxHash-0.8.1/lib -L/NonStandardDir/popt/popt-1.18/lib -L/NonStandardDir/zlib/zlib-1.2.11/lib"

$ make

$ make test

$ make install

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2