Installing TMR¶
Prerequisites¶
TMR has several dependencies. The current version of TMR requires the following external libraries:
MPI 2.0 compatible compiler
BLAS/LAPACK
EGADS/egads4py (for geometry and topology information). egads4py is available here: https://github.com/gjkennedy/egads4py
TACS (for finite-element analysis). TACS is available here: https://github.com/gjkennedy/paropt
ParOpt (for topology optimization). ParOpt is available here: https://github.com/gjkennedy/tacs
Blossom V (for perfect matching in the Quad-Blossom algorithm): Blossom-V
METIS (for partitioning the coarse hexahedral/quadrilateral meshes): Metis
OpenCASCADE
In addition, the python interface for TMR requires the following:
numpy
mpi4py
Cython
Steps to compile¶
Clone the TMR git repository
Make sure your MPI complier works. It is best to use a package manager such as apt-get (linux) or brew (OS X).
Follow the instructions to install ParOpt and TACS
Install the externals METIS and Blossom V. Note that the Makefile for Blossom V in the extern package creates a library libblossom5.a.
Follow the instructions below to install OpenCASCADE
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
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.
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:
I untared/ziped with tar -xzf OCC680lin64.tgz in $HOME/packages/
I move OpenCASCADE-6.8.0 to OpenCASCADE
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
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.)
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):
Clone from git repository https://github.com/tpaviot/oce to $HOME/packages/
Create an empty directory $HOME/packages/OpenCASCADE
Get to $HOME/packages/oce
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
Once cmake is done, a Makefile should be created in $HOME/packages/oce Run the commands in $HOME/packages/oce: make, make install
Once completed, the build files should show up in $HOME/packages/OpenCASCADE
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
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