Installing GIANT

Setting up the environment

GIANT is primarily a python package with some modules written in Cython for speed improvements. This makes installation fairly straight forward in most Unix-like environments. It should be possible to install GIANT on windows using similar steps to those that follow, but this is untested. The following subsections give step by step instructions for installing GIANT.

The first step to installing GIANT is to install the mamba-forge python environment/package manager. This helps to ensure that the GIANT requirements don’t interfere with other python code you have on your system (and that other python environments you have don’t interfere with GIANT). Mamba-forge can be downloaded fom https://github.com/conda-forge/miniforge#mambaforge Once you have downloaded anaconda, install it following the instructions provided (note that you can install it to your home directory without needing admin privileges, which is a big benefit).

With mamba installed, we can now set up an environment in which to install giant

  1. Before we begin there are a couple OS specific instructions
    • macOS
      • You may need to set the environment variable CPATH to something like /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include or /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include after installing xcode or xcode command line tools to ensure system headers are available

    • Windows
  2. Create a new environment to install GIANT to and install the dependencies
    • mamba create -n giant_env python=3 opencv matplotlib scipy pandas numpy cython pyqt astropy lxml sphinx spiceypy c-compiler llvm-openmp astroquery dill psutil
      • If you are on Mac or Linux you can install imagemagick with the same command by including imagemagick at the end of the above command.

    • Note that creating a new environment is not required, but is strongly recommended.

    • Note that if you did not install mamba-forge, you need to specify to use the conda-forge repository instead of the default conda repository by adding -c conda-forge to the mamba create command.

    • Note that if you are on windows, you will unfortunately need to manually install vs2017 according to the instructions https://conda-forge.org/docs/maintainer/knowledge_base.html#local-testing

  3. Activate the new environment
    • conda activate giant_env

    • If you did not create a new environment then this step is not necessary (as long as the mamba python is first in your path).

    • You will need to do this step each time you want to use GIANT.

Installing and testing GIANT

With the anaconda environment set up and activated it is now easy to install giant.

  1. Download the GIANT source code from git
    • git clone git@github.com:nasa/giant.git

  2. Install the GIANT package
    • cd giant

    • pip install -e .

    • You can also omit the “-e” to avoid using links, but using links makes it easier to update GIANT in the future.

    • You will likely see a lot of warnings from the c compiler that can largely be ignored. If you have an error though that is a problem

  3. Check the installation (optional)
    • cd unittests

    • python -Wignore -m unittest discover

    • This should complete with no errors (skips/warnings are OK).

GIANT should now be installed and ready for use.