CERN Accelerating science

by CERN

Advanced graphical user interface for particle simulation programs

Download

Latest version 3.3-1

Warning: Based on Python V3
Uploaded: Tue 05-Mar-2024

Fedora systems

The preferred way of installing flair is through the flair repository

Only once instructions

  1. Download the flair.repo and place it in the /etc/yum.repos.d/ directory
    $ sudo wget https://cern.ch/flair/download/fedora/flair.repo -O /etc/yum.repos.d/flair.repo
  2. Update the database
    $ sudo dnf update
  3. Install flair
    $ sudo dnf install flair
    The system updater will notify you for new versions.

RPM based systems

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

Optionally you can download the source rpm packages and rebuild the rpm
flair-3.3-1.src.rpm
flair-geoviewer-3.3-1.src.rpm

UBUNTU systems

The preferred way of installing flair is through the flair repository

Only once instructions

  1. Install the public repository key
    $ wget -q -O - https://flair.web.cern.ch/flair/download/ubuntu/flair.gpg | sudo tee /etc/apt/trusted.gpg.d/flair.asc


    Note: If you are getting WARNING messages from the apt command such as
    W: ... Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
    You need to remove the previous flair key with the command:
    sudo apt-key del "ADEE 61A6 5BAC D490 AE5A 9268 586B 734C 48EF 36D5"
    and re-install it with the above wget command

  2. Install the repository. Currently it is provided for the latest
    • latest 23.10
      $ sudo add-apt-repository 'deb [arch=all,amd64] https://cern.ch/flair/download/ubuntu/23.10 /'
    • 22.04 LTS
      $ sudo add-apt-repository 'deb [arch=all,amd64] https://cern.ch/flair/download/ubuntu/22.04 /'
    • 20.04 LTS
      $ sudo add-apt-repository 'deb [arch=all,amd64] https://cern.ch/flair/download/ubuntu/20.04 /'
    • 18.04 LTS
      WARNING: 18.04 will be deprecated from next flair release
      $ 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 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)
Ubuntu 23.10
flair_3.3-1_ubuntu23.04_all.deb
flair-geoviewer_3.3-1_ubuntu23.04_amd64.deb

Ubuntu 22.04 LTS
flair_3.3-1_ubuntu22.04_all.deb
flair-geoviewer_3.3-1_ubuntu22.04_amd64.deb

Ubuntu 20.04 LTS
flair_3.3-1_ubuntu20.04_all.deb
flair-geoviewer_3.3-1_ubuntu20.04_amd64.deb

Ubuntu 18.04 LTS
flair_3.3-1_ubuntu18.04_all.deb
flair-geoviewer_3.3-1_ubuntu18.04_amd64.deb

TAR source code

For MAC, linux and Windows

flair-3.3-1.tgz
flair-geoviewer-3.3-1.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
  6. python3-gdcm for compressed DICOM images

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://flair.cern/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

Requirements

Flair is dependent on the following programs:
  1. Xcode Command Line Tools
    It is a prerequisite for the installation of MacPorts (see next point).
    Install them with the command:
    $ xcode-select --install

  2. MacPorts
    Refer to the instructions from the official MacPorts website.
    The default MacPorts installation directory is /usr/local/. Typically, MacPorts updates the shell configuration file to include the binary directories. In case of issue, be sure that PATH environment variable includes MacPorts binary directories. export PATH=/opt/local/bin:/opt/local/sbin:$PATH

  3. The X11 Window System
    RECOMMENDED: from XQuartz (version greater than 2.8.1)
    Alternatively, X11 can be installed via MacPorts:
    $ sudo port 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.

  4. GCC compiler
    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.
    Refer to FLUKA installation for the supported compiler versions.

  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 py3[version]-matplotlib +tkinter
    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 python312.

  6. This will install also the following packages:
    - Tkinter toolkit (the default graphical toolkit for Python)
    - matplotlib, a comprehensive library for creating static, animated, and interactive visualizations in Python.
    - pkg-config, a helper tool used when compiling applications and libraries
    - PIL (Python imaging library) and the tk interface for image exporting from geoviewer.
    - numpy The Python numeric library for dicom processing

In case DICOM is needed, the following libraries are also required:

  1. scipy A Python-based ecosystem of open-source software for mathematics, science, and engineering
    sudo port install py3[version]-scipy

  2. pydicom The Python dicom library optionally if you want to convert DICOM files to FLUKA voxel
    $ sudo port install py3[version]-pydicom

    If Flair still requests the DICOM package (e.g., if the corresponding pydicom port associated with the selected Python version does not exist), please do:
    $ sudo port install py3[version]-pip
    $ sudo pip3 install pydicom

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 the commands below replace [version] with the python3 version you installed above.

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

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

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

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

  5. 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, verify that the XQuartz version is 2.8.1 or 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

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 to

  • 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