Building on Ubuntu

From GridPACK
Jump to: navigation, search

GridPACK is relatively easy to build on Ubuntu Linux systems. This example was performed on a Virtual Box instance running a clean install of Ubuntu Linux 16.04 (LTS). Virtual Box is not required and this build should work on Linux systems using the Ubuntu operating system. If you have no need to modify the GridPACK library itself, consider installing the binary package. You will need super user or sudo privileges for this installation.

A few basic development packages will be necessary. Install them with

sudo apt-get install git build-essential devscripts equivs

Install Required Packages

Before installing the remaining packages, you must first download GridPACK onto your computer and put it in a convenient directory. Instructions for downloading GridPACK can be found here.

All the GridPACK prerequisites packages can be installed using the packaging information in the source. Run this command in the top directory of the GridPACK repository:

sudo mk-build-deps -i

This will make and install a virtual package called gridpack-build-deps with all the dependencies needed to build GridPACK.

Alternatively, all required packages will be installed by installing the GridPACK binary package.

Build and Test GridPACK

Configure and build GridPACK using the recipe for gridpackvm in From the top-most GridPACK source directory, do the following:

mkdir src/build
cd src/build
bash ../ gridpackvm
make test

Or, modify this configuration recipe to fit your needs:

export CC CXX

cmake \
    -D PETSC_DIR:STRING="/usr/lib/petscdir/3.6.2" \
    -D PETSC_ARCH:STRING="x86_64-linux-gnu-real" \
    -D PARMETIS_DIR:PATH="/usr" \
    -D GA_EXTRA_LIBS:STRING="-lscalapack-openmpi -lblacsCinit-openmpi -lblacs-openmpi -llapack -lblas -lgfortran" \
    -D MPI_C_COMPILER:STRING="mpicc" \
    -D MPIEXEC:STRING="mpiexec" \
    -D GLPK_ROOT_DIR:PATH="/usr" \

If compilation is successful, the unit tests and/or example applications can be run.

Removing Required Software

If no longer needed, the required packages can be removed using

sudo apt-get purge gridpack-build-deps
sudo apt autoremove