Skip to content

Install

Philipp Gschwandtner edited this page Apr 26, 2017 · 2 revisions

Installation

To facilitate the development process and provide a uniform platform for applications depending on the API, an SDK is available (https://github.com/allscale/allscale_sdk). The use of this SDK is highly recommended, and the remainder of this tutorial is based on it.

Requirements

The API requires C++14 features as offered by e.g. GCC >= 4.9 (GCC 5.2.1 is used for development and testing). Furthermore CMake 3.5 (or later) is required for the build and testing process of the SDK.

Note: While it is preferred to install these tools via the operating system's package manager, suitable versions can be installed by our own dependency installer as a fallback. Its README holds further details on how to do that.

Getting the Sources

Fork the AllScale SDK on GitHub, or clone/download the sources - if the latter, change the git origin to point to your own repo

git clone git@github.com:allscale/allscale_sdk.git name-of-your-repo
git remote set-url origin url-to-your-remote-repo

Optionally add the SDK as a remote to receive future updates

git remote add SDK git@github.com:allscale/allscale_sdk.git

Running the Setup

The SDK comes with a setup utility that performs the initial setup of the CMake infrastructure.

cd name-of-your-repo
scripts/setup/run project-name

Afterwards, the following example source files have been generated

./code/app/include/project-name/app/answer.h  # <- header
./code/app/src/answer.cpp                     # <- source
./code/app/src/project-name.cxx               # <- executable source
./code/app/test/answer_test.cc                # <- unit test source

along with a few CMake files for building and testing.

Building and Testing

To test whether the environment is set up properly, build everything and run the tests

mkdir build
cd build
cmake ../code
make -j4
ctest -j4

Optionally change the compiler for cmake if necessary. Note: When changing compilers or compiler flags, we recommend clearing the build directory completely before rebuilding.

CXX="g++-6" CC="gcc-6" cmake ../code

The build directory structure resembles the source directory structure.

build/app/project-name               # <- executable
build/app/ut_answer_test             # <- unit test
Clone this wiki locally