Fix maintainer documentation to reflect the new build system. (#17441)
Austin S. Hemmelgarn committed
Apr 23, 2024 at 10:32 UTC
39ea36980f47552a4ed2cf6f38f347a990416ff6
1 file changed
+24
-136
packaging/installer/methods/source.md
+24
-136
@@ -23,11 +23,15 @@ to build and run successfully:
23
- libuuid
24
- libuv version 1.0 or newer
25
- zlib
26
-- GNU autoconf
27
-- GNU automake
26
+- CMake 3.13 or newer
27
- GCC or Xcode (Clang is known to have issues in certain configurations, see [Using Clang](#using-clang))
29
-- A version of `make` compatible with GNU automake
30
-- Git (we use git in the build system to generate version info, don't need a full install, just a working `git show` command)
28
+- Ninja or Make (Ninja is preferred as it results in significantly faster builds)
29
+- Git (we use git in the build system to generate version info, you don't need a full install, just a working `git show` command)
30
+
31
+The following additional dependencies are also needed, but will be prepared automatically by CMake if they are not available on the build system.
32
+
33
+- libyaml
34
+- JSON-C
35
36
Additionally, the following build time features require additional dependencies:
37
@@ -38,66 +42,36 @@ Additionally, the following build time features require additional dependencies:
42
- OpenSSL 1.0 or newer (LibreSSL _amy_ work, but is largely untested).
43
- Netdata Cloud support:
44
- A working internet connection
41
- - A recent version of CMake
45
- OpenSSL 1.0.2 or newer _or_ LibreSSL 3.0.0 or newer.
43
- - JSON-C (may be provided by the user as shown below, or by the system)
44
- - protobuf (Google Protocol Buffers) and protoc compiler
46
+ - protobuf (Google Protocol Buffers) and protoc compiler. If protobuf is not available on the system,
47
+ CMake can be instructed to fetch and build a usable version for Netdata.
48
+- Netdata Go collectors:
49
+ - Go 1.21 or newer
50
51
## Preparing the source tree
52
48
-Certain features in Netdata require custom versions of specific libraries,
49
-which the build system will link statically into Netdata. These
50
-libraries and their header files must be copied into specific locations
51
-in the source tree to be used.
52
-
53
-Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date.
54
-Otherwise, [perform a cleanup](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
53
+Netdata uses Git submodules for some of it’s components, which must be fetched prior to building Netdata. If you
54
+are using a source tarball published by the Netdata project, then these are included. If you are using a checkout
55
+of the Git repository, you may need to explicitly fetch and update the submodules using `git submodule update
56
+--init --recursive`.
57
58
### Netdata cloud
59
58
-#### JSON-C
59
-
60
-Netdata requires the use of JSON-C for JSON parsing when using Netdata
61
-Cloud. Netdata is able to use a system-provided copy of JSON-C, but
62
-some systems may not provide it. If your system does not provide JSON-C,
63
-you can do the following to prepare a copy for the build system:
64
-
65
-1. Verify the tag that Netdata expects to be used by checking the contents
66
- of `packaging/jsonc.version` in your Netdata sources.
67
-2. Obtain the sources for that version by either:
68
- - Navigating to https://github.com/json-c/json-c and downloading
69
- and unpacking the source code archive for that release.
70
- - Cloning the repository with `git` and checking out the required tag.
71
-3. Prepare the JSON-C sources by running `cmake -DBUILD_SHARED_LIBS=OFF .`
72
- in the JSON-C source directory.
73
-4. Build JSON-C by running `make` in the JSON-C source directory.
74
-5. In the Netdata source directory, create a directory called
75
- `externaldeps/jsonc`.
76
-6. Copy `libjson-c.a` from the JSON-C source directory to
77
- `externaldeps/jsonc/libjson-c.a` in the Netdata source tree.
78
-7. Copy all of the header files (`*.h`) from the JSON-C source directory
79
- to `externaldeps/jsonc/json-c` in the Netdata source tree.
80
-
60
## Building Netdata
61
62
Once the source tree has been prepared, Netdata is ready to be configured
84
-and built. Netdata currently uses GNU autotools as it's primary build
85
-system. To build Netdata this way:
63
+and built. Netdata uses CMake for configuration, and strongly prefers
64
+the use of an external build directory. To configure and build Netdata:
65
87
-1. Run `autoreconf -ivf` in the Netdata source tree.
88
-2. Run `./configure` in the Netdata source tree.
89
-3. Run `make` in the Netdata source tree.
66
+1. Run `cmake -S . -B build -G Ninja` in the source tree. `build` can be replaced with whatever path you want for the build directory. If you wish to use Make instead of Ninja for the build, remove the `-G Ninja` from the command.
67
+2. Run `cmake --build build`, where `build` is the build directory. CMake’s `--parallel` option can be used to control the number of build jobs that are used.
68
+3. Run `cmake --install build`, where `build` is the build directory.
69
70
### Configure options
71
93
-Netdata provides a number of build time configure options. This section
94
-lists some of the ones you are most likely to need:
95
-
96
-- `--prefix`: Specify the prefix under which Netdata will be installed.
97
-- `--with-webdir`: Specify a path relative to the prefix in which to
98
- install the web UI files.
99
-- `--disable-cloud`: Disables all Netdata Cloud functionality for
100
- this build.
72
+Netdata’s CMake build infrastructure intentionally does very little auto-detection, and requires most components
73
+to be explicitly enabled or disabled. A full list of available configuration options for a given version of Netdata,
74
+with help descriptions, can be seen by running `cmake -LH` in the source tree.
75
76
### Using Clang
77
@@ -123,92 +97,6 @@ A full featured install of Netdata requires some additional components
97
which must be built and installed separately from the main Netdata
98
agent. All of these should be handled _after_ installing Netdata itself.
99
126
-### React dashboard
127
-
128
-The above build steps include a deprecated web UI for Netdata that lacks
129
-support for Netdata Cloud. To get a fully featured dashboard, you must
130
-install our new React dashboard.
131
-
132
-#### Installing the pre-built React dashboard
133
-
134
-We provide pre-built archives of the React dashboard for each release
135
-(these are also used during our normal install process). To use one
136
-of these:
137
-
138
-1. Verify the release version that Netdata expects to be used by checking
139
- the contents of `packaging/dashboard.version` in your Netdata sources.
140
-2. Go to https://github.com/netdata/dashboard/releases and download the
141
- `dashboard.tar.gz` file for the required release.
142
-3. Unpack the downloaded archive to a temporary directory.
143
-4. Copy the contents of the `build` directory from the extracted
144
- archive to `/usr/share/netdata/web` or the equivalent location for
145
- your build of Netdata. This _will_ overwrite some files in the target
146
- location.
147
-
148
-#### Building the React dashboard locally
149
-
150
-Alternatively, you may wish to build the React dashboard locally. Doing
151
-so requires a recent version of Node.JS with a working install of
152
-NPM. Once you have the required tools, do the following:
153
-
154
-1. Verify the release version that Netdata expects to be used by checking
155
- the contents of `packaging/dashboard.version` in your Netdata sources.
156
-2. Obtain the sources for that version by either:
157
- - Navigating to https://github.com/netdata/dashboard and downloading
158
- and unpacking the source code archive for that release.
159
- - Cloning the repository with `git` and checking out the required tag.
160
-3. Run `npm install` in the dashboard source tree.
161
-4. Run `npm run build` in the dashboard source tree.
162
-5. Copy the contents of the `build` directory just like step 4 of
163
- installing the pre-built React dashboard.
164
-
165
-### Go collectors
166
-
167
-A number of the collectors for Netdata are written in Go instead of C,
168
-and are developed in a separate repository from the mian Netdata code.
169
-An installation without these collectors is still usable, but will be
170
-unable to collect metrics for a number of network services the system
171
-may be providing. You can either install a pre-built copy of these
172
-collectors, or build them locally.
173
-
174
-#### Installing the pre-built Go collectors
175
-
176
-We provide pre-built binaries of the Go collectors for all the platforms
177
-we officially support. To use one of these:
178
-
179
-1. Verify the release version that Netdata expects to be used by checking
180
- the contents of `packaging/go.d.version` in your Netdata sources.
181
-2. Go to https://github.com/netdata/go.d.plugin/releases, select the
182
- required release, and download the `go.d.plugin-*.tar.gz` file
183
- for your system type and CPu architecture and the `config.tar.gz`
184
- configuration file archive.
185
-3. Extract the `go.d.plugin-*.tar.gz` archive into a temporary
186
- location, and then copy the single file in the archive to
187
- `/usr/libexec/netdata/plugins.d` or the equivalent location for your
188
- build of Netdata and rename it to `go.d.plugin`.
189
-4. Extract the `config.tar.gz` archive to a temporarylocation and then
190
- copy the contents of the archive to `/etc/netdata` or the equivalent
191
- location for your build of Netdata.
192
-
193
-#### Building the Go collectors locally
194
-
195
-Alternatively, you may wish to build the Go collectors locally
196
-yourself. Doing so requires a working installation of Golang 1.13 or
197
-newer. Once you have the required tools, do the following:
198
-
199
-1. Verify the release version that Netdata expects to be used by checking
200
- the contents of `packaging/go.d.version` in your Netdata sources.
201
-2. Obtain the sources for that version by either:
202
- - Navigating to https://github.com/netdata/go.d.plugin and downloading
203
- and unpacking the source code archive for that release.
204
- - Cloning the repository with `git` and checking out the required tag.
205
-3. Run `make` in the go.d.plugin source tree.
206
-4. Copy `bin/godplugin` to `/usr/libexec/netdata/plugins.d` or th
207
- equivalent location for your build of Netdata and rename it to
208
- `go.d.plugin`.
209
-5. Copy the contents of the `config` directory to `/etc/netdata` or the
210
- equivalent location for your build of Netdata.
211
-
100
### eBPF collector
101
102
On Linux systems, Netdata has support for using the kernel's eBPF