CTFTILT segmentation fault

Hi,

I get segmentation faults when running CTFTILT on tilted 2K and 1K CCD images. With a box size of 128 everything runs fine, but when I try box size 256 I get segmentation faults on most (but not all) of the images.

CTFTILT version is 1.5 from December 3 2010. I found a couple of threads regarding this error, but am not sure what to do, so before I start bugging our IT guy: Would a newer version make a difference or am I using weird parameters?

#!/bin/csh -x
ctftilt << eof
$1
$2
2.7,200,0.07,1,0.0003007,1
256,100.0,5.0,10000,50000,1000,$3,5
eof
#

Best,

Wim Hagen
EMBL Heidelberg

I would try running the latest version before doing anything else. It is easy enough to download and install.

Also, you parameters seem to be a bit unusual. You seem to have entered 0.0003007 for the magnification. For the high-resolution limit of the CTF fit, you have entered 5.0. At 5 Angstrom resolution I doubt that you have any useful signal for the CTF fit. I would limit it to 10 Angstroms or so. Please download the latest version of CTFTILT and carefully go through all the parameters in the example script.

In reply to by niko

I am trying to install latest version on my macbook running 10.7.5, gcc 4.6.2:

gfortran -O3 -s -fomit-frame-pointer -Wall -falign-functions=4 \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-w -c ctffind3.f
gfortran -O3 -s -fomit-frame-pointer -Wall -falign-functions=4 \
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-w -c iof.f
gcc -O3 -DPROTOTYPE -Dalliant -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -w -c ioc.c
gfortran -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
ctffind3.o iof.o ioc.o -o ctffind3.exe
Undefined symbols for architecture x86_64:
"_omp_get_num_procs_", referenced from:
_MAIN__ in ctffind3.o
"_omp_set_num_threads_", referenced from:
_MAIN__ in ctffind3.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [ctffind3.exe] Error 1

I read a number of threads on the forum but simply have no clue about all this, any advice or help is appreciated.

Best,
Wim

In reply to by wimhagen

It looks like the compiler cannot find the library for OpenMP parallelization. The code inside ctffind3 and ctftilt that uses OpenMP should only be used by the compiler if the option -fopenmp is specified. Please check that this option does not appear in the Makefile you are using. Alternatively, delete the following lines in CTFFIND3:

#ifdef _OPENMP
      CALL GETENV('OMP_NUM_THREADS',NCPUS)
      READ(NCPUS,*,ERR=111,END=111)IMP
111   CONTINUE
      IF (IMP.LE.0) THEN
        CALL GETENV('NCPUS',NCPUS)
        READ(NCPUS,*,ERR=112,END=112)IMP
112     CONTINUE
      ENDIF
      IF (IMP.LE.0) THEN
        IMP=OMP_GET_NUM_PROCS()
      ENDIF
      CALL OMP_SET_NUM_THREADS(IMP)
#endif

Also delete the following lines in CTFTILT:

#ifdef _OPENMP
      CALL GETENV('OMP_NUM_THREADS',NCPUS)
      READ(NCPUS,*,ERR=111,END=111)IMP
111   CONTINUE
      IF (IMP.LE.0) THEN
        CALL GETENV('NCPUS',NCPUS)
        READ(NCPUS,*,ERR=112,END=112)IMP
112     CONTINUE
      ENDIF
      IF (IMP.LE.0) THEN
        IMP=OMP_GET_NUM_PROCS()
      ENDIF
#endif

Then try to compile CTFFIND3 and CTFTILT again.