Skip to content

Installation

sciplot is a header-only library that needs a C++17-capable compiler.

It has no external dependencies for compiling! The only external runtime dependencies are [gnuplot-palettes] for providing color palettes (automatically handled for you) and a [gnuplot] executable.

Thus, please install Gnuplot!.

Installing sciplot is easy, since it is a header-only library. Follow the steps below.

Download

Download sciplot by git cloning its GitHub repository:

git clone https://github.com/sciplot/sciplot --recursive

Installation by copying

Assuming the git cloned repository or extracted source code resides in a directory named sciplot, you can now copy the directory sciplot/sciplot to somewhere in your project directory and directly use sciplot.

This quick and dirty solution should suffice in most cases. If this solution bothers you, read the next section!

Installation using FetchContent

The FetchContent CMake module can also be used to fetch Sciplot properly:

include(FetchContent) # If not included already

FetchContent_Declare(sciplot_content
  GIT_REPOSITORY https://github.com/sciplot/sciplot.git
  GIT_TAG master)

FetchContent_GetProperties(sciplot_content)
if(NOT sciplot_content_POPULATED)
  FetchContent_Populate(sciplot_content)
endif()

include_directories(${sciplot_content_SOURCE_DIR})

Installation using CMake

If you have cmake installed in your system, you can then install sciplot (and also build its tests and examples) as follows:

mkdir build && cd build
cmake ..
cmake --build . --target install

We assume above that you are in the root of the source code directory, under sciplot! The build directory will be created at sciplot/build.

The previous installation commands will require administrative rights in most systems. To install sciplot locally, use:

cmake .. -DCMAKE_INSTALL_PREFIX=/some/local/dir

Installation failed. What do I do?

Check the known issues and if your problem persists, create a new issue, and let us know what happened and possibly how we can improve the installation process of sciplot.