Skip to content

How to install and run MXCuBE with Qt4 graphics

Ivars Karpics edited this page Apr 8, 2016 · 2 revisions

How to install and run MXCuBE with Qt4

MXCuBE is organized as a subset of several git submodules. In this page a sequence how to get software code, install dependencies and execute software is described.

Tested with:

  • Linux: Ubuntu 10, 12, 14 (with gnome and kde) and Centos 7 (with gnome)
  • Macos.

1. Git repository

The MXCuBE is hosten in several git projects that all together can be found at https://github.com/mxcube/mxcube. The repository for Qt version is organized in three submodules:

To get MXCuBE code execute:

   git clone https://github.com/mxcube/mxcube.git mxcube-2
   cd mxcube-2
   git submodule init
   git submodule update

2. Python dependencies

Before installing dependencies it is recomended to run mxcube to see which dependencies are missing.

2.1. Debian/Ubuntu

   sudo apt-get install python-qt4 python-gevent python-louie python-jsonpickle python-numpy python-scipy python-matplotlib python-suds pymca 

2.2. Fedora/Centos

   sudo yum install qt qt-demos qt-designer qt4 qt4-designer PyQt4 PyQt4-webkit numpy scipy python-pip
   sudo pip install matplotlib PyDispatcher

Some hints if problems during sudo pip install matplotlib:

   # missing libpng
   sudo yum install libpng-devel
   # gcc error 
   sudo yum install gcc-c++

If pymca is not available via package management tool then:

   # download source from: http://pymca.sourceforge.net/download.html
   sudo python setup.py install

   # when Qwt not available
   # download source from http://sourceforge.net/projects/qwt/files/qwt/
   qt4-qmake qwt.pro
   sudo make install

More info:

##3. Running code

Use mxcube script file located in bin directory with command line arguments to launch MXCuBE.

   Last command line argument has to indicate qt version (**-qt3** or **-qt4**). 
   Usage: mxcube <GUI definition file> [options] [-qt3 or -qt4]

   Options:
	  -h, --help            show this help message and exit
	  --logFile=FILE        Log file
	  --logLevel=LOGLEVEL   Log level
	  --bricksDirs=dir1:dir2...dirN
	               Additional directories for bricks search path (you can
                       also use the CUSTOM_BRICKS_PATH environment variable)
	  --hardwareRepository=dir
                               Directory where configuration xml files are located 
	  --hardwareObjectsDirs=dir1:dir2...dirN
        	                Additional directories for Hardware Objects search
                	        path (you can also use the
                        	CUSTOM_HARDWARE_OBJECTS_PATH environment variable)
	  -d                    start GUI in Design mode
	  -m                    maximize main window
	  --no-border           does not show borders on main window

run_mxcube.csh* script file located in bin directory can be adjusted and used. For example to run MXCuBE with default parameters edit script:

   PATH_TO_MXCUBE/bin/mxcube --hardwareRepository=PATH_TO_MXCUBE/ExampleFiles/HardwareObjects.xml -qt4

In this case MXCuBE will start in Qt4 mode with GUI definition file Qt4_example_mxcube.gui. It is possible to adjust script by defining gui configuration file, additional directories for bricks and hardware objects. For example:

   PATH_TO_MXCUBE/bin/mxcube PATH_TO_GUI_FILE --hardwareRepository=PATH_TO_XML_FILES  --hardwareObjectsDirs=PATHs_TO_ADDITIONAL_HARDWARE_OBJECTS --bricksDirs=PATHS_TO_ADDITIONAL_BRICKS -qt4 

Example xml files

3.1. GUI builder

GUI builder is used to define GUI layout. It is possible to add, edit or remove bricks, change brick parameters, edit signals and slots between bricks. To launch gui builder add -d before -qt4 argument. For example:

   PATH_TO_MXCUBE/bin/mxcube --hardwareRepository=PATH_TO_MXCUBE/ExampleFiles/HardwareObjects.xml -d -qt4

Other information