Building from source#

Note

If you are only trying to install Einsums, we recommend using binaries - Installation for details on that.

Building Einsums from source requires setting up system-level dependencies (compilers, BLAS/LAPACK libraries, etc.) first, and then invoking a build. The build may be done in order to install Einsums for local usage, develop Einsums itself, or build redistributable binary packages. Any it may be desired to customize aspects of how the build is done. This guide will cover all these aspects. In addition, it provides background information on how the Einsums build works.

System-level dependencies#

Einsums is a C++ compiled library, which means you need compilers and some other system-level dependencies to build it on your system.

Note

If you are using Conda, you can skip the steps in this section - with the exception of installing the Apple Developer Tools for macOS. All other dependencies will be installed automatically by the mamba env create -f devtools environment.yml command.

If you don’t have a conda installation yet, we recommend using Mambaforge; any conda flavor will work though.

You will need:

  • C++ compiler with C++20 support (GCC, LLVM/Clang, or Intel).

  • BLAS and LAPACK libraries. OpenBLAS is the Einsums default; other variants include Apple Accelerate, MKL, ATLAS and Netlib ( or “Reference”) BLAS and LAPACK.

  • CMake

Optional:

  • For the Fourier Transform abilities, you will need either FFTW3 or MKL.

Need to include instructions for installing system-wide dependencies on various distributions.

blah blah blah

Install Apple Developer Tools. An easy way to do this is to open a terminal window, enter the command:

xcode-select --install

and follow the prompts. Apple Developer Tools includes Git, the Clang C/C++ compilers, and other development utilities that may be required.

Windows is not supported at this time.

Building Einsums from source#

If you want to build from source in order to work on Einsums itself, first clone the Einsums repository.:

git clone https://github.com/Einsums/Einsums.git
cd Einsums

Then you want to do the following:

  1. Create a dedicated development environment (conda environment),

  2. Install all needed dependencies (build, and also test, and doc dependencies.

  3. Build Einsums.

To create an einsums-dev development environment with every required and optional dependency installed, run:

mamba env create -f devtools/conda-envs/environment.yml
mamba activate einsums-dev

To build Einsums in an activated development environment, run:

mkdir build
cd build
cmake ..
make

This will build Einsums inside the build directory. You can then run tests (ctest), or take other development steps like build the html documentation or running benchmarks.

Customizing builds#