Undefined reference to `fftw_init_threads' while installing pHash library - c++

I am trying to install pHash library on ubuntu, i installed libfftw3 and all the required libraries. Everything is Ok when I run ./configure command, but when i try to run the 'make' command this error always appear : undefined reference to `fftw_init_threads'.
make command :
g551683#sst-p1310007fl:~/Documents/pHash-0.2.9.6$ make
make all-recursive
make[1]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6'
Making all in src
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/src'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/src'
Making all in bindings
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[3]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/bindings'
Making all in examples
make[2]: Entering directory '/home/g551683/Documents/pHash-0.2.9.6/examples'
/bin/sh ../libtool --tag=CXX --mode=link g++ -O2 -ffast-math -O3 -L/usr/local/lib -lssl -lcrypto -o test_texthash test_texthash.o ../src/libpHash.la -lmpg123 -lsamplerate -lsndfile -lswscale -lavformat -lavutil -lavcodec -lpng -ljpeg -lfftw3
libtool: link: g++ -O2 -ffast-math -O3 -o .libs/test_texthash test_texthash.o -L/usr/local/lib ../src/.libs/libpHash.so -lssl -lcrypto /usr/local/lib/libmpg123.so /usr/lib/x86_64-linux-gnu/libltdl.so -ldl /usr/local/lib/libsamplerate.so -lsndfile -lswscale -lavformat -lavutil -lavcodec /usr/local/lib/libpng16.so -lz /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/local/lib/libfftw3.a -lm
test_texthash.o: In function `_GLOBAL__sub_I_main':
test_texthash.cpp:(.text.startup+0x1b1): undefined reference to `fftw_init_threads'
collect2: error: ld returned 1 exit status
Makefile:323: recipe for target 'test_texthash' failed
make[2]: *** [test_texthash] Error 1
make[2]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6/examples'
Makefile:419: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/g551683/Documents/pHash-0.2.9.6'
Makefile:298: recipe for target 'all' failed
make: *** [all] Error 2
Can someone help me to solve this error!

From the documentation:
First, programs using the parallel complex transforms should be linked with -lfftw3_threads -lfftw3 -lm on Unix, or -lfftw3_omp -lfftw3 -lm if you compiled with OpenMP. You will also need to link with whatever library is responsible for threads on your system (e.g. -lpthread on GNU/Linux) or include whatever compiler flag enables OpenMP (e.g. -fopenmp with gcc).
You are not linking against this fftw3_threads library, nor to the pthread library.

Related

/usr/bin/ld: cannot find -l-L/usr/lib

I'm facing a weird error while trying to compile fbthrift (https://github.com/facebook/fbthrift) on ubuntu 16.04
make[4]: Entering directory '/home/abhishek/fblualib/fbthrift/thrift/compiler/py'
/bin/bash ../../libtool --tag=CXX --mode=link g++ -std=gnu++1y -module -avoid-version -no-undefined -l -L/usr/lib -lpython2.7 -lfolly -L/usr/local/lib -o frontend.la -rpath /usr/local/lib frontend_la-compiler.lo ../libparse.la ../libthriftcompilerbase.la -lssl -lcrypto -lrt -lpthread -lsasl2 -lmstch -lwangle -lsnappy -lgflags -lglog
libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o .libs/frontend_la-compiler.o -Wl,--whole-archive ../.libs/libparse.a ../.libs/libthriftcompilerbase.a -Wl,--no-whole-archive -l -L/usr/lib -lpython2.7 /usr/local/lib/libfolly.so -L/usr/local/lib -lssl -lcrypto -lrt -lpthread -lsasl2 -lmstch -lwangle -lsnappy -lgflags -lglog -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/5/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o -Wl,-soname -Wl,frontend.so -o .libs/frontend.so
/usr/bin/ld: cannot find -l-L/usr/lib
collect2: error: ld returned 1 exit status
Makefile:500: recipe for target 'frontend.la' failed
make[4]: *** [frontend.la] Error 1
make[4]: Leaving directory '/home/abhishek/fblualib/fbthrift/thrift/compiler/py'
Makefile:882: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/abhishek/fblualib/fbthrift/thrift/compiler'
Makefile:591: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/abhishek/fblualib/fbthrift/thrift/compiler'
Makefile:498: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/abhishek/fblualib/fbthrift/thrift'
Makefile:430: recipe for target 'all' failed
make: *** [all] Error 2
Why would it not find /usr/lib ?
The makefile is generating a link command that reads:
... -l -L/usr/lib ...
The link command in the makefile is likely specified as -l$(SOMEVARIABLE), here, and the variable is not set for some reason, so it gets expanded as an empty string.
As such, this gets interpreted as a directive to link with a shared library whose name is "-L/usr/lib" which is, of course, utterly bogus.
Unfortunately, there is no universal magic button that can be pushed, and fix this error. It will be necessary to investigate what broke during this package's configuration and/or build, and fix it.

