OOF: Finite Element Analysis of Microstructures

Installing OOF3D Prerequisites

oof3d logo

The hardest part of installing OOF3D can be installing the third party libraries that it uses. This page lists the required libraries and contains explicit instructions for installing them on several different operating systems.

The easiest way to install the libraries that OOF3D requires is to use a package manager, which will automatically configure, build, and install the libraries and all of the additional software that the libraries require. The tricky bit can be knowing which packages to request. This file gives explicit instructions for using package managers on OS X and various flavors of Linux.

NOTE: These instructions assume that you are a non-admin user, but have sudo privileges. If you are doing this from an admin or root account you may be able to omit the sudo from many of the commands listed here.

If you encounter difficulties with these instructions, please let us know.

[General] [Linux] [Macintosh OS X] [Building VTK]


General

Before installing OOF3D, the following software packages must be installed on your system. Detailed instructions for installing these packages on some computers are listed below.

(The OOF3D prerequisites are basically the same as the OOF2 prerequisites, except that OOF3D requires VTK instead of ImageMagick and libgnomecanvas.)

If you are using the binary installer for macOS, you do not need to install any of these prerequisites.

  • A C++ compiler. This is standard on most Linux systems. On macOS, you need to install XCode.

  • The Python scripting language, version 2.7. OOF3D does not work with Python 3. It might work with Python 2.6, but it hasn't been tested recently.

  • The gtk+2 graphics toolkit. OOF3D requires version 2.6 or later, but not version 3.

  • The pygtk Python bindings for the gtk+ library. OOF3D requires version 2.6 or later, but not as late as version 3.

  • The BLAS basic linear algebra subroutines and the LAPACK linear algebra library. These are provided with many computer systems. Check to see if you have a native version before downloading and installing the generic code from netlib. On macOS, the BLAS and LAPACK routines are built in to the Accelerate framework and do not have to be installed separately.

  • On, Linux, you need an X11 server. This is standard on most Linux systems. On macOS, X11 is optional. See macOS, below.

  • The VTK Visualization Toolkit, version 8.1.1 or later. OOF3D does not work with VTK 5 or 6. It might work, but poorly, with vtk 7. Most package management systems don't provide a sufficiently recent version of VTK, so you may need to download and install it manually. There are (possibly) helpful notes later on this page.

  • Bison or yacc, for building oof's version of swig. These may already be installed on your system. Swig is included in the OOF3D distribution.


Linux

If your variety of Linux isn't listed and you successfully installed OOF3D on it, we would appreciate it if you'd tell us what you did, so that we can include your instructions here. Also, Linux distributions and packages sometimes change, so these instructions may be outdated. If they are, please let us know!

OpenSUSE

Run this command:

   sudo zypper install python-devel gtk2-devel python-gtk-devel liblapack3 lapack blas libblas3 vtk8 libbz2-devel libtool 

Ubuntu/Debian

Run this command:

   sudo apt install python-gtk2-dev liblapack-dev bison 

You will have to install VTK manually. See the instructions below.

RHEL and derivatives (CentOS/Scientific Linux/Oracle Linux)

Run this command:

   yum install gtk2-devel pygtk2-devel python-devel lapack-devel blas-devel bzip2-devel libtool gcc-c++ 
You may have to install VTK manually following the directions below.


Macintosh OSX

Some commonly used package managers on macOS are MacPorts, Homebrew, and fink. They all should work, but we have tested OOF3D only with MacPorts and have no experience with the others.

When the instructions below tell you to type a command, type it in a Terminal window. You can copy and paste the lines from this page.

OOF3D can be built to use either X11 graphics or native macOS graphics, referred to as "Cocoa" or "Quartz", depending on the context. NOTE: At the time of OOF3D 3.2.0's release, however, a bug makes it impossible to run OOF3D with X11 on macOS, so follow the instructions below for Quartz/Cocoa.

Apple no longer supplies X11 with the OS, but you can install it from MacPorts (the package name is xorg-server). It can also be downloaded from XQuartz.

Whichever package manager you use, you will have to install Apple's XCode tools, which are available through the App Store. MacPorts has a good discussion of the various ways of getting XCode on different versions of OS X. After installing XCode, install its command line tools and agree to its license by typing these commands:

sudo xcode-select --install
sudo xcodebuild -license 

macOS with MacPorts and X11

  1. Install MacPorts from http://www.macports.org/install.php, following their instructions. It's easiest to use the .pkg installer. If you get error messages when running "sudo port -v selfupdate", open a new Terminal window and try again.

  2. Type these commands:

          sudo port install pkgconfig
          sudo port install xorg-server
          sudo port install py27-pygtk
          sudo port select python python27 

macOS with MacPorts and Quartz/Cocoa

The tricky part of installing OOF3D with MacPorts without X11 is that all of the other packages that MacPorts has installed have to be installed without X11 too. If you already have other MacPorts packages installed, this is at best a pain and at worst impossible. Installation can take a long time, because using non-standard options means that MacPorts won't use any of its pre-compiled binaries. (We had a binary OOF3D installer which was intended to solve this problem, but it wasn't working so it's been removed.)

