Installing TMR

Prerequisites

TMR has several dependencies. The current version of TMR requires the following external libraries:

In addition, the python interface for TMR requires the following:

  • numpy

  • mpi4py

  • Cython

Steps to compile

  1. Clone the TMR git repository

  2. Make sure your MPI complier works. It is best to use a package manager such as apt-get (linux) or brew (OS X).

  3. Follow the instructions to install ParOpt and TACS

  4. Install the externals METIS and Blossom V. Note that the Makefile for Blossom V in the extern package creates a library libblossom5.a.

  5. Follow the instructions below to install OpenCASCADE

  6. In the base ‘tmr’ directory, copy the Makefile.in.info to Makefile.in. Edit the Makefile.in to match your compilers, metis and blossom V location, etc. If using OpenCASCADE, additional flags are required

  7. To compile, from the base directory, run make then make interface for the python interface

OpenCASCADE

There are different ways to install the OpenCASCADE libraries. The instructions below should work for linux and OS X.

  1. I downloaded the pre-compiled 64 bit version of OpenCASCADE for linux or OS X from Bob Haimes. For linux I got the following file: OCC680lin64.tgz, and for OS X I got the file: OCC680osx64.tgz. The website is here:

https://acdl.mit.edu/ESP/

  1. I untared/ziped with tar -xzf OCC680lin64.tgz in $HOME/packages/

  2. I move OpenCASCADE-6.8.0 to OpenCASCADE

  3. I added the following lines to my .bashrc file:

# Export the OpenCASCADE root directory
export CASROOT=$HOME/packages/OpenCASCADE
export PATH=$CASROOT/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CASROOT/lib

For OSX I added the following lines
export CASROOT=$HOME/packages/OpenCASCADE
export CASARCH=i686
DYLD_LIBRARY_PATH=${CASROOT}/${CASARCH}/lib
PATH=$CASROOT/bin:$PATH
  1. I tried to use the draw command by typing:

sh ./draw.sh

Once the command prompt appeared I typed:

Draw[3]> source samples/tcl/bottle.tcl

This showed an image of the bottle example from OpenCASCADE

(This step did not work under OSX, but the final step and compilation of the TMR library with OpenCASCADE enabled worked anyway.)

  1. I added the following lines to the Makefile.in code:

# Flags for debugging and regular compilation versions
TMR_DEBUG_FLAGS = [...] -DTMR_HAS_OPENCASCADE
TMR_FLAGS = [...] -DTMR_HAS_OPENCASCADE

OPENCASCADE_INCLUDE = -I${CASROOT}/${CASARCH}/inc
OPENCASCADE_LIB_PATH = -L${CASROOT}/${CASARCH}/lib -Wl,-rpath,${CASROOT}/${CASARCH}/lib
OPENCASCADE_LIBS = -lTKBool -lTKernel -lTKFeat -lTKBO -lTKGeomAlgo -lTKMath -lTKOffset -lTKPrim -lTKPShape -lTKTopAlgo -lTKBRep -lTKG2d -lTKG3d -lTKGeomBase -lTKShHealing -lTKSTEP -lTKSTEP209 -lTKSTEPBase -lTKSTEPAttr -lTKXSBase -lTKIGES -lTKFillet -lPTKernel -ldl

If using OpenCASCADE Community Edition (OCE) (not using compiled version):

  1. Clone from git repository https://github.com/tpaviot/oce to $HOME/packages/

  2. Create an empty directory $HOME/packages/OpenCASCADE

  3. Get to $HOME/packages/oce

  4. Use the following commands in the directory $HOME/packages/oce

cmake -DOCE_INSTALL_PREFIX:PATH=$HOME/packages/OpenCASCADE

This will build the libraries in $HOME/packages/OpenCASCADE

  1. Once cmake is done, a Makefile should be created in $HOME/packages/oce Run the commands in $HOME/packages/oce: make, make install

  2. Once completed, the build files should show up in $HOME/packages/OpenCASCADE

  3. Add the following lines to my .bashrc file:

# Export the OpenCASCADE root directory
export CASROOT=$HOME/packages/OpenCASCADE
export PATH=$CASROOT/bin:$PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CASROOT/lib
  1. Added the following lines to the tmr/Makefile.in code:

# Flags for debugging and regular compilation versions
TMR_DEBUG_FLAGS = [...] -DTMR_HAS_OPENCASCADE
TMR_FLAGS = [...] -DTMR_HAS_OPENCASCADE

OPENCASCADE_INCLUDE = -I${CASROOT}/${CASARCH}/include/oce
OPENCASCADE_LIB_PATH = -L${CASROOT}/${CASARCH}/lib -Wl,-rpath,${CASROOT}/${CASARCH}/lib
OPENCASCADE_LIBS = -lTKBool -lTKernel -lTKFeat -lTKBO -lTKGeomAlgo -lTKMath -lTKOffset -lTKPrim -lTKPShape -lTKTopAlgo -lTKBRep -lTKG2d -lTKG3d -lTKGeomBase -lTKShHealing -lTKSTEP -lTKSTEP209 -lTKSTEPBase -lTKSTEPAttr -lTKXSBase -lTKIGES -lTKFillet -lPTKernel -ldl