- CMake
>= 3.10 - C++ Compiler
>= C++17 - and see Dockerfile section
FROM ubuntu:22.04
RUN apt update -y && apt install -y git build-essential cmake ninja-build doxygen libboost-system-dev libboost-filesystem-dev libpq-dev libssl-devWhen PostgreSQL is specified as the data storage for metadata. See How to build for how to specify.
-
Start PostgreSQL server.
-
Define metadata tables and load initial metadata.
psql postgres < sql/ddl.sqlThe default database name is
tsurugi.
How to change the database name.-
Change the database name in the
sql/ddl.sqlfile.
CREATE DATABASE your-database-name LC_COLLATE 'C' LC_CTYPE 'C' ENCODING 'UTF8' template=template0;
\c your-database-name -
Set the database name to the environment variable (
TSURUGI_CONNECTION_STRING).
export TSURUGI_CONNECTION_STRING="dbname=your-database-name"
-
When file (JSON) is specified as the data storage for metadata. See How to build for how to specify.
-
Create a directory to store metadata.
mkdir -p $HOME/.local/tsurugi/metadataYou can change the above path by set the environment variable (
TSURUGI_METADATA_DIR). The directory must exist.export TSURUGI_METADATA_DIR="your-directory-name"
-
(for PostgreSQL) Make sure that
pg_configis in the PATH (test withpg_config --pgxs). -
Retrieve third party modules.
git submodule update --init --recursive
-
Build manager.
mkdir build cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. ninjaavailable options:
-DCMAKE_INSTALL_PREFIX=<installation directory>- change install location-DBUILD_DOCUMENTS=OFF- never build documents by doxygen-DDATA_STORAGE=postgresql- specifies the data storage where the metadata is stored:postgresql,json-DLOG_LEVEL=error- specifies the default log output level (minimum) for metadata-manager:none,err[or],warn[ing],info,debug- for debugging only
-DENABLE_SANITIZER=OFF- disable sanitizers (requires-DCMAKE_BUILD_TYPE=Debug)-DENABLE_UB_SANITIZER=ON- enable undefined behavior sanitizer (requires-DENABLE_SANITIZER=ON)-DENABLE_COVERAGE=ON- enable code coverage analysis (requires-DCMAKE_BUILD_TYPE=Debug)
ninja install-
(for PostgreSQL) Update the shared library search path for libpq.
The method to set the shared library search path varies between platforms,
but the most widely-used method is to set the environment variable LD_LIBRARY_PATH like so:
In Bourne shells (sh, ksh, bash, zsh):export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<PostgreSQL install directory>/lib
-
run tests
cd build ctest -V