1.2. Installation¶
1.2.1. Prerequisites¶
Prerequisites are curl
, git
and make
.
If they’re not installed, use the following command to install them:
sudo apt install curl git make
1.2.2. Installation via conda
¶
Installation via conda
helps with obtaining software dependencies
such as C compiler, Python interpreter, SUNDIALS, etc.
Additionally, all dependencies (except Julia and Julia packages)
will be installed in a separate environment,
therefore, there will be no conflicts with system packages.
If conda
is not installed, it can be installed via the following command:
curl -LO https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
bash Miniforge3-Linux-x86_64.sh
Then clone the Open Interfaces repository and go to the repository directory:
git clone https://github.com/MaRDI4NFDI/open-interfaces
cd open-interfaces
After that, create an environment for Open Interfaces and install dependencies:
conda env create -n open-interfaces -f environment-linux.yaml
Then activate the created environment:
conda activate open-interfaces
Note that the environment name open-interfaces
can be changed at your will.
Then Julia must be installed via the following command from the official instructions:
curl -fsSL https://install.julialang.org | sh
Then we can activate the environment for Open Interfaces and install required Julia packages:
julia --project=. -e "using Pkg; Pkg.instantiate()"
Finally, we set auxiliary environment variables via the following command:
source env.sh
1.2.3. Build¶
After the necessary dependencies are installed, and environments are activated, we can build Open Interfaces.
To build the software, use command
make release
which invokes underlying CMake build and builds Open Interfaces inside
the build
directory.
To test that the build processes has succeeded, use command
make test
1.2.4. Quality assurance during development¶
For quality assurance, we write unit tests that test communication between different clients and solvers. The full test suite can be run using the command
make test
Additionally, to ensure code consistency,
we use pre-commit
.
It is configured to run multiple checks for formatting and trailing whitespace
for all source code in the repository.
During development, the checks can be run automatically by installing
a pre-commit Git hook:
pre-commit install
or by invoking it manually via
pre-commit run --all-files
We recommend running it automatically so that the code is pushed only after formatting checks.