Installation with lsstsw and lsst-build¶
This page will guide you through installing the LSST Science Pipelines from source with lsstsw and lsst-build. These are the same tools LSST Data Management uses to build and test the Science Pipelines.
Since lsstsw presents the Science Pipelines as a directory of Git repositories clone from github.com/lsst, this installation method can be very convenient for developing Science Pipelines code.
Science Pipelines developers should also consult the DM Developer Guide, and the Workflow page in particular.
If you have difficulty installing LSST software:
- review the known installation issues for your platform.
- reach out on the Support forum at community.lsst.org.
1. Prerequisites¶
You need to install some prerequisites to build the LSST Stack from source:
- Install build dependencies.
- Install and configure Git LFS for LSST DM’s data servers.
2. Obtaining a Development Stack with lsstsw¶
Code for the LSST Stack is distributed across many Git repositories (see github.com/lsst). lsstsw is a tool that helps you manage the codebase by automating the process of cloning all of these repositories and building that development Stack for testing.
Begin by choosing a working directory, then deploy lsstsw
into it:
1 2 3 4 | git clone https://github.com/lsst/lsstsw.git
cd lsstsw
./bin/deploy
. bin/setup.sh
|
The deploy
script automates several things for you:
- installs a miniconda Python environment specific to this lsstsw workspace,
- installs EUPS in
eups/current/
, - clones lsst-build, which will run the build process for us,
- clones versiondb, a robot-made Git repository of package dependency information, and
- creates an empty Stack installation directory,
stack/
.
lsstsw
clones repositories using HTTPS.
Our guide to Setting up a Git credential helper will allow you to push new commits up to GitHub without repeatedly entering your GitHub credentials.
3. Build Science Pipelines¶
From the lsstsw
directory, run:
rebuild lsst_apps
Note
For a more complete Scinece Pipelines stack, you can run
rebuild lsst_distrib
instead.
Once the rebuild
step finishes, note the build number printed on screen.
It is formatted as “bNNNN
.”
Tell EUPS this is the current build by making a clone of the build’s EUPS tag and calling it “current
:”
eups tags --clone bNNNN current
The rebuild
command accomplishes the following:
- Clones all Science Pipelines packages from github.com/lsst. A high-bandwidth connection is helpful since the stack contains a non-trivial amount of code and test data.
- Runs the Scons-based build process to compile C++, make Swig bindings, and ultimately create the
lsst
Python package. The Stack is built and installed into thestack/
directory inside yourlsstsw/
work directory.
4. Sourcing the Pipelines in a New Shell¶
In every new shell session you will need to ‘setup’ the Science Pipelines.
Do this by running the setup.sh
from the lsstsw/
directory:
. bin/setup.sh
Note
If you are using a tcsh shell, run . bin/setup.csh
instead (note csh
extension).
5. Testing Your Installation¶
Once the LSST Science Pipelines are installed, you can verify that it works by running a demo project. This demo processes a small amount of SDSS data.
6. Bonus: Developing a Package¶
An lsstsw-based installation is great for developing packages against the LSST Science Pipelines stack. The Developer Guide describes Data Management’s workflow, but this section will get your started with the basics related to lsstsw and EUPS.
Stack packages are found in the
lsstsw/build/
directory.Create a new branch in a package’s Git repository,
git checkout -b {{ticket-name}}
Then declare this package for EUPS and set it up:
eups declare -r . -t $USER {{package_name}} git setup -r . -t $USER
Unpacking the
eups declare
arguments:-r .
is the path to the package’s repository, which is the current working directory. You don’t need to be in the repository’s directory if you provide the path appropriately.-t $USER
sets the EUPS tag. We use this because your username ($USER
) is an allowed EUPS tag.git
is used as an EUPS version. Semantically we default to calling the version “git
” to indicate this package’s version is the HEAD of a Git development branch.
In the above
eups declare
command we associated the package version “git
” with the tag “$USER
.” In runningsetup
, we told EUPS to setup the package and its dependencies with the version associated to the$USER
tag. If the$USER
tag isn’t found for dependencies, EUPS will revert to using versions of dependencies linked to thecurrent
tag. This is why we initially declared the entire lsstsw repository to have the versioncurrent
.Build the package with Scons:
scons -Q -j 6 opt=3
These flags tell SCons to build with flags:
-Q
: reduce logging to the terminal,-j 6
: build in parallel (e.g., with ‘6’ CPUs),opt=3
: build with level 3 optimization.
This
scons
command will run several targets by default, in sequence:lib
: build the C++ code and SWIG interface layerpython
: install the Python codetests
: run the test suiteexample
: compile the examples,doc
: compile Doxygen-based documentation, andshebang
: convert the#!/usr/bin/env
line in scripts for OS X compatibility (see DMTN-001).
You can build a subset of these targets by specifying one explicitly. To simply compile C++, SWIG, build the Python package and run tests:
scons -q -j 6 opt=3 tests