Installing On Linux

The preferred method is to use Python 3. For now support is also provided to use the built-in Python 2, but Python 2 support is now a depreciated functionality.

Software setup

In order to run Basilisk, the following software will be necessary. This document outline how to install this support software.

  • Cmake

  • Python 3.7.x OR Python 2.7 (numpy, matplotlib, pytest, conan, pandas)

  • SWIG (version 3 or 4)

  • GCC

Dependencies

Note

Depending on your system setup, administrative permissions (sudo or su) may be required to install these dependencies. Some distributions of Linux will use other package management commands such as yum, dnf, of pgk.

  1. CMake: Available using CMake-GUI or CMake over the command line:

    # GUI installation
    $ apt-get install cmake-gui
    
    # Command line installation
    $ apt-get install cmake
    
  2. Python 2.7 / Python 3.x with Pip:

    $ apt-get install python2.7
    $ apt-get install python3.x
    
  3. SWIG: Available using:

    $ apt-get install swig3.0
    
  4. A C/C++ Compiler: This is included by default with most Linux systems (gcc), but is necessary to build Basilisk.

  5. A Git compatible version control tool like SourceTree should be used to pull/clone the Basilisk repository.

  6. A install of Conan. Install with pip, an example is below:

    $ pip3 install conan
    

Build Process via Terminal

For Basilisk Python 2 and Python 3 inter-compatability, build using both following instructions then run using preferred python version.

  1. First step is to create the destination directory. This is dist3 for Python 3 and dist for Python 2:

    $ mkdir dist3
    $ cd dist3
    
  2. Setup Conan Repositories. These can be consolidated into a private conan server conan getting started docs:

    $ conan remote add bincrafters https://api.bintray.com/conan/bincrafters/public-conan
    $ conan remote add conan-community https://api
    
  3. CMake here in the build directory with Unix Makefiles, where the source code is located at: ../src:

    $ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../src
    

    The CMAKE_BUILD_TYPE argument can be changed to Debug as well, but the run-time performance will be significantly slower.

  4. Can do a multi core make by running make -j<number of cores +1> such as make -j5.

  5. More information is available on Basilisk cmake flag options.

  6. To test your setup you can run one of the example scenario scripts.

    • For example, in the terminal window, make basilisk/src/examples/01-OrbitalSimulations the current directory.

    • Run one of the tutorial scenarios, such as:

      $ python3 scenarioBasicOrbit.py
      

Other packages some distributions of Linux may need

# Update current software
$ apt-get update

# Helpful for Debian systems -  all packages need to compile such as gcc and g++ compilers and other utils.
$ apt-get install build-essential

# Installing the header files for the Python C API
$ apt-get install python-dev

# Package development process library to facilitate packaging Python packages
$ apt-get install python-setuptools

# Tkinter
$ apt-get install python-tk

# Python PIP
$ apt-get install python-pip

# Python pytest
$ pip install pytest