Compile unblur on CentOS 7

Another one about EM software. Unblur is used to align the frames of movies recorded on an electron microscope to reduce image blurring due to beam-induced motion (quoted from The Grigorieff lab webpage). In principle, one can download the package and use it as is, since it comes with precompiled executables. But we don’t want that, we want to compile it and modify the code. Yes, we’re experimentalist, yuhu! So we get the tarball from the abovementioned web and try as suggested, knowing it will not work 😉

./configure FC=ifort F77=ifort –enable-optimizations –enable-openmp

It does not give us a makefile (that is the desired result) since we don’t have an intel compiler (ifort). The error reads:

configure: error: Fortran 77 compiler cannot create executables

What if we change the compiler? The corresponding command lines are

 ./configure FC=gcc F77=gcc –enable-optimizations –enable-openmp

gives us the same error, but declaring gfortran produces something new.

./configure FC=gfortran F77=gfortran –enable-optimizations 

The new error reads:

configure: error: Could not find your installation of 
the GSL CBLAS library

Now what. We need to be sure the GSL CBLAS library. We  do yum install gsl-devel, and after running the configure gfortran line, we get another error:

configure: error: Could not find your installation of 
the jbig library

The library is unknown to me, but after a good old search, I find a repository. Here I show it. I make and make test, ending up on:

git clone
The T.85 pbmtools have PASSED the functional tests. Good!
make[1]: Leaving directory `/usr/local/jbigkit/pbmtools'

It is time to try again the configure gfortran line. Note that we added the jbig libraries.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/jbigkit/libjbig/

Unfortunately, a new library is missing.

configure: error: Could not find your installation of 
the TIFF library

I know we have that library (ldconfig -p | grep tiff) but let’s say it’s not the good one. I will get it from somewhere else, and I will specifically tell the “configure gfortran” where it is. After some fiddling, I find one that works. This is now my configure gfortran line:

./configure FC=gfortran F77=gfortran 
enable-optimizations enable-openmpi

With the above one, we finally get a makefile. The problem is, it doesn’t make. I need to update the compilers to be able to cope with the code syntax.  I do that with the help of yum.

## > yum install centos-release-scl-rh
## > yum install devtoolset-3-gcc 
devtoolset-3-gcc-c++ devtoolset-3-gcc-gfortran
## > scl enable devtoolset-3 bash
## > gcc --version
gcc (GCC) 4.9.2 20150212 (Red Hat 4.9.2-6)

Be aware that without enabling the devtoolset, the gcc and gfortran are not the right ones. The next error is an easy one:

fatal error: tiffio.h: No such file or directory

Therefore I find the missing file and copy it to external_libs/libtiff/. I need unfortunately to do the same for the files tiff.h, tif_config.h, tiffconf.hAnd finally, I got it. A clean make! Pity that the new executable doesn’t seem to do what is supposed to do. But that’s life, my son. That’s life.


About bitsanddragons

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

Leave a Reply

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

You are commenting using your 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