In order to compile HoraeDB, some relevant dependencies(including the Rust toolchain) should be installed.
Assuming the development environment is Ubuntu20.04, execute the following command to install the required dependencies:
sudo apt install git curl gcc g++ libssl-dev pkg-config protobuf-compiler
If the development environment is MacOS, execute the following command to install the required dependencies.
xcode-select --install
brew install protobuf
Rust can be installed by rustup. After installing rustup, when entering the HoraeDB project, the specified Rust version will be automatically downloaded according to the rust-toolchain file.
After execution, you need to add environment variables to use the Rust toolchain. Basically, just put the following commands into your ~/.bashrc or ~/.bash_profile:
source $HOME/.cargo/env
Compile horaedb-server by the following command in project root directory:
cargo build
Then you can run it using the default configuration file provided in the codebase.
./target/debug/horaedb-server --config ./docs/minimal.toml
When compiling on macOS, you may encounter following errors:
IO error: while open a file for lock: /var/folders/jx/grdtrdms0zl3hy6zp251vjh80000gn/T/.tmpmFOAF9/manifest/LOCK: Too many open files or error: could not compile `regex-syntax` (lib) warning: build failed, waiting for other jobs to finish... LLVM ERROR: IO failure on output stream: File too large error: could not compile `syn` (lib)
To fix those, you should adjust ulimit as follows:
ulimit -n unlimited ulimit -f unlimited
Building horaemeta-server require Golang version >= 1.21, please install it before compile.
Then in horaemeta directory, execute:
go build -o bin/horaemeta-server ./cmd/horaemeta-server/main.go
Then you can run horaemeta-server like this:
bin/horaemeta-server