Closed hongzhan2015 closed 6 years ago
Could you send me the whole command you use to compile it and also the whole output?
Yes. Here is the output:
hong@AhlquistLab:~/Downloads/NovaCTF$ ls
makefile makefile~ README.txt setup_examples src VeryBriefTutorial.pdf
hong@AhlquistLab:~/Downloads/NovaCTF$ sudo make includepath="~/usr/include" libpath="~/usr/lib/x86_64-linux-gnu"
[sudo] password for hong:
g++ -O3 -s -DNDEBUG -lfftw3 -lfftw3f -L/usr/lib/ -L~/usr/lib/x86_64-linux-gnu -o novaCTF /home/hong/Downloads/NovaCTF/src/parameterSetup.o /home/hong/Downloads/NovaCTF/src/filterProjections.o /home/hong/Downloads/NovaCTF/src/fftRoutines.o /home/hong/Downloads/NovaCTF/src/ctf3d.o /home/hong/Downloads/NovaCTF/src/defocus.o /home/hong/Downloads/NovaCTF/src/projectionSet.o /home/hong/Downloads/NovaCTF/src/main.o /home/hong/Downloads/NovaCTF/src/ctfCorrection.o /home/hong/Downloads/NovaCTF/src/common.o /home/hong/Downloads/NovaCTF/src/mrcStack.o /home/hong/Downloads/NovaCTF/src/defocusFileFormats.o /home/hong/Downloads/NovaCTF/src/microscopeGeometry.o /home/hong/Downloads/NovaCTF/src/volumeIO.o
/home/hong/Downloads/NovaCTF/src/fftRoutines.o: In function FFTRoutines::complex2DTransform(unsigned long, unsigned long, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&)': fftRoutines.cpp:(.text+0x136e): undefined reference to
fftw_malloc'
fftRoutines.cpp:(.text+0x1379): undefined reference to fftw_malloc' fftRoutines.cpp:(.text+0x13da): undefined reference to
fftw_plan_dft_2d'
fftRoutines.cpp:(.text+0x13e7): undefined reference to fftw_execute' fftRoutines.cpp:(.text+0x14b8): undefined reference to
fftw_plan_dft_2d'
fftRoutines.cpp:(.text+0x14c3): undefined reference to fftw_execute' fftRoutines.cpp:(.text+0x14cb): undefined reference to
fftw_destroy_plan'
fftRoutines.cpp:(.text+0x14d5): undefined reference to fftw_destroy_plan' fftRoutines.cpp:(.text+0x14dd): undefined reference to
fftw_free'
fftRoutines.cpp:(.text+0x16a5): undefined reference to fftw_free' /home/hong/Downloads/NovaCTF/src/fftRoutines.o: In function
FFTRoutines::real2DTransform(unsigned long, unsigned long, std::vector<float, std::allocatorfftw_malloc' fftRoutines.cpp:(.text+0x17c6): undefined reference to
fftw_plan_dft_r2c_2d'
fftRoutines.cpp:(.text+0x17d2): undefined reference to fftw_execute' fftRoutines.cpp:(.text+0x18a3): undefined reference to
fftw_plan_dft_c2r_2d'
fftRoutines.cpp:(.text+0x18ae): undefined reference to fftw_execute' fftRoutines.cpp:(.text+0x18b6): undefined reference to
fftw_destroy_plan'
fftRoutines.cpp:(.text+0x18bf): undefined reference to fftw_destroy_plan' fftRoutines.cpp:(.text+0x18c7): undefined reference to
fftw_free'
/home/hong/Downloads/NovaCTF/src/fftRoutines.o: In function FFTRoutines::real2DTransform(unsigned long, unsigned long, std::vector<float, std::allocator<float> >&, std::vector<double, std::allocator<double> >&, novaCTF::DataStats&)': fftRoutines.cpp:(.text+0x1d64): undefined reference to
fftw_malloc'
fftRoutines.cpp:(.text+0x1d80): undefined reference to fftw_plan_dft_r2c_2d' fftRoutines.cpp:(.text+0x1d8c): undefined reference to
fftw_execute'
fftRoutines.cpp:(.text+0x1e20): undefined reference to fftw_plan_dft_c2r_2d' fftRoutines.cpp:(.text+0x1e2b): undefined reference to
fftw_execute'
fftRoutines.cpp:(.text+0x1e9d): undefined reference to fftw_destroy_plan' fftRoutines.cpp:(.text+0x1ea6): undefined reference to
fftw_destroy_plan'
fftRoutines.cpp:(.text+0x1eae): undefined reference to fftw_free' /home/hong/Downloads/NovaCTF/src/fftRoutines.o: In function
FFTRoutines::many1DTransform(float*, int, int, int)':
fftRoutines.cpp:(.text+0x214d): undefined reference to fftwf_execute' fftRoutines.cpp:(.text+0x2287): undefined reference to
fftwf_destroy_plan'
fftRoutines.cpp:(.text+0x22dc): undefined reference to fftwf_plan_many_dft_r2c' fftRoutines.cpp:(.text+0x2344): undefined reference to
fftwf_plan_many_dft_c2r'
/home/hong/Downloads/NovaCTF/src/fftRoutines.o: In function FFTRoutines::real1DTransform(unsigned long, std::vector<float, std::allocator<float> >&, std::vector<float, std::allocator<float> >&)': fftRoutines.cpp:(.text+0x2530): undefined reference to
fftw_malloc'
fftRoutines.cpp:(.text+0x2584): undefined reference to fftw_malloc' fftRoutines.cpp:(.text+0x2599): undefined reference to
fftw_plan_dft_r2c_1d'
fftRoutines.cpp:(.text+0x25a4): undefined reference to fftw_execute' fftRoutines.cpp:(.text+0x267f): undefined reference to
fftw_destroy_plan'
fftRoutines.cpp:(.text+0x2687): undefined reference to fftw_free' fftRoutines.cpp:(.text+0x268f): undefined reference to
fftw_free'
fftRoutines.cpp:(.text+0x2752): undefined reference to fftw_malloc' fftRoutines.cpp:(.text+0x2767): undefined reference to
fftw_plan_dft_r2c_1d'
fftRoutines.cpp:(.text+0x2772): undefined reference to `fftw_execute'
collect2: error: ld returned 1 exit status
makefile:26: recipe for target 'novaCTF' failed
make: *** [novaCTF] Error 1
Are you sure you that you have both libfftw3.so and libfftw3f.so in the folder you try to link in the makefile (/usr/lib/x86_64-linux-gnu)? You need to have both of the libraries in order to compile. Sometimes fftw3f is installed only as a static library: libfftw3f.a. If this is the case for you you have to change the makefile in the following way:
Under the line with OBJECTS = $(SOURCES:.cpp=.o) add following line OBJECTS += /path_to_your_libraries/libfftw3f.a
And try to compile it again (but first run "make clean" to be on the safe side).
Dear all,
Unfortunately I encountered the exact same issue as hongzhan2015.
After successfully installing fftw3 (default and float, resulting in the files libfftw3.so and libfftw3f.so in the lib directory of the installation folder) and executing the command:
make includepath="/local2/my_programs/fftw3_installation/include" libpath="/local2/my_programs/fftw3_installation/lib"
I get the same error messages as hongzhan2015 posted before. The gcc compiler is also up to date.
Did you maybe manage to solve the problem in the meantime or found any clues?
Thanks a lot for your help.
I encountered a similar situation and was able to overcome it by placing the linker-flags of fftw at the very end of the final linking command:
g++ -O3 -s -DNDEBUG -L/usr/lib64 -o novaCTF /home/bjornf/install/NovaCTF/novaCTF/src/projectionSet.o /home/bjornf/install/NovaCTF/novaCTF/src/common.o /home/bjornf/install/NovaCTF/novaCTF/src/main.o /home/bjornf/install/NovaCTF/novaCTF/src/ctf3d.o /home/bjornf/install/NovaCTF/novaCTF/src/mrcStack.o /home/bjornf/install/NovaCTF/novaCTF/src/parameterSetup.o /home/bjornf/install/NovaCTF/novaCTF/src/defocusFileFormats.o /home/bjornf/install/NovaCTF/novaCTF/src/fftRoutines.o /home/bjornf/install/NovaCTF/novaCTF/src/filterProjections.o /home/bjornf/install/NovaCTF/novaCTF/src/defocus.o /home/bjornf/install/NovaCTF/novaCTF/src/volumeIO.o /home/bjornf/install/NovaCTF/novaCTF/src/ctfCorrection.o /home/bjornf/install/NovaCTF/novaCTF/src/microscopeGeometry.o -lfftw3 -lfftw3f
I guess you can just execute this after it first halts, but amendments to the makefile might be better. I was not able to effect those changes by trying for a few minutes, but I'm sure it's possible
@bforsbe Thanks for the hint! It is hard to solve such things since I could not reproduce the error.
I updated the makefile - please download it from this website and run
make clean
make includepath="path_to_fftw_include_files" libpath="path_to_fftw_libraries"
Let me know, if it worked or not.
Yep, that did the trick. Typical of make/cmake to behave differently depending on use of explicit strings or variable use. Thanks!
Thank you very much for fixing it. Now it works.
hi hi,
i am trying to install novaCTF on our workstation that is linux system. I installed fftw3 and it works fine with ctffind. However, when I tried to install novaCTF, it show me this error:
makefile:26: recipe for target 'novaCTF' failed.
it is ubuntun 14.10.
Hong