forked from simonsj/fdupes-jody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
84 lines (68 loc) · 4.28 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Installing jdupes
-----------------------------------------------------------------------------
To install the program with the default options and flags, just issue the
following commands (note that btrfs support is off by default):
make
su root
make install
This will install the program in /usr/bin. You may change this to a different
location by editing the Makefile. Please refer to the Makefile for an
explanation of compile-time options. If you're having trouble compiling,
please take a look at the Makefile.
Various build options are available and can be turned on at compile time by
setting CFLAGS_EXTRA or by passing it to 'make':
make CFLAGS_EXTRA=-DYOUR_OPTION
make CFLAGS_EXTRA='-DYOUR_OPTION_ONE -DYOUR_OPTION_TWO'
This is a list of options that can be "turned on" this way:
OMIT_GETOPT_LONG Do not use getopt_long() C library call
ON_WINDOWS Modify code to compile with MinGW on Windows
Certain options need to be turned on by setting a variable passed to make
instead of using CFLAGS_EXTRA, i.e. 'make DEBUG=1':
DEBUG Turn on algorithm statistic reporting with '-D'
LOUD '-@' for low-level debugging; enables DEBUG
ENABLE_DEDUPE Enable '-B/--dedupe' for filesystem deduplication
STATIC_DEDUPE_H Build dedupe support with included minimal header file
LOW_MEMORY Build for lower memory usage instead of speed
NO_PERMS Disable permission options and code
NO_HARDLINKS Disable hard linking options and code
NO_SYMLINKS Disable symbolic linking options and code
NO_USER_ORDER Disable -I/-O options and code
NO_UNICODE [Windows only] disable all Unicode support
EMBED_BUILD_DATE Hard-code the build date into the binary
The LOW_MEMORY option tweaks various knobs in the program to lower total
memory usage. It also disables some features to reduce the size of certain
data structures. The improvements in memory usage are not very large, but if
you're running in a very RAM-limited environment or have a CPU with very small
caches it may be a good choice.
If you are building binaries that will have the same version number and still
need a way to differentiate the binaries, you can use EMBED_BUILD_DATE to add
the date of the build to the version info in 'jdupes -v'. Note that you must
have a build that will rebuild jdupes.c (such as after a 'make clean') for
the shown build date to actually update. This option also makes it impossible
to create reproducible builds if that's important to you.
A test directory is included so that you may familiarize yourself with the way
jdupes operates. You may test the program before installing it by issuing a
command such as "./jdupes testdir" or "./jdupes -r testdir", just to name a
couple of examples. See the README for information on valid options.
A comparison shell script is also included. It will run your natively
installed 'jdupes' or 'jdupes' with the directories and extra options you
specify and compare the run times and output a 'diff' of the two program
outputs. Unless the core algorithm or sort behavior is changed, both programs
should produce identical outputs and the 'diff' output shouldn't appear at
all. To use it, type:
./compare_jdupes.sh [options]
A stand-alone version of jdupes that consolidates most of the program's
functionality into a single C file is included with this source code. Major
differences include reduction or elimination of some text strings, using an
embedded 32-bit jody_hash implementation instead of relying on xxHash64,
removal of all DEBUG/LOUD and Windows support code, replacement of fancy
numeric sorting with the faster but naive strcmp() sort method, and other
minor adjustments and consolidations appropriate for single-file compilation.
This version of the program is suitable for inclusion in "Swiss army knife"
projects such as BusyBox and Toybox.
The standalone version is not meant to work on Windows; it has all of the
quirks for Windows support stripped out and there's no real advantage to
using it on Windows anyway. However, if you need added stress in your life
and you understand that this is NOT SUPPORTED and YOU'RE 100% ON YOUR OWN,
you can compile it with this make command and it'll even partially work:
make standalone NO_UNICODE=1 CFLAGS_EXTRA='-DNO_PERMS -DNO_SYMLINKS -DNO_HARDLINKS'