Cannot compile RGBdemo 0.7 Linux Mint 17 - undefined reference to symbol 'glOrtho'

This is my very first post here. I am trying to compile RGBdemo to test its reconstruction capabilities with kinect.
I have followed these instructions
RGBdemo compiling instructions
I was able to follow all the instructions more or less consistently but I stomp at the ending (compiling RGBdemo 0.7). Here is the make code.
[ 48%] Built target XnSensorServer
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/depend
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
cd /home/andre/.RGBDemo-0.7.0-Source/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/andre/.RGBDemo-0.7.0-Source /home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make -f nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build.make nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/build
make[2]: Entering directory `/home/andre/.RGBDemo-0.7.0-Source/build'
Linking CXX executable ../../../../../../bin/Sample-Players
cd /home/andre/.RGBDemo-0.7.0-Source/build/nestk/deps/openni/Nite/Samples/Players && /usr/bin/cmake -E cmake_link_script CMakeFiles/Sample-Players.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -O2 -g -DNDEBUG CMakeFiles/Sample-Players.dir/signal_catch.cpp.o CMakeFiles/Sample-Players.dir/SceneDrawer.cpp.o CMakeFiles/Sample-Players.dir/main.cpp.o CMakeFiles/Sample-Players.dir/kbhit.cpp.o -o ../../../../../../bin/Sample-Players -L/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64 -rdynamic ../../../../../../lib/libOpenNI.so -lglut -lusb-1.0 -ldl ../../../../../../lib/libTinyXml.a -Wl,-rpath,/home/andre/.RGBDemo-0.7.0-Source/nestk/deps/openni/Nite/Lib/Linux64:/home/andre/.RGBDemo-0.7.0-Source/build/lib
/usr/bin/ld: CMakeFiles/Sample-Players.dir/main.cpp.o: undefined reference to symbol 'glOrtho'
//usr/lib/x86_64-linux-gnu/mesa/libGL.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [bin/Sample-Players] Error 1
make[2]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make[1]: *** [nestk/deps/openni/Nite/Samples/Players/CMakeFiles/Sample-Players.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.RGBDemo-0.7.0-Source/build'
make: *** [all] Error 2
I have not much experience in compiling programs although I have some programming skills.
I have searched extensively how to solve this issue searching for the errors
"reference to symbol 'glOrtho'" and "adding symbols: DSO missing from command line" but I can't find a decent solution that helped me.
For example this case
Linker error : undefined reference to symbol 'glOrtho'
states that I should link an OpenGL library to a certain file. In my case I think it should be main.cpp but I am unable to find it :-(.
Any help is much appreciated.
Update
Here is the current progress that I was able to achieve in the make
Scanning dependencies of target nestk
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make -f nestk/ntk/CMakeFiles/nestk.dir/build.make nestk/ntk/CMakeFiles/nestk.dir/build
make[2]: Entering directory `/home/andre/.rgbdemo/build'
/usr/bin/cmake -E cmake_progress_report /home/andre/.rgbdemo/build/CMakeFiles 56
[ 59%] Building CXX object nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o
cd /home/andre/.rgbdemo/build/nestk/ntk && /usr/bin/c++ -DHAVE_OPENCV_GREATER_THAN_2_2 -DHAVE_OPENCV_GREATER_THAN_2_3_0 -DNESTK_USE_CUSTOM_OPENNI -DNESTK_USE_EIGEN -DNESTK_USE_FREENECT -DNESTK_USE_GLEW -DNESTK_USE_OPENNI -DNESTK_USE_QT -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SVG_LIB -DQT_XML_LIB -Dnestk_EXPORTS -fPIC -Wall -W -Wno-unused -Wno-sign-compare -O2 -g -DNDEBUG -fPIC -I/home/andre/.rgbdemo/build/nestk/deps -I/home/andre/.rgbdemo/nestk/deps -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtOpenGL -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4/QtCore -I/home/andre/.rgbdemo/nestk/deps/include -I/home/andre/.rgbdemo/nestk/deps/eigen -I/home/andre/.rgbdemo/nestk/deps/libfreenect/include -I/home/andre/.rgbdemo/nestk/deps/openni/Include -I/home/andre/.rgbdemo/nestk/deps/openni/Nite/Include -I/home/andre/.rgbdemo/nestk/deps/glew/include -I/home/andre/.rgbdemo/nestk -I/home/andre/.rgbdemo/build/nestk -o CMakeFiles/nestk.dir/aruco/board.o -c /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp
In file included from /home/andre/.rgbdemo/nestk/ntk/geometry/pose_3d.h:23:0,
from /home/andre/.rgbdemo/nestk/ntk/aruco/marker.h:17,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.h:19,
from /home/andre/.rgbdemo/nestk/ntk/aruco/board.cpp:1:
/home/andre/.rgbdemo/nestk/ntk/core.h:31:38: fatal error: opencv2/legacy/compat.hpp: No such file or directory
# include "opencv2/legacy/compat.hpp"
^
compilation terminated.
make[2]: *** [nestk/ntk/CMakeFiles/nestk.dir/aruco/board.o] Error 1
make[2]: Leaving directory `/home/andre/.rgbdemo/build'
make[1]: *** [nestk/ntk/CMakeFiles/nestk.dir/all] Error 2
make[1]: Leaving directory `/home/andre/.rgbdemo/build'
make: *** [all] Error 2
I will try to find how to correct those directories but I would really apreciate some help on this. Please, I am doing this a bit by trial and error and I know this is not the right way to go. I am not an expert on cmake compilation.
I had to remove and reinstall OpenCV 2.3.1 with these instructions
http://www.ozbotz.org/opencv-installation-2-3-1/
And after some magic...voilá. It works. I hope that this tips can somehow help anyone.

