Adiar  2.0.0
An External Memory Decision Diagram Library
Getting Started

Dependencies

One needs a C++ compiler of ones choice that supports the 17 standard, such as the GNU, Clang, and MSVC C++ compilers. The project also has dependencies on the TPIE library, which itself has dependencies on the Boost Library. Finally, the entire project is built with CMake.

Furthermore, to create the documentation files, you need the Doxygen tool. Finally, the unit tests also verify the dot output generated by Adiar is valid.

To install all of the above then run the respective command below.

Operating System Shell command
Ubuntu 22+ apt install cmake g++ libboost-all-dev doxygen graphviz
Fedora 36+ dnf install cmake gcc-c++ boost-devel doxygen graphviz

Building with CMake

To get started with Adiar, you need to place the repository somewhere on your machine. The simplest way to do so is to add it as a submodule inside of your Git repository.

git submodule add https://github.com/SSoelvsten/adiar external/adiar
git submodule update --init --recursive

Then include the following line in your project's CMakeLists.txt.

add_subdirectory (external/adiar adiar)

Finally, every single executable target is linked to Adiar in the CMakeLists.txt file with the following lines.

add_executable(<target> <source>)
target_link_libraries(<target> adiar)

Usage

After having linked the C++ source file with Adiar as described above, then one needs to include the <adiar/adiar.h> header, initialise the library before use, and finally remember to deinitialise the library again before the program terminates.

#include <adiar/adiar.h>
int main()
{
adiar::adiar_init(128 * 1024 * 1024);
{
// do your stuff here...
}
}
void adiar_init(size_t memory_limit_bytes, std::string temp_dir="")
Initiates Adiar with the given amount of memory (given in bytes)
void adiar_deinit()
Closes and cleans up everything by Adiar.

In between, you can create and manipulate the Binary Decision Diagrams and Zero-suppressed Decision Diagrams .

Warning
Before calling adiar::adiar_deinit you have destruct all of Adiar's objects that you own, e.g. by letting them go out of scope with the { and } braces shown above.
One cannot reinitialize Adiar. That is, one cannot call adiar::adiar_init, adiar::adiar_deinit and then adiar::adiar_init again without getting undefined behaviour when running the algorithms.