Cubica: a toolkit for subspace deformations

Linux Installation Instructions

All of the following instructions correspond to Red Hat Fedora 15 (Lovelock). For other Linux flavors, the procedure may vary.

Intel MKL

You should install the Intel MKL libraries first. If you install PETSc first, you will get a conflict because the LAPACK functions will be twice-declared. While an open-source version of MKL is not available, a non-commercial version can be downloaded for free.


You should build both PETSc, and SLEPc from source. If you build them via a package manager such as yum, it may not see MKL, and you will get a LAPACK linking error. When running the configure script for PETSc, you should point it to MKL, e.g.:

./config/ --with-blas-lapack-dir=/opt/intel/composerxe-2011.4.191/mkl/lib/ia32/

The most recent successful build of Cubica on Linux used PETSc 3.1-p8 and SLEPc 3.1-p6.


The remaining libraries can be installed in any order. GLVU is used to handle OpenGL navigation, and enables trackball interfaces, screenshots, etc. All calls to GLVU are restricted to main.cpp files and do not appear in the actual classes, so if you absolutely cannot tolerate GLVU, you can strip the calls from those files and replace them with whatever you prefer. The posted version of GLVU on the UNC site successfully built for me without any modification.


You need to build ARPACK from source, and I had to make some minor modifications to get the source to build. The compiler had to be switched to gfortran, and some unsupported compiler flags had to be removed. As ARPACK is written in FORTRAN, you also need to install ARPACK++ in order to use it within the C++ of Cubica.


ARPACK needs a fast, sparse direct solver in order to work properly, and Cubica uses UMFPACK for this purpose. I specifically used version 5.4.0, and recall that it required no modification to build on Linux. Note that you will need to install the UFconfig (3.4.0) and AMD (2.2.0) packages as well, but these also built successfully with no modification.

Environment Variables

Once everything is installed, make sure that all of the environment variables that Cubica needs have been declared. Cubica's Makefile will look for all of these, so if any are missing, the build will fail. The variables, along with the values I used for them, appear in my ~/.bashrc file as follows:

  • export PETSC_ARCH=linux-gnu-c-debug
  • export PETSC_DIR=~/petsc-3.1-p8
  • export SLEPC_DIR=~/slepc-3.1-p6
  • export GLVU_INCLUDE=~/glvu/Build/include
  • export GLVU_LIB=~/glvu/Build/lib/Linux-gnu-opt
  • export MKLLIB=/opt/intel/mkl/lib/ia32
  • export MKLINC=/opt/intel/mkl/include
  • export ICCLIB=/opt/intel/composerxe-2011.4.191/compiler/lib/ia32
  • export UMFPACK_INCLUDE=~/SCA11/UMFPACK/Include
  • export AMD_INCLUDE=~/SCA11/AMD/Include
  • export UFCONFIG_INCLUDE=~/SCA11/UFconfig
  • export UMFPACK_LIB=~/SCA11/UMFPACK/Lib
  • export ARPACKPP_INCLUDE=~/SCA11/arpack++-2.3.1/include
  • export ARPACKPP_LIBRARY=~/SCA11/arpack++-2.3.1/lib
  • export AMD_LIB=~/SCA11/AMD/Lib
The exact directories you installed into may vary. For example, you may not have installed everything into a SCA11 directory.


Once all the necessary packages and environment variables are set, call make linux from the cubica-1.0 directory. It will recurse down into the projects directories and build all the necessary binaries. The binaries will be deposited in the bin directory.

To build individual binaries, go to the project directory, e.g. cubica-1.0/projects/IsoStuffer, and type make -f Makefile.osx. It will create a binary cubica-1.0/bin/IsoStuffer.

Once all the binaries have been built successfully, see the usage instructions.

Cubica was written by Theodore Kim, with contributions from Doug James, Steven An, Jeff Chadwick, and Alan Bandurka.

This work was supported in part by the National Science Foundation (CAREER-0430528, EMTCompBio-0621999), the National Institutes of Health (NIBIB/NIH R01EB006615), NSERC (Many-core Physically Based Simulations), the Alfred P. Sloan Foundation, and donations from Intel, Pixar, and Autodesk.