Qt5 and FOCUS install on CentOS 7

FOCUS is the interface between data collection and data processing in cryo-EM. Or that is what they say. As you know if you arrived here, there are dozens of other tools to process cryo-EM data. But let’s go through my installation log. By clicking on download I’m offered the chance to get some Linux packages, since I run on Linux. I get the RPM and I place it on my test machine. Since it’s a RPM, I try with rpm. The output is below.

 rpm -Uhv focus-1.0.0-stable-Linux\(RPM\).rpm 
error: Failed dependencies:
 libQt5Concurrent.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5Core.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5Gui.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5Network.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5OpenGL.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5Script.so.5()(64bit) is needed by focus-1.0.0-1.x86_64
 libQt5Widgets.so.5()(64bit) is needed by focus-1.0.0-1.x86_64

Which is expected, if you read the documentation. We need Qt5 for the GUI. Knowing that yum can install also rpm, I try it. This is what you get:

yum install focus-1.0.0-stable-Linux\(RPM\).rpm 

 focus.x86_64 0:1.0.0-1

Dependency Installed:
 qt5-qtbase.x86_64 0:5.6.1-10.el7 
 qt5-qtbase-common.noarch 0:5.6.1-10.el7 
 qt5-qtbase-gui.x86_64 0:5.6.1-10.el7 
 qt5-qtscript.x86_64 0:5.6.1-10.el7 
 xcb-util-renderutil.x86_64 0:0.3.9-3.el7 
 xcb-util-wm.x86_64 0:0.4.1-5.el7


Unfortunately, I’m not able to get the executable to run. So I go the hard way, undoing the yum install and getting the source code. I’m going to follow what is available on the FOCUS wiki. With my lovely comments added, when needed.

yum install git
git clone https://github.com/C-CINA/focus.git
Cloning into 'focus'...

I move it to our /usr/local/ and try directly to build it:

/usr/local/focus ## > ./build_all
...bla bla bla...
No GPU-support
-- The variable FOCUS_ROOT_DIR is set to: 
-- The variable FOCUS_INCLUDE_DIR is set to: 
...bla bla bla...
CMake Error at cmake/FindQt5.cmake:75 (MESSAGE):
qmake installation NOT FOUND!

-- Configuring incomplete, errors occurred!
See also "/usr/local/focus/build/CMakeFiles/CMakeOutput.log".
Configure failed for Focus

I try to fix the problems, starting with the Qt5. I check which qt we have and I try to update it with yum. See it below:

## > yum install qt
 Package 1:qt-4.8.5-13.el7.x86_64 
already installed and latest version
 Nothing to do
 ## > yum update qt
 No packages marked for update

The installation of qt-creator (yum install qt-creator) also doesn’t result on a successful build. So I download Qt, and try to install it from scratch. The package I download is called qt-opensource-linux-x64-5.8.0.run. When you make it executable and run it, a nice GUI pops up to ask you  at the very beginning for a Qt account details. I skip that, and change the installation destination so it goes to  /opt/local/Qt5.8.0, but the rest I leave. An “ls” over my folder reveals indeed I have the desired “qmake” on /opt/local/Qt5.8.0/5.8/gcc_64/bin/. My qt5.sh file looks like:

## /etc/profile.d/qt5.sh
export PATH

I run it, as suggested.

## > which qmake

Now I come back to my installation, and run it again.  Unfortunately, the script fails at 90% with this error:

[ 90%] Building CXX object 
In file included from /usr/include/c++/4.8.2/type_traits:35:0,
 ...bla bla bla..
 from /usr/local/focus/apps/fLogBrowser/LBMainWindow.cpp:20:

error: #error This file requires compiler and library support 
for the ISO C++ 2011 standard. 
This support is currently experimental, 
and must be enabled with the -std=c++11 or 
-std=gnu++11 compiler options.

Therefore I need to go for an older qt5. I get it from here. Then I change the corresponding scripts, and launch the install again. Unfortunately it fails again, with a quite dark Qt compilation error that doesn’t seem to be easy to solve, unless I have full control of the code. The problem is, Qt5 seems to have been heavily modified from version to version in recent times, to be adapted to run on Android, and things like that.

I have no other option than to try again the RPM package, now with my local Qt5.0.2.

yum install focus-1.0.0-stable-Linux\(RPM\).rpm

After the “Complete” message, I look for a working executable, that I find on /opt/focus/bin/focus.  It seems to work now, time to test, although I’m afraid this is not the end of it. We’ll see what’s happening with the CUDA support, for example 😛

EDIT: I found out a very efficient way to install it, on the place I want.

yum install qt5-qtbase qt5-qtbase-common \
qt5-qtbase-gui qt5-qtscript xcb-util-renderutil xcb-util-wm

rpm -Uhv --prefix=/usr/local/focus/ 

So first you install qt5 via yum, then focus via rpm 🙂


About bitsanddragons

A traveller, an IT professional and a casual writer
This entry was posted in bits, centos, EM, linux, software. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s