CERN Accelerating science

by CERN

Advanced graphical user interface for particle simulation programs

Download

Latest version 3.1-0

Warning: Based on python V3
Uploaded: Tue 30-Jun-2020

RPM based systems

For linux RPM based systems (Fedora, CentOS, SLC, Suse,...)
flair-3.1-0.noarch.rpm
flair-geoviewer-3.1-0.x86_64.rpm

Optionally you can download the source rpm packages and rebuild the rpm
flair-3.1-0.src.rpm
flair-geoviewer-3.1-0.src.rpm

UBUNTU systems

The preferred way of installing flair is through the flair repository

Only once instructions

  1. First install the public repository key
    $ sudo wget -q -O - https://cern.ch/flair/download/ubuntu/KEY.gpg | sudo apt-key add -
  2. Install the repository. Currently we have the latest 20.04LTS and the previous LTS version 18.04LTS
    $ sudo add-apt-repository 'deb [arch=all,amd64] https://cern.ch/flair/download/ubuntu/20.04 /'

    or

    $ sudo add-apt-repository 'deb [arch=all,amd64] https://cern.ch/flair/download/ubuntu/18.04 /'
  3. Type the command
    $ sudo apt install flair
    and flair together with all its dependencies will be installed (including flair-geoviewer, dicom etc...). The system updater on regular will notify you for new versions.

Update

To update the flair version either use the update-manager from ubuntu or from the command line

$ sudo apt update
$ sudo apt upgrade

DEB based systems

For linux DEBIAN based version (Ubuntu, Debian)
flair_3.1-0_ubuntu20.04_all.deb
flair-geoviewer_3.1-0_ubuntu20.04_amd64.deb
flair_3.1-0_ubuntu18.04_all.deb
flair-geoviewer_3.1-0_ubuntu18.04_amd64.deb

TAR source code

For MAC, linux and Windows

flair-3.1-0.tgz
flair-geoviewer-3.1-0.tgz

Auxiliary files

DICOM

Dicom Hounsfield to materials transformation examples

dicom.tgz
Extract in any folder preferably in the under the flair installation
$ tar xzvf dicom.tgz

Cluster Submission

Script as an example for cluster submission

qsubmit.sh

Beta Versions

Beta / Unstable releases for testing can be found here.


Installation Instructions

Requirements

Flair is dependent on the following programs:
  1. Python interpreter version V3.6 or greater. Python usually comes pre-installed in most linux distributions, otherwise it can be downloaded from http://www.python.org
  2. tkinter toolkit, this is the default graphical toolkit for python and usually it is shipped together with the interpreter. In Fedora distributions (Version>3) it has to be installed separately. In this case install it with the command (as superuser):

    $ dnf -y install tkinter
  3. Tcl/Tk version V8.5 or greater.

Optionally but strongly recommended

  1. flair-geoviewer a plugin to flair for interactive geometry editing, debugging and 3D visualization
  2. PIL (python imaging library) and the tk interface for image exporting from geoviewer. Typically on various distributions they appear with the name python-imaging and python-imaging-tk
  3. gnuplot version V4.0 or greater
  4. pydicom The python dicom library optionally if you want to convert DICOM files to FLUKA voxel
  5. numpy The python numeric library for dicom processing

Source code compile requirements

For compiling the source code you need the following development packages for your system
  1. C++ compiler preferably gnu g++ or clang++
  2. GNU make
  3. python3-devel
  4. tk-devel and all its dependencies

RPM installation

Execute the following command as superuser:

$ rpm -ivh flair-X-XX.noarch.rpm

On distributions like Suse, Ubuntu etc. the package tkinter is called python-tk. Please verify that you have installed the required packages and then issue the command as superuser:

$ rpm -ivh --nodeps flair-X-XX.noarch.rpm

Upgrade instructions

To upgrade to a new version when flair is already installed on your system:

$ rpm -Fvh flair-X.X-X.noarch.rpm

