INSTALL: ttrr - TrussTopologyRobustRedundant

info

ttrr is a software package to do topology optimization of a truss with respect to robustness and redundancy.

before you install

Before you install, make sure to have:

To get graphical output (picture, movie, animation) you need some of the following programs:

At least for pictures you need gnuplot and/or POV-Ray. The frames for all movie and animation output are rendered with POV-Ray.

There is also a small extra command to check for availability of necessary python modules:

python setup.py check_modules

If you want to use this complete software you should have no modules which are not available.

Python3

If you use Python3, you must convert to Python3 via 2to3:

tar xzf ttrr-*.tar.*
cd ttrr-*/
2to3 -w .

install

global-install

To install this software global to / the following steps are to perform:

tar xzf ttrr-*.tar.*
cd ttrr-*/
python setup.py build_c_scripts
python setup.py install

Please recognize the extra step python setup.py build_c_scripts here.

home-install

To install this software to your $HOME the following steps are to perform:

tar xzf ttrr-*.tar.*
cd ttrr-*/
python setup.py build_c_scripts
python setup.py install --home=~

Please recognize the extra step python setup.py build_c_scripts here.

hints

  • GLPK 4.38 and 4.40 do not work.

    GLPK 4.43 and 4.44 and 4.45 and 4.47 work.

    GLPK 4.52.1 gives other binary results compared to “results.tar.bz2”. But these are only numerical rounding errors.

  • Keep in mind to have the right pathes.

    For the above installation to $HOME the software installs in:

    ~/bin
    ~/lib/python

    Please make sure to have these pathes in $PATH and $PYTHONPATH, respectively. For example:

    export PATH=$PATH:~/bin
    export PYTHONPATH=~/lib/python
  • You can use your own compiler-flags. For example:

    CFLAGS="-march=amdfam10 -O3 -msse4a -mfpmath=sse -pipe -fomit-frame-pointer" python setup.py build_c_scripts
  • If you have libraries in a not default path, please let it know.

    For example (e. g. OpenBSD or FreeBSD):

    export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
    export CPATH=$CPATH:/usr/local/include
  • Because we are doing scientific computing (repeatable: conform to IEEE-754 standard; with the same result each time the computing is done — independent of the load of the machine) the default floating point arithmetic unit is set to sse by the use flag “-mfpmath=sse” in “setup.py”.

    If you really wish to use 387 read the gcc man page to understand what you do. In principle if you calculate with 387 the results may be different every time! Caused by the simplex algorithm mostly used in ttrr through GLPK the basis of the result will mostly be the same. The final calculation of the objective function value is not very time consuming. Therefore the results could be the same.

  • SciPy has missing dependencies in Gentoo Linux amd64 at the moment (2012-02-26) (see https://bugs.gentoo.org/show_bug.cgi?id=380597 ). You need sci-libs/clapack and sci-libs/lapack-atlas, too. For example:

    emerge sci-libs/clapack sci-libs/lapack-atlas
    eselect blas set atlas
    eselect cblas set atlas
    eselect lapack set atlas
    emerge sci-libs/scipy
  • Fedora needs not only glpk but glpk-devel and gcc, too. gcc should come as a dependency of SciPy, but it does not.

  • Fedora lacks multimedia software. The repository http://rpmfusion.org/ provides MJPEG, ffmpeg2theora and FFmpeg (and more), but not povray. It is possible to install it manually (see other hint).

  • Since in debian the module argparse is not included in python, one needs the package python-argparse in addition.

  • However, in debian png2yuv from MJPEG http://mjpeg.sourceforge.net/ is not in the package management system. But it can be installed as mjpegtools from: http://deb-multimedia.org

  • If povray is not in the package management system (ubuntu 12.04, Fedora 16, Fedora 17, LMDE 201204, debian 6.0.5), it can be installed from http://www.povray.org/ http://www.povray.org/redirect/www.povray.org/ftp/pub/povray/Official/Linux/povlinux-3.6.tgz

    Unfortunately the install script does not work with a simple shell. Replacing sh with bash in the first line of the install script gives a working script in many distributions. (Sometimes /bin/sh is a link to /bin/bash and then it is working out of the box.)

  • openSUSE 12.1 x86_64 behave in a different way from typical linux.

    The software SciPy and GLPK are not in the package management system; but are available from the repository http://download.opensuse.org/repositories/science/ (see http://www.scipy.org/Installing_SciPy/Linux#head-3dbbf9abe395e974d3ec911ae56863f4af70df9b ).

    Not only glpk but also glpk-devel is needed.

    To install ttrr software to your $HOME in openSUSE the following steps are to perform:

    tar xzf ttrr-*.tar.*
    cd ttrr-*/
    python setup.py build_c_scripts
    python setup.py install --prefix=~

    Please make sure to have these pathes in $PATH and $PYTHONPATH, respectively. For openSUSE you need:

    export PATH=$PATH:~/bin
    export PYTHONPATH=~/lib/python2.7/site.packages

    The software ffmpeg2theora and FFmpeg are in the repository: http://packman.links2linux.org/

tested and developed

Tested and developed with Gentoo Linux http://www.gentoo.org/ and the gentoo-packages

  • dev-lang/python
  • dev-python/numpy
  • sci-libs/scipy
  • sci-mathematics/glpk
  • sci-visualization/gnuplot
  • media-gfx/povray
  • media-video/mjpegtools
  • media-video/ffmpeg2theora
  • media-video/ffmpeg
  • media-libs/libtheora
  • media-gfx/apngasm
  • media-gfx/imagemagick

in the following versions/USE-flags:

  • sci-mathematics/glpk-4.45 USE=”doc examples gmp -mysql -odbc -static-libs”
  • dev-lang/python-2.7.2-r3 USE=”doc examples gdbm ipv6 ncurses readline sqlite ssl threads tk (wide-unicode) xml -berkdb -build -wininst”
  • sci-visualization/gnuplot-4.4.4-r1 USE=”X cairo doc emacs examples gd ggi latex lua plotutils readline thin-splines wxwidgets xemacs (-svga)”
  • media-gfx/povray-3.7.0_rc3 USE=”X openexr tiff -debug”
  • media-video/mjpegtools-2.0.0-r1 USE=”gtk mmx png -dga -dv -quicktime -sdl -sdlgfx -static-libs -v4l”
  • media-video/ffmpeg2theora-0.28 USE=”-debug -kate”
  • dev-python/numpy-1.6.0 USE=”doc lapack -test”
  • sci-libs/scipy-0.9.0-r1 USE=”doc -umfpack”
  • media-libs/libtheora-1.1.1 USE=”doc encode examples -static-libs”
  • media-gfx/apngasm-2.5
  • media-video/ffmpeg-0.7.8 USE=”3dnow 3dnowext X aac alsa bzip2 doc encode hardcoded-tables jpeg2k mmx mmxext mp3 oss qt-faststart speex ssse3 theora threads truetype vorbis zlib (-altivec) -amr -avx -bindist (-celt) -cpudetection -custom-cflags -debug -dirac -faac -frei0r -gsm -ieee1394 -jack -network -pic -rtmp -schroedinger -sdl -static-libs -test -v4l -vaapi -vdpau -vpx -x264 -xvid” VIDEO_CARDS=”-nvidia”
  • media-gfx/imagemagick-6.7.5.3 USE=”X bzip2 cxx djvu fontconfig graphviz gs jpeg jpeg2k lzma openexr openmp pango perl png raw svg tiff truetype wmf xml zlib -autotrace -corefonts -fftw -fpx -hdri -jbig -lcms -lqr -opencl -q32 (-q64) -q8 -static-libs -test -webp”

tested with

ttrr was successfully tested with:

after install

You can check your installation with the examples in the examples directory:

./test

The results are compared with the reference results in “results.tar.bz2”. You should view the images and pictures with your preferred software, too.

Under GLPK 4.52.1 you get different binary results compared to “results.tar.bz2”. But these are only numerical rounding errors.

The most time (about 98 % cpu time) is spent on rendering by povray.

If the bash script “test” is not working for you, you can try single examples, e. g.:

python batch_2_load_cases_3_dim.py
python compareresults.py --compare_results -f *.bz2
ttrr_tools.py --png_gnuplot --png_pov --ogv --apng --mng --gif -f 2_load_cases_3_dim.tar.bz2 -xm 100 -ym 100 -frames 50 -framerate 5 -x 400 -y 400

On a laptop (lenovo T410s, 4 intel-cores with 2.53 GHz, 4 GB RAM) it takes about 4 seconds for test_short and about 178 minutes (real time, 478 minutes user time) for test_long with povray V3.6.

On a desktop computer (8 amd-cores with 3.60 GHz, 16 GB RAM) it takes about 12 seconds for test_short and about 70 minutes (real time, 365 minutes user time) for test_long with povray V3.7.