ctffind 4.1.5 compile on a mac

Hi guys,
Anyone managed to compile ctffind 4.1.5 on a mac? We have newest g++ compilers, wxwidgets and fftw3.3.5, it's still not working.
Previous versions compile just fine.
Thanks!

Hi Dominka,

What is the error you are getting? If it is about missing headers, please can you remove lines 59-62 from the src/core/core_headers.h.

these lines should read :-

#include "refinement_package.h"
#include "refinement.h"
#include "database.h"
#include "project.h"

Hopefully this will help.

Tim

In reply to by timgrant

Hi:

The headers look fine in the version 4.1.6 tar ball we got from Alexis and it compiles fine on my Mac but bugs out upon execution:

@!#> ./ctffind
./src/common/cmdline.cpp(254): assert "GetShortOptionName(shrt.begin(), shrt.end()).Len() == shrt.Len()" failed in wxCmdLineArgImpl(): Short option contains invalid characters

HTH

In reply to by hael

Took me a while, but I've now confirmed that the next version (4.1.7) compiles & runs correctly on Mac (we've tested on 3 different macs, with different OSes).

Please contact me directly to request the latest tar ball. Here are the basic steps:

1) Install Homebrew (https://brew.sh/)
2) brew install wxmac
3) brew install fftw
4) tar -xvf ctffind*.tar.gz
5) cd ctffind*
6) mkdir build
7) cd build
8) ../configure CXXFLAGS="-I/usr/local/include -L/usr/local/lib"
9) You must use the system gcc (/usr/bin/gcc)
If necessary, you may need to specify CC=/usr/bin/gcc

In reply to by Alexis

Hello, I've tried the above procedure to try installing 4.1.8 under Mac OS 10.12. However:

OSX> cd /usr/local/ctffind/ctffind-4.1.8/build
OSX> make clean
OSX> ../configure CC=/usr/bin/gcc CXXFLAGS="-I/usr/local/include -I/usr/local/include/wx-3.0 -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -L/usr/local/lib"
OSX> make
(...)
/bin/sh ./libtool --tag=CXX --mode=link g++ -I/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/lib/wx/include/osx_cocoa-unicode-3.0 -I/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -DwxUSE_GUI=0 -I/usr/local/include -I/usr/local/include/wx-3.0 -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -L/usr/local/lib -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -L/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau-3.0 -o ctffind src/programs/ctffind/ctffind-ctffind.o src/core/ctffind-functions.o src/core/ctffind-globals.o src/core/ctffind-randomnumbergenerator.o src/core/ctffind-userinput.o src/core/ctffind-curve.o ctffind-image_trim.o src/core/ctffind-matrix.o src/core/ctffind-symmetry_matrix.o src/core/ctffind-abstract_image_file.o src/core/ctffind-mrc_header.o src/core/ctffind-mrc_file.o src/core/ctffind-tiff_file.o src/core/ctffind-dm_file.o src/core/ctffind-image_file.o src/core/ctffind-job_packager.o src/core/ctffind-job_tracker.o src/core/ctffind-run_profiles.o src/core/ctffind-myapp.o src/core/ctffind-empirical_distribution.o src/core/ctffind-ctf.o src/core/ctffind-numeric_text_file.o src/core/ctffind-progressbar.o src/core/ctffind-downhill_simplex.o src/core/ctffind-brute_force_search.o src/core/ctffind-va04.o src/core/ctffind-conjugate_gradient.o -ltiff -ldl -lfftw3f
libtool: link: g++ -I/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/lib/wx/include/osx_cocoa-unicode-3.0 -I/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__ -DwxUSE_GUI=0 -I/usr/local/include -I/usr/local/include/wx-3.0 -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.0 -DNDEBUG -funroll-loops -O3 -Wall -pipe -fexpensive-optimizations -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o ctffind src/programs/ctffind/ctffind-ctffind.o src/core/ctffind-functions.o src/core/ctffind-globals.o src/core/ctffind-randomnumbergenerator.o src/core/ctffind-userinput.o src/core/ctffind-curve.o ctffind-image_trim.o src/core/ctffind-matrix.o src/core/ctffind-symmetry_matrix.o src/core/ctffind-abstract_image_file.o src/core/ctffind-mrc_header.o src/core/ctffind-mrc_file.o src/core/ctffind-tiff_file.o src/core/ctffind-dm_file.o src/core/ctffind-image_file.o src/core/ctffind-job_packager.o src/core/ctffind-job_tracker.o src/core/ctffind-run_profiles.o src/core/ctffind-myapp.o src/core/ctffind-empirical_distribution.o src/core/ctffind-ctf.o src/core/ctffind-numeric_text_file.o src/core/ctffind-progressbar.o src/core/ctffind-downhill_simplex.o src/core/ctffind-brute_force_search.o src/core/ctffind-va04.o src/core/ctffind-conjugate_gradient.o -Wl,-bind_at_load -L/usr/local/lib -L/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL -lwx_osx_cocoau-3.0 -ltiff -ldl -lfftw3f
ld: warning: directory not found for option '-L/Users/buildbot/Buildslaves/ccp4-slave/release-7_0-mac10_6/build/devtools/install/lib'
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: library not found for -lwx_osx_cocoau-3.0
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:629: ctffind] Error 1
OSX>

And indeed, the only instances of libwx_osx_cocoau-3.0*.dylib I can find on my system are have nothing to wit the brew installation of wxmac:

/usr/local/phenix/phenix-dev-2926/base/lib/libwx_osx_cocoau-3.0.0.2.0.dylib
/Applications/ccp4-7.0/lib/libwx_osx_cocoau-3.0.0.2.0.dylib
/usr/local/phenix/phenix-installer-1.12-2829-source/base/lib/libwx_osx_cocoau-3.0.0.2.0.dylib
/usr/local/phenix/phenix-1.12-2829/base/lib/libwx_osx_cocoau-3.0.0.2.0.dylib
/usr/local/phenix/phenix-installer-1.12-2829-source/base_tmp/wxPython-src-3.0.2.0/lib/libwx_osx_cocoau-3.0.0.2.0.dylib
/usr/local/dials/dials-v1-7-2/base/lib/libwx_osx_cocoau-3.0.0.2.0.dylib

Any help to fix this problem would be highly appreciated!

Thanks,

Luca

In reply to by lucajovine

I have ran into all the error messages mentioned above.
But decided to give it another try; looked into the README file before I started and found out that it is important to point out the path of the wx-config file.
It turns out that "brew install wxMac" put wx-config into /usr/local/Cellar/wxmac/3.0.3.1_1/bin. Which differs from the path "which wx-config" gave. Once I include the correct wx-path, the package was complied without error (there were a few warnings about optimization but I just ignore them).
I did find "ctffind" and "ctffind_plot_results.sh" in /usr/local/bin. Have not checked whether ctffind works correctly or not yet, keeping my fingers crossed:-)

The syntax for configure follows:
../configure CXXFLAGS="-I/usr/local/include -L/usr/local/lib" CC=/usr/bin/gcc --with-wx-config=/usr/local/Cellar/wxmac/3.0.3.1_1/bin/wx-config
make ##complex without error
sudo make install finished instantly.