On Ubuntu, we need a C compiler, CMake, Doxygen, and libnl libraries:
sudo apt update
build_dependencies=(
cmake # build-tool
doxygen texinfo graphviz # documentation
build-essential # C and C++ compilers
libnl-genl-3-dev libnl-route-3-dev # netlink dependencies
automake # required by libmicrohttpd for some reason?
autoconf # required by compile_sqlite.sh
libtool-bin # required by autoconf somewhere
pkg-config # seems to be required by nDPI
libjson-c-dev # mystery requirement
protobuf-compiler
flex bison
libssl-dev # required by hostapd only. GRPC uses own version, and we compile OpenSSL 3 for EDGESec
)
runtime_dependencies=(
dnsmasq
jq # required by predictable wifi name script
)
sudo apt install -y "${build_dependencies[@]}" "${runtime_dependencies[@]}
To install grpc dependencies:
cd lib/
sudo ./compile_grpc_deps.sh
Compiling EDGESec is done with CMake.
First, configure cmake
in the build/
directory by running the following.
(equivalent to mkdir build && cd build && cmake ..
)
This is currently very slow, as it compiles all the C programs single-core.
cmake -B build/ -S .
To build, you can then run (-j4
means 4 jobs/threads, replace 4
with the amount of cores you want to use):
(equivalent to make -j4
)
cmake --build build/ -j4
After succesful compilation the binary will be located in ./build/src
folder.
You can use the following to also install files into build/edgesec-dist
(equivalent to make install
):
cmake --build build/ --target install -j4
To run edgesec
tool with a configuration file config.ini
located in ./build
folder use:
./build/src/edgesec -c ./build/config.ini
To enable verbose debug mode use:
./build/src/edgesec -c ./build/config.ini -ddddd
To compile the tests use:
cmake -B build/ -S .
cmake --build build/ --target test -j4 # or `make test`
To run each test individually the test binaries can be located in ./build/tests
folder.
To compile the docs from ./build
folder:
make doxydocs
See ./docs
for how to build the developer doxygen documentation website.