Or directly from the web site

$ rpm -Fvh http://www.fluka.org/flair/flair-X.X-X.noarch.rpm

Built from src.rpm

Issue the command

$ rpmbuild --rebuild flair-geoviewer-X.X-X.src.rpm

Install with window manager

To install open with the file browser the download directory and double click, first on the "flair" and second on the "flair-geoviewer".
WARNING: you need to have the "universe" software source enabled.
To enable the "universe":
  1. Open the "Ubuntu Software Center"
  2. Menu -> Edit -> Software Sources
  3. Check the "Community-maintained free and open-source software (universe)"
  4. Close the Software center program
  5. In a terminal (e.g. xterm) type
    $ sudo apt update
  6. Then go to the download directory and double-click to install the Flair .deb package
  7. After the installation of Flair, double-click the flair-geoviewer .deb package, in order to install the Flair-Geoviewer

DEBIAN Install from command line

Manual installation can be done with the command:

$ dpkg -i flair_X.XX-X_all.deb flair-geoviewer_X.XX-XX_[amd64].deb

TAR source code

Expand the archive to the appropriate directory use the following commands:

$ tar xzvf flair-X.XX.tgz

     or

$ gunzip -c flair-X.XX.tgz | tar xvf -

Compile

To compile flair-geoviewer do the following:

$ tar xzvf flair-geoviewer-X-XX.tgz
$ cd flair-geoviewer-X-XX
$ make -j 8
$ make install install-bin install-mime
$ make help will provide a help page with all available options
Compile in parallel: -j 8 replace with the number of cores you have available

Mac OsX

Packages for Mac OsX
* The instructions below are valid for Flair/Geoviewer version 3.0-11a or greater

Requirements

Flair is dependent on the following programs:
  1. MacPorts

  2. The X11 Window System
    Since the XQuartz project is obsolete, it is advised to install the latest X11 window system using MacPorts:
    $ sudo port -v install xorg-server xorg
    After then installation, please logout and login in order to use the MacPorts' X11 as the default server.
    * Please check the "Known warnings and errors" section below in case of a force stop of Flair while running Geoviewer.

  3. Xcode Command Line Tools
    Install them with the command: $ xcode-select --install

  4. GCC compiler version 7.3 or greater.
    ATTENTION: PLEASE DO NOT USE THE DEFAULT OSX GCC VERSION
    Instead of the default one, please install your own version using MacPorts:
    $ sudo port install gcc[version]
    and enable it with the command:
    $ sudo port select gcc mp-gcc[version]
    replacing [version] with the gcc version you want to install and use. For example gcc7, gcc8 or gcc9.
    For Catalina users, it is advised to use the gcc version 9.

  5. Python interpreter version V3.6 or greater.
    ATTENTION: PLEASE DO NOT USE THE DEFAULT OSX PYTHON VERSION
    Instead of the default one, please install your own version using MacPorts:
    $ sudo port install python3[version]
    and enable it with the command:
    $ sudo port select --set python3 python3[version]
    replacing [version] with the python3 version you want to install and use. For example python37, python38

  6. Tkinter toolkit, this is the default graphical toolkit for python and usually it is shipped together with the interpreter.
    For OsX operating systems it has to be installed separately. In this case install it with the command:
    sudo port install py3[version]-tkinter
    replacing [version] with the python3 version you installed above (i.e. py37, py38)

  7. pkg-config, a helper tool used when compiling applications and libraries
    sudo port install pkgconfig

Installation

For installing Flair, please expand from source and follow the instructions in the "Configuring the environment" section below for being able to run the program.
For installing Geoviewer, please expand and compile from source following the instructions in the "Compile from source" section below.

Configuring the environment

For configuring the environment and being able to run Flair through the command line, add the following line
in the ~/.profile (or ~/.bash_profile):
alias flair='PATH_FLAIR/flair'
and replace PATH_FLAIR with the directory path where Flair was expanded. Then, to run Flair, open a new terminal session and type:
$ flair

