Skip to content

Complete guide to building on fresh Linux system

Edgar Solomonik edited this page Aug 29, 2022 · 1 revision

This guide is intended to provide new linux users attempting to build Cyclops for development and testing, a complete guide of how to build necessary packages. The instructions were tested on an Ubuntu 20.04 system in August 2022. See .github/workflows/autotest.yml for build instructions for the automated build, which are similar and also include an Apple build. Advanced users should refer to the general build instructions, which detail how to build Cyclops with MKL or other BLAS libraries and omit general instructions on other packages and python environments.

The following C++ packages are needed.

sudo apt install libblas-dev
sudo apt install liblapack-dev
sudo apt install mpich
git clone git@github.com:cyclops-community/ctf.git
cd ctf

C++ only build

Configure as below, include CXXFLAGS="-g -O0" when developing/debugging for faster build speed / clean stack traces.

./configure --no-dynamic

Build library locally

make

Test local library with 1,2 MPI processes

make test; make test2                                                                                    

Install CTF library globally

sudo make install

Python install

Create a python3 virtual environment

sudo apt install python3-dev
sudo apt install virtualenv

Setup a python virtualenv in home directory

mkdir ~/envs
virtualenv -p python3 ~/envs/py3env

Setup shortcut for env and activate (I add to ~/.bashrc alias py3env='source ~/envs/py3env/bin/activate' and run bash then py3env in terminals as needed). In environment, install requirements.

pip install numpy
pip install cython

If built C++ CTF with --no-dynamic already as above, can make another CTF build by invoking configure from desired build directory.

Configure Cyclops,

./configure 

Can also build only dynamic and python libs with ./configure --no-static

Build CTF shared C++ library, C++ interface to Python, execute Cython, and assemble Python CTF library locally

make python

Test local python library

make python_test

Install python library to pip (requires that C++ library has already been installled globally with sudo make install)

make python_install
Clone this wiki locally