diff --git a/README.md b/README.md index 74fe3a7..5bc9c6b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,8 @@ - -[![Build Status](https://travis-ci.org/chistopher/girgs.svg)](https://travis-ci.org/chistopher/girgs) - This project contains an implementation of a linear-time sampling algorithm for geometric inhomogeneous random graphs (GIRG) with a special case implementation for hyperbolic random graphs (HRG). Details on the algorithms as well as the models can be found in our corresponding paper: -Efficiently Generating Geometric Inhomogeneous and Hyperbolic Random Graphs ([conference version](http://dx.doi.org/10.4230/LIPIcs.ESA.2019.21), [full version](https://arxiv.org/abs/1905.06706)). -To cite this work, please use the bibtex entry for our conference version. +Efficiently Generating Geometric Inhomogeneous and Hyperbolic Random Graphs ([conference version](http://dx.doi.org/10.4230/LIPIcs.ESA.2019.21), [journal version](https://doi.org/10.1017/nws.2022.32)). We provide a C++ library and a command line client for each of the two generators. @@ -32,11 +28,11 @@ The result should look something like this. ``` HyperGIRGs command line interface. -girgs v1.0.0 (2dd23aad456e) +girgs v1.0.2 (8a6647cd7ec2) Generator for Geometric Inhomogeneous Random Graphs -Hasso Plattner Institute +Karlsruhe Institute of Technology https://github.com/chistopher/girgs/ -christopher.weyand@hpi.de +christopher.weyand@kit.edu ``` ## Windows @@ -58,7 +54,7 @@ An integration into the [NetworKit](https://networkit.github.io) framework is pl ## Build from Source To build the project from source you need -- CMake 3.9 +- CMake 3.12+ - C++11 - OpenMP - OPTIONAL: CPU with BMI2 instruction set @@ -66,27 +62,22 @@ To build the project from source you need The optional development components use - [Google Test](https://github.com/google/googletest) - [Google Benchmark](https://github.com/google/benchmark) -- [Doxygen](https://github.com/google/benchmark), which uses [Graphviz](https://www.graphviz.org/) and latex +- [Doxygen](https://github.com/google/benchmark), which uses [Graphviz](https://www.graphviz.org/) - [Boost](https://www.boost.org/) The simplest way to build the project is ``` -mkdir build -cd build -cmake .. -make +cmake -DCMAKE_BUILD_TYPE=Release -B build +cmake --build build ``` - -Otherwise, our `configure` script provides reasonable defaults -for release, debug, and packaging builds. -For example, to install the project from source use +or for a debug build ``` -./configure -./configure pack -cmake --build ./build/ -cmake --build ./build/ --target install +cmake -DOPTION_BUILD_TESTS=ON -B build-debug +cmake --build build-debug ``` -Specifying the `pack` target instead of `install` generates a debian package that can be installed via aptitude or dpkg. + +The project can be installed globally with the `install` target. +Alternatively, there is the `pack` target which generates a debian package that can be installed via aptitude or dpkg. # CLI @@ -158,5 +149,19 @@ generator.generate(seed); For details we refer to our example applications in `source/examples/` or the CLI's in `source/cli/`. Also, a deployed version of the documentation is available at [weyand.dev/girgs](https://weyand.dev/girgs/). -I suggest to look at the `girgs` namespace. + +# Usage in a CMake Project + +To include girgs into your CMake project, it's as simple as this. +```cmake +cmake_minimum_required(VERSION 3.12) +project(ineedgirgs CXX) +find_package(girgs REQUIRED) +add_executable(main main.cpp) +target_link_libraries(main PRIVATE girgs::girgs) +``` + +If you have girgs installed globally (e.g. via the Debian package), they are found automatically. +If you want to link against a source build, then add the girgs repo to your `CMAKE_PREFIX_PATH` or specify it directly when configuring the build. +That is, in your repo do `cmake -Dgirgs_DIR=~/repos/girgs/ -B build-debug`. diff --git a/configure b/configure deleted file mode 100755 index 8d56287..0000000 --- a/configure +++ /dev/null @@ -1,134 +0,0 @@ -#!/bin/bash - -# Default options -BUILD_DIR="build" -CMAKE_GENERATOR="Unix Makefiles" -BUILD_TYPE="Release" -CMAKE_OPTIONS="$CMAKE_OPTIONS" - -# Create default configs -if [ ! -d "./.localconfig" ] -then - mkdir ".localconfig" - - touch ".localconfig/default" - echo "#!/bin/bash" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Default configuration for configure (is always sourced)" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# CMake generator" >> ".localconfig/default" - echo "CMAKE_GENERATOR=\"Unix Makefiles\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Build directory and build type" >> ".localconfig/default" - echo "BUILD_DIR=\"build\"" >> ".localconfig/default" - echo "BUILD_TYPE=\"Release\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Installation directory" >> ".localconfig/default" - echo "#CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=../install\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Build static libraries" >> ".localconfig/default" - echo "#CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Enable examples" >> ".localconfig/default" - echo "#CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_EXAMPLES:BOOL=ON\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Enable documentation" >> ".localconfig/default" - echo "#CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_DOCS:BOOL=ON\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Disable BMI2" >> ".localconfig/default" - echo "#CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_USE_BMI2:BOOL=OFF\"" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# CMake and environment variables (e.g., search paths for external libraries)" >> ".localconfig/default" - echo "" >> ".localconfig/default" - echo "# Qt" >> ".localconfig/default" - echo "#export CMAKE_PREFIX_PATH=\"\${CMAKE_PREFIX_PATH}:/opt/Qt5.2.1/5.2.1/gcc_64/\"" >> ".localconfig/default" - - touch ".localconfig/debug" - echo "#!/bin/bash" >> ".localconfig/debug" - echo "" >> ".localconfig/debug" - echo "# Configuration for debug builds" >> ".localconfig/debug" - echo "" >> ".localconfig/debug" - echo "# Build directory and build type" >> ".localconfig/debug" - echo "BUILD_DIR=\"\${BUILD_DIR}-debug\"" >> ".localconfig/debug" - echo "BUILD_TYPE=\"Debug\"" >> ".localconfig/debug" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_EXAMPLES:BOOL=ON -DOPTION_BUILD_TESTS:BOOL=ON -DOPTION_BUILD_BENCHMARKS:BOOL=ON\"" >> ".localconfig/debug" - - touch ".localconfig/pack" - echo "#!/bin/bash" >> ".localconfig/pack" - echo "" >> ".localconfig/pack" - echo "# Configuration for creating packages" >> ".localconfig/pack" - echo "" >> ".localconfig/pack" - echo "# Installation directory" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=/usr\"" >> ".localconfig/pack" - echo "" >> ".localconfig/pack" - echo "# Enable all components for the package" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_EXAMPLES:BOOL=OFF\"" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_CLI:BOOL=ON\"" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_DOCS:BOOL=OFF\"" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_TESTS:BOOL=OFF\"" >> ".localconfig/pack" - echo "CMAKE_OPTIONS=\"\${CMAKE_OPTIONS} -DOPTION_BUILD_BENCHMARKS:BOOL=OFF\"" >> ".localconfig/pack" - - echo "Default configuration has been written to .localconfig" - echo "Please review and adjust the configuration, then run again" - echo "" - echo " ./configure $@" - - exit -fi - -# Read local default options -if [ -f "./.localconfig/default" ] -then - . ./.localconfig/default -fi - -# Parse command line arguments -for ARG in "$@" -do - # Read in configuration for that command-line argument - CONFIGFILE="./.localconfig/$ARG" - if [ -f "./.localconfig/$ARG" ] - then - . "./.localconfig/$ARG" - elif [ -f "$HOME/.localconfig/$ARG" ] - then - . "$HOME/.localconfig/$ARG" - else - echo "Configuration \"$ARG\" not found (searched in ./.localconfig and ~/.localconfig)" - fi -done - -if [ "$CMAKE_GENERATOR_OVERRIDE" != "" ] -then - echo "Override CMAKE_GENERATOR to $CMAKE_GENERATOR_OVERRIDE" - CMAKE_GENERATOR="$CMAKE_GENERATOR_OVERRIDE" -fi - -# Configure build -echo "Configuring in $BUILD_DIR..." -echo "" - -# Create build directory -if [ ! -d "$BUILD_DIR" ] -then - mkdir -p "$BUILD_DIR" -fi - -# Configure project -PREVIOUS_DIR=$(pwd) -cd $BUILD_DIR -echo cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR" -cmake -G "$CMAKE_GENERATOR" "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" $CMAKE_OPTIONS "$PREVIOUS_DIR" -if [ $? == 0 ] -then - echo "" - echo "Project configured. To build the project, use"; - echo "" - echo " cmake --build $BUILD_DIR" -else - echo "" - echo "Configuration failed."; -fi - -cd "$PREVIOUS_DIR"