Since the commands for setting the environment differ for different shells, please adapt the above line for non-bash shells.

Optionally, but strongly recommended:

* In case of python3.8 installation, please replace py37 with py38 in the commands below

  1. flair-geoviewer a plugin to flair for interactive geometry editing, debugging and 3D visualization

  2. PIL (python imaging library) and the tk interface for image exporting from geoviewer.
    $ sudo port install py37-Pillow

  3. gnuplot version V4.0 or greater
    $ sudo port install gnuplot

  4. numpy The python numeric library for dicom processing
    $ sudo port install py37-numpy

  5. matplotlib A comprehensive library for creating static, animated, and interactive visualizations in Python.
    sudo port install py37-matplotlib +tkinter

  6. scipy A Python-based ecosystem of open-source software for mathematics, science, and engineering
    sudo port install py37-scipy

  7. pydicom The python dicom library optionally if you want to convert DICOM files to FLUKA voxel
    $ sudo port install py37-pydicom
    $ sudo port install py37-Pillow

    In case Flair still requests for the DICOM package, please do:
    $ sudo port install py37-pip
    $ sudo pip-3.7 install pillow

  8. Ghostscript an interpreter for the PostScript language and for PDF
    $ sudo port install ghostscript

  9. GDB the GNU Project debugger
    $ sudo port install gdb

  10. XTerm the standard terminal emulator for the X Window System
    $ sudo port install xterm

Known warnings and errors

  • For macOS Mojave users:
    If the build process of Geoviewer fails with an error indicating that C++ headers are still missing, the installed Xcode version is still lacking appropriate header files.
    For installing them, please run:
    $ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

  • If the build process of Geoviewer fails with an error:
    "fatal error: X11/Xlib.h: No such file or directory,
    please re-install the XQuartz package or, better, use the X11 window system provided by MacPorts as advised above.

  • If the "Dicom" tab is not working leading to an error:
    "Error: cannot import name '_tkagg' from 'matplotlib.backends'",
    please re-install matplotlib with the +tkinter variant, as described in the instructions above.

  • In case of a force stop leading to an error similar to:
    "Assertion failed: (pthreadret == 0), function _xcb_in_wake_up_next_reader, file xcb_in.c, line 926."
    or:
    "line 15: 1120 Segmentation fault: 11 CMD @" ,
    please downgrade the xorg-libxcb and xorg-xcb-proto from verion 1.14 to 1.13, following the instructions described here.
    Please note that this malfunction is due to the fact that two different versions of the libxcb library are loaded:
     - the first one is loaded from XQuartz that contains the version 1.12
     - the second one from the dependencies of py38-tkinter installed via MacPorts and that is the most recent version 1.14.
    Thus, it is advised the use of the X11 window system provided by MacPorts, as described above.

Compile

To compile flair-geoviewer do the following:

$ tar xzvf flair-geoviewer-X-XX.tgz
$ cd flair-geoviewer-X-XX
$ make -j 8
$ make install DESTDIR=PATH_FLAIR
and replace PATH_FLAIR with the directory path where Flair was expanded.

Compile in parallel: -j 8 replace with the number of cores you have available

Android Phones or Tables

Flair v3 can run as well on android phone from v7+ and/or tablets.

Requirements

Install the termux application on android. Termux is an android terminal emulator and a linux environment application

Once termux is installed launch the application and install in the terminal the following packages for flair

$ pkg install x11-repo
$ pkg install python python-tkinter gnuplot make clang xorgproto

and the for the x11 environment you can follow the guide Graphical Environment

flair

Download the source packages of flair and geoviewer as described in the section above, and compile the geoviewer

Running

To run flair on android you need

  • Start vncviewer
  • Start termux
  • In the terminal type $ DISPLAY=:1 python flair.py
  • Switch to the vncviewer and you should have flair running on your phone