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] [NetBSD]


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.)

  • An X11 server. This is standard on most Linux systems. On OS X, X11 is not distributed with the operating system but can be obtained from xquartz.macosforge.org or MacPorts.

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

  • The Python scripting language. OOF3D works with any Python version from 2.5 through 2.7. We recommend 2.7. OOF3D does not work with Python 3.

  • 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 Macintosh OS X, the BLAS and LAPACK routines are built in to the Accelerate framework and do not have to be installed separately.

  • The VTK Visualization Toolkit, version 5.10.x. OOF3D does not work with VTK 6. Not all Linux distributions provide a sufficiently recent version of VTK. In order to get VTK 5.10 on Linux you may need to download and install it manually, following the instructions on the VTK download site. After unpacking the distribution, Make sure to read its README.html file. The instructions below in the Ubuntu section may be useful.

    NOTE: VTK 5.10 is no longer available on www.vtk.org. You can instead download it here:

    If you are building VTK manually and your system already includes a different version of VTK, be sure to install the new one in a different location. For example, if /usr/lib/vtk-5.8 already exists, install vtk-5.10 in /usr/local (or even your home directory).

  • 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 these commands:

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

Ubuntu

Run these commands:

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

You will have to install VTK 5.10 manually.

  • First, run these commands to install vtk's prerequisites:
       sudo apt-get install cmake-curses-gui
       sudo apt-get install mesa-common-dev
       sudo apt-get install libgl1-mesa-dev
       sudo apt-get install libxt-dev 
  • Download the vtk 5.10.1 source code:

    This will create a file called vtk-5.10.1.tar.gz.

  • Unpack the file

       tar -xzf vtk-5.10.1.tar.gz 
    which will create a directory named VTK5.10.1.

  • On Ubuntu 14.10 or later (but not 14.04 or earlier) it seems to be necessary to edit the file VTK5.10.1/Rendering/vtkXOpenGLRenderWindow.cxx to uncomment the line

       //#define GLX_GLXEXT_LEGACY 
    That is, remove the two slashes from the front of the line. Save the file.

  • Build and install vtk, following the instructions in VTK5.10.1/README.html. When you run ccmake, be sure to set BUILD_SHARED_LIBS to ON. It is sometimes necessary to run the configure command (by typing 'c') in ccmake a bunch of times before it lets you generate the makefile (by typing 'g'). ccmake produces a lot of warning messages which you can ignore.

Debian

See Ubuntu. The same packages should work.

CentOS

Run these commands:

   yum install gtk2-devel pygtk2-devel python-devel
   yum install lapack-devel blas-devel libbz2-devel
   yum install libtool
   yum install gcc-c++
You may have to install VTK manually.


Macintosh OSX

Two commonly used package managers on OS X are MacPorts and fink. Both should work, but we haven't tested OOF3D with fink. If you have neither installed already, it may be easier to use MacPorts.

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.

To run OOF3D, you will need to install X11, which Apple no longer supplies directly, but which can be downloaded from Mac OS Forge. It's slightly easier to get X11 from MacPorts, if you're using MacPorts.

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

Macintosh OS X with MacPorts

  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
          sudo port install vtk5
    

    As of this writing (July 21, 2016) vtk5 fails to build on OS X 10.11 (El Capitan). Instructions for installing it manually may be found here.

Macintosh OS X with fink

We haven't used fink recently, so these instructions may be out of date. Please let us know if they are.

  1. Install X11 from Mac OS Forge.
  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
           sudo fink install vtk510-dev vtk510-shlibs
    


NetBSD

The hardest part of installing OOF3D on NetBSD is getting vtk 5.10 to build.

  1. Install everything you need, except for vtk:

    pkg_add python27
    pkg_add py27-gtk2
    pkg_add py-gobject-shared
    pkg_add pkg-config
    pkg_add libgnomecanvas
    pkg_add ImageMagick
    pkg_add lapack
    pkg_add cmake
    pkg_add tk
    

  2. Download and unpack VTK 5.10.1 and unpack it:

     tar -xzf vtk-5.10.1.tar.gz
    	    
    This will create a directory called VTK5.10.1.

  3. Edit the file LSDynaFamily.cxx in VTK5.10.1/Utilities/LSDyna, replacing line

      #define USE_STAT_64 VTK_SIZEOF_ID_TYPE==8 && !defined _DARWIN_FEATURE_64_BIT_INODE
    
    with
    #define USE_STAT_64 VTK_SIZEOF_ID_TYPE==8 && !defined _DARWIN_FEATURE_64_BIT_INODE && !defined _NETBSD_SOURCE 
    

  4. Run cmake as described in the vtk instructions.