There are two main programs that can be built. The first one is the hisqry database program. That accepts SQL statement and is the database program. There are few ways to build hisqry. The best way is using a single-compilation unit way from src/single. This produces a small binary file. Memory usage is high with single build. The other ways are based on building multiple objects and libraries. This uses significantly more disk space but is more convenient for development. # Libraries: C++17 boost (spirit, program option, asio, unit_test_framework) libedit / readline # src/single - BSD Make / GNU Makefile: Single build allows to compile and link all source files at once. This only requires ~100 MB of disk space. ## How to build and run % cd src/single % make % ./hisqry.pm ## Machine Resources - Building Single Hisqry: FreeBSD 13.0-RELEASE i386 with 2GB RAM - peak memory usage at ~1.5GB with clang10 FreeBSD 12.2-RELEASE amd64 with 2GB RAM - peak memory usage at ~2.3GB with clang10 NetBSD 9.1 i386 with 3GB RAM - peak memory usage at ~1.5GB with clang10 - peak memory usage at ~2.3GB with gcc10 Linux Ubuntu 21.04 amd64 with 4GB RAM - peak memory usage at ~3.5GB with gcc10 # CMake - multi-module hisqry and unit tests CMake builds hisqry and unittest. This uses shared libraries and loading of unittest cases seems linker dependent. llvm's ld runs test cases okay but not GNU ld. Object files are large and require ~5GB disk space. ## How to build and run #1 % mkdir build % cd build % cmake .. % cmake --build . -j 5 % ./src/hisqry/hisqry.pm ## How to build #2 % make cmake FreeBSD 13.0-RELEASE i386 with 2GB RAM - peak memory usage at ~2GB with clang10 FreeBSD 12.2-RELEASE amd64 with 5GB RAM + 5GB swap - peak memory usage at ~2.7GB with clang10 Linux Ubuntu 21.04 amd64 with 8GB RAM - peak memory usage at ~5.5GB with gcc10 # BSD Make - multi-module hisqry and unit tests The other Makefiles are BSD Makefiles. These are used for primary development and have extra debug and sanity check flags are enabled. These use static libraries. There are extra debug helper programs and targets for debugging and testing. Top level Makefile is used most often as a trigger. This builds hisqry and unittest. ## How to build and run % make % src/hisqry/hisqry.pm % test/boost/test.pm # Machine Resources - Building hisqry (src/hisqry) and Unit Tests (test/boost) FreeBSD 12.2-RELEASE amd64 with 5GB RAM + 5GB swap - peak memory usage at ~3.7GB with clang10 # Machine Resources - Building Unit Tests - test/boost A collection on unit test cases are stored. This can be built with BSD Make or CMake. # Machine Resources - Building Unit Tests - test/single A large subset of test/boost is build from this directory as a single compilation unit. This requires extensive amount of memory. This only requires ~200 MB of disk space. FreeBSD 13.0-RELEASE i386 with 2GB RAM - cannot build as peak memory exceeds maximum of 4GB with clang10 FreeBSD 12.2-RELEASE amd64 with 5GB RAM + 5GB swap - peak memory usage at ~5.3GB with clang10 Linux Ubuntu 21.04 amd64 with 12GB RAM - peak memory usage at ~11GB with gcc10 Machine Resources: FreeBSD 12.2/13.0-RELEASE i386 with 4GB memory with 2GB Memory + 2GB swap for unittests - peak memory usage at ~3GB with clang10 BSD Make: BSD Make is one of the primary development tool used. % cd src/hisqry % make -j 5 CMake Same as above. % cd build % cmake .. % cmake --build . -j 5 % ./test/boost/hisqry.pm Directory Hierarchy src/single - hisqry program with a single compilation command src/hisqry - hisqry program with modules - same as above src/type - hisqry base types and exceptions src/db - an implementation of database - 'type' is the only dependency src/opr - an abstraction layer of SQL commands into C++ classes src/sql - SQL parser that generates opr classes src/eng - engine that ties sql parser, opr classes, and db implementation test/boost - unit test cases with Boost Test Framework