Creating a compilation database

scons does not natively support the creation of a compilation database, instead the bear tool can be used (bear repository) which is available on a number of Linux distributions (bear packages) as well as from conda-forge. A compilation database is a JSON file containing data on compiling each source code file in a project.

Install Bear from conda-forge

To install bear into an LSST Science Pipelines conda stack

conda install -c conda-forge bear

Use Bear and Scons to create a compilation database

bear -- scons

This will create compile_commands.json containing a list of all compilation commands that can be used in editors like VSCode to analyze and navigate the code.