Introduction

zgraph is a modern C++ graph library

cookiecutter.project_name provides:

  • an API following the idioms of the C++ standard library.

Licensing

This software is licensed under the BSD-3-Clause license. See the LICENSE file for details.

Installation

Although zgraph is a header-only library, we provide standardized means to install it, with package managers or with cmake.

Besides the zgraph headers, all these methods place the cmake project configuration file in the right location so that third-party projects can use cmake’s find_package to locate xtensor headers.

From source with cmake

You can also install zgraph from source with cmake. On Unix platforms, from the source directory:

mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
make install

On Windows platforms, from the source directory:

mkdir build
cd build
cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=/path/to/prefix ..
nmake
nmake install

See the section of the documentation on build-options, for more details on how to cmake options.

Changelog

0.1.0

  • inital version

Basic usage

#include "zgraph/zgraph.hpp"

Examples

The hello world of zgraph

1
2
3
4
5
6
#include "zgraph/zgraph.hpp"
#include "zgraph/zgraph_config.hpp"

int main(int argc, char *argv[]){

}

Print the versions of zgraph

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#include <iostream>

#include "zgraph/zgraph.hpp"
#include "zgraph/zgraph_config.hpp"

int main(int argc, char *argv[]){
    std::cout<<"ZGRAPH_VERSION_MAJOR "<<ZGRAPH_VERSION_MAJOR<<"\n";
    std::cout<<"ZGRAPH_VERSION_MINOR "<<ZGRAPH_VERSION_MINOR<<"\n";
    std::cout<<"ZGRAPH_VERSION_PATCH "<<ZGRAPH_VERSION_PATCH<<"\n";
}

Compiler workarounds

This page tracks the workarounds for the various compiler issues that we encountered in the development. This is mostly of interest for developers interested in contributing to zgraph.