Skip to main content

Installation Instructions


The CSDL compiler requires Python. It is recommended to install Python using Anaconda or Miniconda.

After installing Python, please install

  1. csdl
  2. A CSDL compiler back end.

To install csdl, first clone the repository and install using pip. From the terminal/command line,

git clone https://github.com/lsdolab/csdl.gitpip install -e csdl/

To install a back end, please select a back end from from the List of Available Back Ends and follow the installation instructions for that package.

important

The CSDL compiler is composed of two packages, csdl, and a compiler back end. Simulation code cannot be generated or executed if only the csdl package is installed.

It is highly recommended to create a different environment for each back end, as they may require different versions of csdl.

Updating#

To update csdl to the latest version,

cd path/to/csdlgit pull
note

On Windows, use \ instead of /.

important

Make sure to keep the back end(s) installed on your computer up to date according to their update instructions.

Testing#

csdl provides tests that are independent of the compiler back end implementation. That is, tests are implementation-agnostic.

To run all tests for the CSDL compiler, navigate to the directory containing the csdl package and run

pytest -s --backend <backend>

where <backend> (including angle brackets) is the name of the back end implementation. Quotes are not required.

For example, if using csdl_om as the back end, run

pytest -s --backend csdl_om
note

The tests supplied by csdl do not run any tests specific to the back end implementation.

note

The csdl_om package supplies the compiler back end used to generate all output generated from examples in this documentation.

If all tests pass for one back end implementation, but not another, that is an indication that the back end implementation that resulted in test failures has a bug.

If the bug is an indication of lack of test coverage in the frontend, new tests should be added to csdl to ensure compliance among all back end implementations.

Tools#

To get the best experience using CSDL, use your favorite Python Integrated Development Environment (IDE) or text editor with your favorite extensions.

To install recommended tools, use

pip install yapf mypy isort

and follow the instructions for your IDE/text editor to integrate them into your workflow.