Here are the steps:

  1. Install MacPorts, as described above.

  2. Edit /opt/local/etc/macports/variants.conf and add the line

       -x11 +quartz 
    at the end.

  3. Run the following commands:

       sudo port install tiff
       sudo port install py27-pygtk 
    At the time of writing, there is a bug in the glib2 port that causes this process to fail. A solution is to build the X11 variant of glib2 instead, but without also installing the X11 variant of its dependencies. Let the installation of py27-pygtk fail, then run
       sudo port install glib2 +x11 -quartz 
    Then re-run
       sudo port install py27-pygtk 
    This time it should finish correctly. (An alternative is to hack the glib2 Portfile so that its quartz variant is the same as its x11 variant. That may be preferable but is more complicated and is still just a hack.) Finally, run
       sudo port select python python27

  4. Install VTK. See the instructions below.

Macintosh OS X with fink

We haven't used fink recently, so these instructions are almost certainly out of date, if not flat out wrong. If you can update these instructions, please let us know.

  1. Install X11 from XQuartz.
  2. Install fink, by going to http://www.finkproject.org/download and following the instructions there.

  3. Enable the "unstable" fink packages.

    (a) Run "sudo fink configure", and answer "y" when asked about the unstable tree.

    (b) Run these commands:

        sudo fink selfupdate
        sudo fink selfupdate-rsync
        sudo fink index -f
        sudo fink scanpackages 

  4. Type these commands:

        sudo fink install python 
        sudo fink install pygtk2-gtk-py27-dev 

  5. You will have to install VTK manually.



Building VTK

These are instructions for building the visualization toolkit, VTK. They should be sufficient for OOF3D's purposes. They may not be sufficient for all purposes.

OOF3D requires VTK version 8.1.1 or later. It might build with VTK 6 or 7, but it's not likely to work correctly. It won't build with VTK 5.

These instructions assume you're using vtk 8.1.1. Where they refer to "8.1.1", substitute the actual version number of the version that you downloaded.

  1. Download VTK 8.1.1 or later from the VTK download site. This will create a file called VTK-8.1.1.tar.gz in your download directory, which we'll assume is called ~/Downloads.

  2. Create a directory to work in, and cd to it:

       mkdir ~/VTK
       cd ~/VTK 

  3. Unpack the file:

       tar -xf ~/Downloads/vtk-8.1.1.tar.gz 
    which will create a directory called VTK-8.1.1. Read the README file within it.

  4. Install vtk prerequisites.

    • On Debian/Ubuntu:

         sudo apt install cmake-curses-gui libtiff-dev mesa-common-dev libgl1-mesa-dev libxt-dev 

    • On macOS, with X11:

         sudo port install libGLU

    • On macOS, with Quartz/Cocoa, if you've installed the other OOF3D prerequisites, there should be no additional requirements for VTK.

  5. There's a bug in vtk 8.1.1 that can be avoided by uncommenting two lines. Edit VTK-8.1.1/Rendering/OpenGL2/vtkSSAAPass.cxx and uncomment (remove the "//" from) lines 158 and 159. That is, change

       // this->FrameBufferObject->AddDepthAttachment(
       //   this->FrameBufferObject->GetBothMode()); 
    to
       this->FrameBufferObject->AddDepthAttachment(
       this->FrameBufferObject->GetBothMode()); 
    This is not necessary with VTK 8.2.0 or later.

  6. cd to the directory containing VTK-8.1.1:

       cd ~/VTK 

  7. Create a new directory called build-8.1.1, and cd to it.

       mkdir build-8.1.1
       cd build-8.1.1 

  8. Run

       ccmake ../VTK-8.1.1 
    Type "c" to configure and "t" to get into advanced mode. Now you can set VTK configuration values. Make sure that these variables have these values:
    • BUILD_SHARED_LIBS = ON.

    • VTK_USE_SYSTEM_TIFF = ON (Not necessary with VTK 8.2.0 or later.)

    • VTK_USE_X = ON and VTK_USE_COCOA = OFF if you're using Linux or X11 on macOS, or VTK_USE_X = OFF and VTK_USE_COCOA = ON if you aren't using X11.

      NOTE for Mac Users: We have been unable to get VTK to work properly with X11 on Mac using recent versions of VTK and macOS. If you can get it to work, please tell us how. Otherwise, we recommend you build VTK and OOF3D to use Cocoa.

    • On macOS, if you're using Quartz/Cocoa, the three variables OPENGL_INCLUDE_DIR, OPENGL_gl_LIBRARY, and OPENGL_glu_LIBRARY should all be set to /System/Library/Frameworks/OpenGL.framework.

      If you're using X11 and MacPorts:

         OPENGL_INCLUDE_DIR = /opt/local/include
         OPENGL_gl_LIBRARY = /opt/local/lib/libGL.dylib
         OPENGL_glu_LIBRARY = /opt/local/lib/libGLU.dylib

    Type "c" to configure again. It's sometimes necessary to do it a few times before cmake will let you generate its makefile by typing "g".

  9. Build vtk and install vtk:

       make
       sudo make install 
    This can take a while.