Building on Ubuntu 18

From GridPACK
Revision as of 16:08, 3 April 2019 by Bjpalmer (talk | contribs) (Created page with "<span style="color:red">'''This page is under construction'''</span>. Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The mai...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is under construction.

Building GridPACK on Ubuntu 18.04 is slightly more complicated than building it on Ubuntu 16.04. The main differences are that 1) the PPN build does not work for this version of Ubuntu and 2) the Global Arrays library must be built by hand. MPI, Boost and PETSc can all be installed using the package manager. 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. 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

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

sudo mk-build-deps -i

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

Build and Install Global Arrays

Get the Global Arrays source from the release page. Unpack in a convenient location. In the unpacked directory, configure, build, and install using

   ./configure --with-mpi-ts --disable-f77 --without-blas \
       --enable-cxx --enable-i4 --prefix="$PREFIX"
   make
   make install 

Build and Test GridPACK

Obtain the GridPACK release or development code and put it in a convenient directory.

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

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

Or, modify this configuration recipe to fit your needs:

CC=gcc
CXX=g++
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_CXX_COMPILER:STRING="mpicxx" \
    -D MPI_C_COMPILER:STRING="mpicc" \
    -D MPIEXEC:STRING="mpiexec" \
    -D MPIEXEC_MAX_NUMPROCS:STRING="2" \
    -D GRIDPACK_TEST_TIMEOUT:STRING=60 \
    -D USE_GLPK:BOOL=ON \
    -D GLPK_ROOT_DIR:PATH="/usr" \
    -D BUILD_SHARED_LIBS:BOOL=OFF \
    -D CMAKE_INSTALL_PREFIX:PATH="$HOME/gridpack" \
    -D CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE \
    ..
make

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