Skip to content

Building from Source

CosmoScout VR supports 64 bits only and can be build in debug and release mode on Linux and Windows. You will need a copy of CMake (version 3.22 or greater), Boost (version 1.69 or greater) and a recent C++ compiler (gcc 7, clang 5 or msvc 19). For the compilation of the externals Python is also required.

  1. Downloading External Dependencies

    Before you start, it may be necessary to install some additional system packages.

    Getting a precompiled version of boost suitable for CosmoScout VR which will be found by CMake can be difficult: Older CMake versions fail to find boost versions which are too new; but on the other hand you need a rather new version if you use a very recent version of MSVC (e.g. 14.2, the one shipped with Visual Studio 2019). The β€œoldest” precompiled boost which you can get on SourceForge for MSVC 14.2 is version 1.70.0.

    So using version 1.70.0 may work in most cases. You can get it from from https://sourceforge.net/projects/boost/files/boost-binaries/1.70.0

    MSVCVisual StudioFileLink
    14.22019boost_1_70_0-unsupported-msvc-14.2-64.exedownload
    14.12017boost_1_70_0-msvc-14.1-64.exedownload
    14.02015boost_1_70_0-msvc-14.0-64.exedownload
  2. Cloning the Repository

    Once these dependencies are installed, you can clone the repository. Open a terminal in a directory where you want to store the source code and execute the following commands:

    Terminal window
    git clone https://github.com/cosmoscout/cosmoscout-vr.git
    cd cosmoscout-vr
    git submodule update --init --recursive
  3. Building Bundled Dependencies

    This step only has to be done once. It will compile all dependencies which are bundled as git submodules in the build directory and install them to the install directory.

    Per default, all dependencies are built in release mode using precompiled headers and unity builds where possible. This behavior can be adjusted using some environment variables:

    VariableDefaultDescription
    COSMOSCOUT_DEBUG_BUILDfalseSet to true to build everything in debug mode.
    COSMOSCOUT_USE_UNITY_BUILDtrueSet to false to disable unity builds.
    COSMOSCOUT_USE_PCHtrueSet to false to not use precompiled headers.

    You should set these as required before executing the scripts below.

    If you are using Visual Studio 2017, you have to replace -G "Visual Studio 16 2019" -A x64 with -G "Visual Studio 15 Win64". All parameters given to make_externals.bat will be forwarded to CMake. For example, you can change the CMake generator this way.

    Terminal window
    make_externals.bat -G "Visual Studio 16 2019" -A x64
  4. Building CosmoScout VR

    One can either use CMake Presets or build the software manually using CMake. Using CMake Presets is easy and definitely the recommended way.

    Terminal window
    set BOOST_ROOT=C:\local\boost_1_70_0
    # You can get a list of available configuration
    # presets using the following command:
    cmake --list-presets
    # After you decided for a preset you can
    # configure with the following command:
    cmake --preset <preset-name>
    # If you want to use clache:
    # cmake --preset <preset-name> -DCMAKE_VS_GLOBALS=CLToolExe"=clcache.exe;TrackFileAccess=false"
    # The next step is to build CosmoScout VR.
    # You can also list build presets:
    cmake --build --list-presets
    # After you decided for a preset you can build with the following command:
    cmake --build --preset <preset-name>
  5. Running CosmoScout VR

    Terminal window
    install\windows-Release\bin\start.bat

    The application can be started with the command above. When started for the very first time, some example datasets will be downloaded from the internet. This will take some time! The progress of this operation is shown on the loading screen.

  6. Optional: Running Tests

    If you specified -DCOSMOSCOUT_UNIT_TESTS=On at build time, you can now execute the unit tests with:

    Terminal window
    install\linux-Release\bin\run_tests.bat
Content Licensed under CC-BY-4.0 by German Aerospace Center (Imprint)
Build with Astro using the Starlight theme.
Hosted on GitHub Pages.