Building error in make step, gdk, libbat.la, MT_global_exit

i'm trying to build MonetDB from source on CentOS.
Typically the problems occur in the make step,
I run the configuration as follows
./configure -prefix=$HOME/MonetDB--disable-geom --disable-strict
This works perfectly fine. However, using "make" afterwards leads to an error:
...
make[3]: Entering directory `/users/db01/dm/MonetDB/MonetDB-11.19.9/gdk'
/bin/sh ../libtool --tag=CC --mode=link gcc -DLIBGDK -g -O2 -D_REENTRANT -version-info 11:4:0 -o libbat.la -rpath /users/db01/dm/MonetDB/MDB/lib libbat_la-gdk_batop.lo libbat_la-gdk_select.lo libbat_la-gdk_select_legacy.lo libbat_la-gdk_search.lo libbat_la-gdk_tm.lo libbat_la-gdk_align.lo libbat_la-gdk_bbp.lo libbat_la-gdk_heap.lo libbat_la-gdk_setop.lo libbat_la-gdk_utils.lo libbat_la-gdk_atoms.lo libbat_la-gdk_qsort.lo libbat_la-gdk_ssort.lo libbat_la-gdk_storage.lo libbat_la-gdk_bat.lo libbat_la-gdk_delta.lo libbat_la-gdk_cross.lo libbat_la-gdk_system.lo libbat_la-gdk_value.lo libbat_la-gdk_posix.lo libbat_la-gdk_logger.lo libbat_la-gdk_sample.lo libbat_la-gdk_calc.lo libbat_la-gdk_aggr.lo libbat_la-gdk_group.lo libbat_la-gdk_mapreduce.lo libbat_la-gdk_imprints.lo libbat_la-gdk_join.lo libbat_la-gdk_join_legacy.lo libbat_la-gdk_unique.lo libbat_la-gdk_firstn.lo ../common/options/libmoptions.la ../common/stream/libstream.la ../common/utils/libmutils.la -lm -lz -lbz2 -pthread -ldl
libtool: link: gcc -shared -fPIC -DPIC .libs/libbat_la-gdk_batop.o .libs/libbat_la-gdk_select.o .libs/libbat_la-gdk_select_legacy.o .libs/libbat_la-gdk_search.o .libs/libbat_la-gdk_tm.o .libs/libbat_la-gdk_align.o .libs/libbat_la-gdk_bbp.o .libs/libbat_la-gdk_heap.o .libs/libbat_la-gdk_setop.o .libs/libbat_la-gdk_utils.o .libs/libbat_la-gdk_atoms.o .libs/libbat_la-gdk_qsort.o .libs/libbat_la-gdk_ssort.o .libs/libbat_la-gdk_storage.o .libs/libbat_la-gdk_bat.o .libs/libbat_la-gdk_delta.o .libs/libbat_la-gdk_cross.o .libs/libbat_la-gdk_system.o .libs/libbat_la-gdk_value.o .libs/libbat_la-gdk_posix.o .libs/libbat_la-gdk_logger.o .libs/libbat_la-gdk_sample.o .libs/libbat_la-gdk_calc.o .libs/libbat_la-gdk_aggr.o .libs/libbat_la-gdk_group.o .libs/libbat_la-gdk_mapreduce.o .libs/libbat_la-gdk_imprints.o .libs/libbat_la-gdk_join.o .libs/libbat_la-gdk_join_legacy.o .libs/libbat_la-gdk_unique.o .libs/libbat_la-gdk_firstn.o -Wl,--whole-archive ../common/options/.libs/libmoptions.a ../common/utils/.libs/libmutils.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/users/db01/dm/MonetDB/MonetDB-11.19.9/common/stream/.libs -Wl,-rpath -Wl,/users/db01/dm/MonetDB/MDB/lib ../common/stream/.libs/libstream.so -L/usr/kerberos/lib64 -lssl -lcrypto -lm -lz -lbz2 -ldl -O2 -pthread -pthread -Wl,-soname -Wl,libbat.so.11 -o .libs/libbat.so.11.0.4
/usr/bin/ld: .libs/libbat_la-gdk_utils.o: relocation R_X86_64_PC32 against `MT_global_exit' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[3]: *** [libbat.la] Error 1
make[3]: Leaving directory `/users/db01/dm/MonetDB/MonetDB-11.19.9/gdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/users/db01/dm/MonetDB/MonetDB-11.19.9/gdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/users/db01/dm/MonetDB/MonetDB-11.19.9'
make: *** [all] Error 2
I found a similar error, containing MT_global_exit in the web: https://www.monetdb.org/pipermail/users-list/2014-June/007334.html
Trying the mentioned suggestion by deleting __attribute__((__visibility__("hidden")))
from the gdk/gdk_private.h was
lead to several different errors (in gdk_private.h) during the make process.
If you have any suggestions, I'd be happy to hear them!
best regards

libboost_*.so: file not recognized: File truncated When dynamically linking using libtool and automake to generate makefile

I am getting the following error:
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated
If I swap the order of boost_filesystem and boost_system I get the following error:
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_filesystem.so: file not recognized: File truncated
Boost built correctly to my knowledge. There were no errors during the build. The makefile that is doing the linking is as follows:
libtool: link: g++ -g -O2 -pthread -Wl,-rpath=../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -o xml_wrapper_tester xml_wrapper_tester-runner.o - L../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib -lboost_wserialization -lboost_timer -lboost_date_time -lboost_iostreams -lboost_chrono -lboost_atomic -lboost_serialization -lboost_locale -lboost_log -lboost_thread -lboost_regex -lboost_log_setup -lboost_system -lboost_filesystem ../xml_wrapper/.libs/libxml_wrapper.a-pthread
../../../external/boost-1.55.0-x86_64-linux-gcc-4.8.2/lib/libboost_system.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make[2]: *** [xml_wrapper_tester] Error 1
make[2]: Leaving directory /home/mehoggan/Devel/RuleSimulator/src/xml/xml_wrapper_tester'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mehoggan/Devel/RuleSimulator/src/xml'
make: *** [all] Error 2
It sounds like your libboost* files are corrupt.
Q: Did you build them yourself? If so, I'd suggest "make clean" (or "rm -rf" from your build root), and rebuild from scratch.
Check carefully for any build errors when you do so.
I would very carefully follow these instructions:
http://www.boost.org/doc/libs/1_55_0/more/getting_started/unix-variants.html
'Hope that helps

Cannot find -lglut but freeglut3-dev is installed

I'm trying to launch a test for opengl on my kubuntu 64b.
Opengl, glew and freeglut are installed but when I compile it says that glut is not found.
CLEAN SUCCESSFUL (total time: 52ms)
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/rxp/NetBeansProjects/Cpptest'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/cpptest
make[2]: Entering directory `/home/rxp/NetBeansProjects/Cpptest'
mkdir -p build/Debug/GNU-Linux-x86
rm -f build/Debug/GNU-Linux-x86/main.o.d
g++ -c -g -I../oglpg-8th-edition/include -MMD -MP -MF build/Debug/GNU-Linux-x86/main.o.d -o build/Debug/GNU-Linux-x86/main.o main.cpp
mkdir -p dist/Debug/GNU-Linux-x86
g++ -o dist/Debug/GNU-Linux-x86/cpptest build/Debug/GNU-Linux-x86/main.o -L../oglpg-8th-edition/lib -lGL -lGLEW -lGLU -lGLUT
/usr/bin/ld: cannot find -lGLUT
collect2: error: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/cpptest] Error 1
make[2]: Leaving directory `/home/rxp/NetBeansProjects/Cpptest'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/rxp/NetBeansProjects/Cpptest'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 358ms)
Could you help me ?
You're using -lGLUT. Note that the libraries are case sensitive, so you need to use -lglut instead.
In build command, the libraries should be linked this way:
-lGL -lGLEW -lGLU -lglut