2. Configuring and Building Packages

Compilation of SMR packages requires a number of system packages to be installed before launching the build process, see sections Build with cmake and Python3 and Build with autotools. SMR packages do not require to be built with admin privileges. However, system packages installation may require admin privileges

The following environment variables are referred to in this chapter and are also checked by the cmake scripts:

  • SMR_SRC: Path to the directory containing all packages checked out from the git repository. Required for package doc build. Example (bash shell):

    export SMR_SRC=$HOME/src/git
    
  • SMR_PREFIX: Path to the installation directory (“prefix” directory). In a virtual environment SMR_PREFIX is identical to VIRTUAL_ENV. $VIRTUAL_ENV is defined by the virtual environment activation script (see Python Virtual Environments).

  • SMR_CMAKEMODULES: Path to the CMakeModules directory as checked out from CmakeModules.git. Example (bash shell):

    export SMR_CMAKEMODULES=$SMR_SRC/CMakeModules
    

The cmake scripts will recognize SMR_PREFIX and SMR_CMAKEMODULES. Thus, to configure a package and compile and install it:

  1. Create a build directory and go to that build directory. Example: Compile MemCom (package memcom):

    mkdir -p $HOME/_build/memcom
    cd $HOME/build/memcom
    
  2. Configure and build with make:

    cmake $SMR_SRC/memcom
    make # or make -j <NTHREADS>
    make install
    

2.1. Build with cmake and Python3

All third party installation package instruction examples listed in this chapter pertain to the Ubuntu (Debian) distribution’s installation tools. Third party packages names listed herein are Ubuntu package names. The test environment is Ubuntu 20.04.

It is heavily recommended to build packages in a Python Virtual environment, see Python Virtual Environment for SMR Packages.

2.1.1. System packages

Please install all system packages as described in Ubuntu 20, 22, 24.

Install all required Python modules in your virtual environment (see Python Virtual Environments).

Install the following 3rd party packages system wide:

sudo apt-get install python3 python3-dev swig flex bison gfortran m4 \
autoconf automake autotools-dev libtool openssh-server libxpm-dev \
libnlopt-dev liblapack-dev libarpack2-dev libatlas-base-dev libtbb-dev \
libssl-dev libmpfr-dev libpangocairo-1.0-0 libgirepository1.0-dev

Install the MUMPS packages for Ubuntu20:

sudo apt-get install libmumps libmumps-dev libmumps-seq libmumps-seq-dev \
libscotch-dev libptscotch-dev libmumps-scotch-dev libmumps-ptscotch  libmumps-seq-dev \
libmumps-seq-5.2.1

Install the MUMPS packages for Ubuntu24:
sudo apt-get install libmumps-5.6t64 libmumps-dev libmumps-headers-dev \
libmumps-seq-5.6t64 libmumps-seq-dev

The MUMPS``packages should install ``openmpi. If not installed:

sudo apt-get install openmpi-bin openmpi-common openssh-client openssh-server \
libopenmpi-dev libscalapack-openmpi-dev

2.1.2. Build

All Python3 packages are built with cmake. Unless package-specific build options are required, The command is (in a virtual environment):

cmake -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV \
      -DCMAKE_MODULE_PATH=<src>/CMakeModules<src>/<package>

2.2. Build with autotools

Python2 is not supported anymore in more recent Linux releases (Ubuntu22+, CentOS9, …), i.e the information of this section pertains to older Linux releases (Ubuntu20, …). SMR does not support the autotools build of packages anymore.

Prior to any build process please make sure that all system packages are installed under your distribution. Refer to Chapter Distribution Specific Information.

All third party installation package instructions listed in this chapter pertain to Ubuntu 20.4 (Debian) installation tools. Third party packages names listed herein are Ubuntu package names.

It is heavily recommended to build packages in a python2 Virtual environment, see Install Python2 Virtual Environment.

2.2.1. System packages

Compilation and execution of the SMR python2 based packages requires a number of system packages to be installed. Install the following Debian packages for building B2000++:

sudo apt install python2 python2-dev python-numpy docbook \
docbook-xml

In addition to the above packages, install the following the Debian packages for building baspl++:

sudo apt install libgtk2.0-dev libglu1-mesa-dev freeglut3-dev \
mesa-common-dev libgl2ps-dev python-gtk2 python-gtk2-dev python-glade2 \
gtk2-engines-murrine gtk2-engines-pixbuf python-opengl

2.2.2. Build

Some python2 packages are built with cmake. Unless package-specific build options are required, The command is (in a virtual environment):

cmake -DCMAKE_INSTALL_PREFIX=$VIRTUAL_ENV \
      -DCMAKE_MODULE_PATH=<src>/CMakeModules<src>/<package>