2019-07-20 22:47:10 +02:00
|
|
|
## BUILD (standalone)
|
2019-06-22 02:26:15 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
##### Compatibility Primer
|
2019-06-22 02:26:15 +02:00
|
|
|
|
|
|
|
This section is intended to allow building with dependencies that have not
|
|
|
|
made their way to mainstream systems. Important notes that may affect you:
|
|
|
|
|
2020-04-07 02:31:25 +02:00
|
|
|
- Boost: The required version is available through `apt` as `libboost-all-dev` on
|
2019-06-22 02:26:15 +02:00
|
|
|
Ubuntu Cosmic (18.10). All earlier releases (including 18.04 LTS) can configure
|
|
|
|
with `--with-included-boost` as instructed below.
|
|
|
|
|
2020-04-29 23:48:38 +02:00
|
|
|
- RocksDB: THE COMPLETE SOURCE-CODE OF ROCKSDB MUST BE AVAILABLE TO BUILD CONSTRUCT.
|
2020-05-05 01:28:14 +02:00
|
|
|
This is different from the `include/` and `lib/` files installed by your
|
|
|
|
distribution's package system. You do not have to build the source, but it must
|
|
|
|
be available. ALL UBUNTU USERS MUST BUILD THE SOURCE AS WELL (SKIP TO NEXT BULLET).
|
|
|
|
|
2020-04-29 23:48:38 +02:00
|
|
|
```
|
|
|
|
git submodule update --init deps/rocksdb
|
|
|
|
cd deps/rocksdb
|
|
|
|
git fetch --tags --force
|
|
|
|
git checkout v5.17.2
|
|
|
|
```
|
2019-06-22 02:26:15 +02:00
|
|
|
|
2020-05-05 01:28:14 +02:00
|
|
|
- RocksDB: All Ubuntu users on all releases must configure Construct with the
|
|
|
|
option `--with-included-rocksdb`. This will fetch and properly build rocksdb.
|
|
|
|
|
|
|
|
> Ubuntu builds their library with `-Bsymbolic-functions`. This conflicts with
|
|
|
|
the requirements of Construct's embedding.
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
##### Installation Primer
|
2019-06-22 02:26:15 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
A general overview of what construct will build and install is given here. At
|
|
|
|
this time it is suggested to supply `./configure` with a `--prefix` path,
|
|
|
|
especially for development. Example `--prefix=~/.local/`.
|
2019-06-22 02:26:15 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
- Binary executable `$prefix/bin/construct`
|
|
|
|
- Shared library `$prefix/lib/libircd.so`
|
|
|
|
- Shared library modules `$prefix/lib/modules/construct/*.so`
|
|
|
|
- Header files `$prefix/include/ircd/*`
|
|
|
|
- Read-only shared assets `$prefix/share/construct/*`
|
|
|
|
- Database directory may be established at `$prefix/var/db/construct/`
|
2019-06-22 02:26:15 +02:00
|
|
|
|
|
|
|
```
|
2019-07-20 22:47:10 +02:00
|
|
|
Do not set your `--prefix` path to a directory inside your git repository or
|
|
|
|
an invocation of `git clean` will erase your database in $prefix/var/db/.
|
2019-06-22 02:26:15 +02:00
|
|
|
```
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### STANDALONE BUILD PROCEDURE
|
2019-06-22 02:26:15 +02:00
|
|
|
|
|
|
|
```
|
2019-07-20 22:47:10 +02:00
|
|
|
./autogen.sh
|
2020-04-29 23:48:38 +02:00
|
|
|
./configure --prefix=$PWD/build
|
2019-06-22 02:26:15 +02:00
|
|
|
make install
|
|
|
|
```
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
> The `--with-included-*` will fetch, configure **and build** the dependencies included
|
2020-04-29 23:48:38 +02:00
|
|
|
as submodules. The result will not be installable on the system without this repository
|
|
|
|
remaining intact. Please read the compatibility primer first to understand which options
|
2019-07-20 22:47:10 +02:00
|
|
|
you need or don't need on your system.
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
### Additional build options
|
2018-09-14 08:43:54 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Debug mode
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--enable-debug
|
|
|
|
```
|
|
|
|
Full debug mode. Includes additional code within `#ifdef RB_DEBUG` sections.
|
|
|
|
Optimization level is `-Og`, which is still valgrind-worthy. Debugger support
|
2019-07-20 22:47:10 +02:00
|
|
|
is `-ggdb`. Log level is `DEBUG` (maximum). Assertions are enabled. No
|
|
|
|
sanitizer instrumentation is generated by default in this mode.
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Generic mode binary (for distribution packages)
|
2018-09-14 08:43:54 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
Construct developers have set the default compilation to generate native
|
|
|
|
hardware operations which may only be supported on very specific targets. For
|
|
|
|
a generic mode binary, package maintainers may require this option.
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--enable-generic
|
|
|
|
```
|
|
|
|
Sets `-mtune=generic` as `native` is otherwise the default.
|
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Compact mode (experimental)
|
2019-06-07 00:10:13 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--enable-compact
|
|
|
|
```
|
|
|
|
Create the smallest possible resulting output. This will optimize for size
|
|
|
|
(if optimization is enabled), remove all debugging, strip symbols, and apply
|
|
|
|
any toolchain-feature or #ifdef in code that optimizes the output size.
|
|
|
|
|
|
|
|
_This feature is experimental. It may not build or execute on all platforms
|
|
|
|
reliably. Please report bugs._
|
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Manually enable assertions
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--enable-assert
|
|
|
|
```
|
|
|
|
Implied by `--enable-debug`. This is useful to specifically enable `assert()`
|
|
|
|
statements when `--enable-debug` is not used.
|
|
|
|
|
2020-04-29 23:59:29 +02:00
|
|
|
```
|
|
|
|
--with-assert=trap
|
|
|
|
```
|
|
|
|
Recommended when using `--enable-assert` for debugging. This replaces the
|
|
|
|
default mechanism of assertion with traps rather than aborts; allowing
|
|
|
|
developers to explore an unterminated program.
|
2018-09-14 08:43:54 +02:00
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Manually enable optimization
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--enable-optimize
|
|
|
|
```
|
|
|
|
This manually applies full release-mode optimizations even when using
|
|
|
|
`--enable-debug`. Implied when not in debug mode.
|
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Disable third-party dynamic allocator libraries
|
2019-07-03 23:31:05 +02:00
|
|
|
|
|
|
|
```
|
2019-07-04 06:41:48 +02:00
|
|
|
--disable-malloc-libs
|
2019-07-03 23:31:05 +02:00
|
|
|
```
|
|
|
|
`./configure` will detect alternative `malloc()` implementations found in
|
|
|
|
libraries installed on the system (jemalloc/tcmalloc/etc). Construct developers
|
|
|
|
may enable these to be configured by default, if detected. To always prevent
|
|
|
|
any alternative to the default standard library allocator specify this option.
|
|
|
|
|
|
|
|
|
2019-07-20 22:47:10 +02:00
|
|
|
#### Enable third-party dynamic allocator libraries
|
|
|
|
|
|
|
|
Currently:
|
|
|
|
|
|
|
|
```
|
|
|
|
--enable-jemalloc
|
|
|
|
```
|
|
|
|
|
|
|
|
`./configure` will detect alternative `malloc()` implementations found in
|
|
|
|
libraries installed on the system (jemalloc/tcmalloc/etc). Construct developers
|
|
|
|
may not enable these to be configured by default, falling back on the default
|
|
|
|
allocator. To always use one of the alternative allocators use one option here.
|
|
|
|
|
|
|
|
|
|
|
|
#### Logging level
|
2018-09-14 08:43:54 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
--with-log-level=
|
|
|
|
```
|
|
|
|
This manually sets the level of logging. All log levels at or below this level
|
|
|
|
will be available. When a log level is not available, all code used to generate
|
|
|
|
its messages will be entirely eliminated via *dead-code-elimination* at compile
|
|
|
|
time.
|
|
|
|
|
|
|
|
The log levels are (from logger.h):
|
|
|
|
```
|
|
|
|
7 DEBUG Maximum verbosity for developers.
|
|
|
|
6 DWARNING A warning but only for developers (more frequent than WARNING).
|
|
|
|
5 DERROR An error but only worthy of developers (more frequent than ERROR).
|
|
|
|
4 INFO A more frequent message with good news.
|
|
|
|
3 NOTICE An infrequent important message with neutral or positive news.
|
|
|
|
2 WARNING Non-impacting undesirable behavior user should know about.
|
|
|
|
1 ERROR Things that shouldn't happen; user impacted and should know.
|
|
|
|
0 CRITICAL Catastrophic/unrecoverable; program is in a compromised state.
|
|
|
|
```
|
|
|
|
|
|
|
|
When `--enable-debug` is used `--with-log-level=DEBUG` is implied. Otherwise
|
|
|
|
for release mode `--with-log-level=INFO` is implied. Large deployments with
|
|
|
|
many users may consider lower than `INFO` to maximize optimization and reduce
|
|
|
|
noise.
|