Skip to content

Instantly share code, notes, and snippets.

@hadim
Created October 8, 2019 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hadim/b8cd7f6040a2f9a00cdba4eac2dc2c21 to your computer and use it in GitHub Desktop.
Save hadim/b8cd7f6040a2f9a00cdba4eac2dc2c21 to your computer and use it in GitHub Desktop.

Compile ctffind4 on CentOS 8

Instructions to compile ctffind4 on CentOS 8.

Install dependencies

# Enable PowerTools
sudo dnf config-manager --set-enabled PowerTools

# Instal EPEL repo
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# Upgrade the system
sudo dnf upgrade --refresh
# Install useful packages
sudo dnf install -y gcc gcc-c++ pkgconfig automake autoconf kernel-devel kernel-headers dkms make bzip2 cmake
# Install wxWidgets dependencies
sudo dnf install -y wxGTK3-devel

# Check installation is ok
wx-config --version
# Install FFTW (alternatively you can install Intel MKL)
sudo dnf install -y fftw-devel
# Instal other dependencies
sudo dnf install -y turbojpeg-devel libjpeg-turbo-devel libtiff-devel

Compile ctffind4

# Download the source files
wget http://grigoriefflab.janelia.org/sites/default/files/ctffind-4.1.13.tar.gz
tar xvzf ctffind-4.1.13.tar.gz

cd ctffind-4.1.13/

./configure --disable-debugmode

There is a bug in the code that prevent the compilation. You need to manually edit the file src/core/core_headers.h. Find the lines:

#include "pdb.h"
#include "water.h"

and delete them.

Then launch the compilation:

make

You don't need to run make install. The binary is available in the parent directory of the ctffind folder. Check compilation worked by running ctffind:

./ctffind
@Guillawme
Copy link

Guillawme commented Jun 16, 2020

Hi,

Have you tested that ctffind completes successfully when you run it on an actual micrograph? I also tried to compile it on CentOS 8.1, but I tried with ctffind version 4.1.14 and I did not patch src/core/core_headers.h because in my case it compiled just fine.

When I did that, it seemed to work because I could run the program to get its version info and help message. When I try to run it on a micrograph, it enters interactive mode and lets me adjust parameters normally, but crashes with a segmentation fault when the actual calculations start. This email from 4 years ago suggests that compiling ctffind4 with GCC is not supported (not sure whether this has changed since) and that it should be compiled with ICC. Maybe this is the cause of this problem. I tried to get ICC, but getting a license involves too much bureaucracy and I don't exactly qualify for the free license exception (I do research at a public university, but I don't teach). I also tried the pre-compiled binaries, but they crash even before they can print their version info or help message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment