Cubica: a toolkit for subspace deformations

Apple OSX Installation Instructions


You should install the packages PETSc, and SLEPc first. It is not recommended that you try to install these packages directly from the source. Instead, install them via MacPorts, e.g.:

  • sudo port install petsc
  • sudo port install slepc +arpack
As SLEPc builds on top of PETSc, you must install PETSc first. The exact versions used during development are petsc @3.0.0-p8_0 and slepc @3.0.0-p5_0+arpack.


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.

Some minor amount of hacking was necessary to get GLVU to build; there was some deprecated thread calls that had to be fixed if I recall correctly. While you are encouraged to download and build the code directly from the UNC site, the exact version of the code that I used is also available here.


Be sure to install ARPACK along with SLEPc, i.e. don't forget to send the +arpack flag to MacPorts. ARPACK is written in FORTRAN however, so you need to install ARPACK++ in order to use it with Cubica. Once again, you are encouraged to download and install ARPACK++ from the original source. However, I recall it also required some minor changes to compile on OSX, so I am also providing the exact version I used for development here.


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 OSX, so it is not necessary to provide a modified version here. 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 ~/.profile file as follows:

  • export PETSC_DIR=/opt/local/lib/petsc
  • export SLEPC_DIR=/opt/local/lib/petsc
  • export GLVU_LIB=~/glvu/Build/lib/opt/
  • export GLVU_INCLUDE=~/glvu/Build/include/
  • export AMD_INCLUDE=~/SCA11/AMD/Include
  • export UFCONFIG_INCLUDE=~/SCA11/UFconfig
  • export UMFPACK_INCLUDE=~/SCA11/UMFPACK/Include
  • export UMFPACK_LIB=~/SCA11/UMFPACK/lib
  • export AMD_LIB=~/SCA11/AMD/lib
  • export ARPACKPP_INCLUDE=~/SCA11/arpack++-2.3.1/include
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 osx 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.