g++ internal compiler error during OpenFST building - c++

I'm trying to compile OpenFST:
wget http://distfiles.macports.org/openfst/openfst-1.5.2.tar.gz
tar -xf openfst-1.5.2.tar.gz
cd openfst-1.5.2
sudo ./configure --enable-compact-fsts --enable-const-fsts --enable-far --enable-lookahead-fsts --enable-pdt
sudo make install
But after long time the building fails in this way:
Libraries have been installed in: /usr/local/lib
If you ever happen to want to link against installed libraries in a
given directory, LIBDIR, you must either use libtool, and specify the
full pathname of the library, or use the `-LLIBDIR' flag during
linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for more
information, such as the ld(1) and ld.so(8) manual pages.
---------------------------------------------------------------------- make[3]: Nessuna operazione da eseguire per "install-data-am".
make[3]: uscita dalla directory "/home/pi/src/openfst-1.5.2/src/lib"
make[2]: uscita dalla directory "/home/pi/src/openfst-1.5.2/src/lib"
Making install in script make[2]: ingresso nella directory
"/home/pi/src/openfst-1.5.2/src/script" /bin/bash ../../libtool
--tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I./../include -std=c++11 -MT determinize.lo -MD -MP -MF .deps/determinize.Tpo -c -o determinize.lo determinize.cc libtool: compile: g++ -DHAVE_CONFIG_H
-I./../include -std=c++11 -MT determinize.lo -MD -MP -MF .deps/determinize.Tpo -c determinize.cc -fPIC -DPIC -o
.libs/determinize.o g++: internal compiler error: Killed (program
cc1plus) Please submit a full bug report, with preprocessed source if
appropriate. See <file:///usr/share/doc/gcc-4.9/README.Bugs> for
instructions. Makefile:516: set di istruzioni per l'obiettivo
"determinize.lo" non riuscito make[2]: *** [determinize.lo] Errore 1
make[2]: uscita dalla directory
"/home/pi/src/openfst-1.5.2/src/script" Makefile:358: set di
istruzioni per l'obiettivo "install-recursive" non riuscito make[1]:
*** [install-recursive] Errore 1 make[1]: uscita dalla directory "/home/pi/src/openfst-1.5.2/src" Makefile:414: set di istruzioni per
l'obiettivo "install-recursive" non riuscito make: ***
[install-recursive] Errore 1
I don't understand what is the cause of the error and thus how to fix it.
The o.s. is Rapsbian Jessie Lite running on RPi3.

Related

Undefined reference to `fftw_init_threads' while installing pHash library

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.

Installing a higiher version of GCC on Raspian Wheezy that doesn't rely on a newer glibc

We have software that we distributed to a bunch of Pis that have Raspian Wheezy. Recently, we've added in a bit of code that uses C++ standards that aren't integrated until >=gcc-4.8. If I compile on a newer version of Raspian, there are glibc mismatch errors when running on the Wheezy installed Pis.
Can I get >=gcc-4.8 on one of the Wheezy Pis without also having to install a higher version of glibc (which automatically makes any binary compiled refuse to work on the other Pis)?
Side note:
I've been trying to compile gcc-4.8 but I'm having the worst time because it keeps throwing a bits/predefs.h is missing error. Even though I configured it with --disable-multilib:
make[3]: Entering directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
# If this is the top-level multilib, build all the other
# multilibs.
/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/xgcc -B/root/gcc-4.8/gcc-4.8-20150611/host-armv7l-unknown-linux-gnueabihf/gcc/ -B/usr/local/armv7l-unknown-linux-gnueabihf/bin/ -B/usr/local/armv7l-unknown-linux-gnueabihf/lib/ -isystem /usr/local/armv7l-unknown-linux-gnueabihf/include -isystem /usr/local/armv7l-unknown-linux-gnueabihf/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fPIC -fno-inline -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fPIC -fno-inline -I. -I. -I../../host-armv7l-unknown-linux-gnueabihf/gcc -I../.././libgcc -I../.././libgcc/. -I../.././libgcc/../gcc -I../.././libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../.././libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
from ../.././libgcc/../gcc/tsystem.h:87,
from ../.././libgcc/libgcc2.c:27:
/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory
#include <bits/predefs.h>
^
compilation terminated.
Makefile:460: recipe for target '_muldi3.o' failed
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611/armv7l-unknown-linux-gnueabihf/libgcc'
Makefile:14787: recipe for target 'all-stage1-target-libgcc' failed
make[2]: *** [all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:18655: recipe for target 'stage1-bubble' failed
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory '/root/gcc-4.8/gcc-4.8-20150611'
Makefile:884: recipe for target 'all' failed
make: *** [all] Error 2
This article (https://superuser.com/questions/762274/error-compiling-gcc-on-raspberry-pi) doesn't fix my issue unfortunately.

Can't compile a program that uses Bullet Physics

Why can't I compile a program that uses Bullet Physics?
configure.ac:
PKG_CHECK_MODULES([bullet],[bullet])
src/Makefile.am:
myapp_CFLAGS = ... ${bullet_CFLAGS}
myapp_LDADD = ... ${bullet_LIBS}
Trying to compile it gives me the following error:
$ LC_ALL=C make
make all-recursive
make[1]: Entering directory '/home/me/Utveckling/myapp'
Making all in src
make[2]: Entering directory '/home/me/Utveckling/myapp/src'
depbase=`echo engine/PhysEngine.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I. -I.. -g -O2 -MT engine/PhysEngine.o -MD -MP -MF $depbase.Tpo -c -o engine/PhysEngine.o engine/PhysEngine.cpp &&\
mv -f $depbase.Tpo $depbase.Po
In file included from engine/PhysEngine.h:4:0,
from engine/PhysEngine.cpp:1:
/usr/include/bullet/BulletCollision/btBulletCollisionCommon.h:22:64: fatal error: BulletCollision/CollisionDispatch/btCollisionWorld.h: No such file or directory
#include "BulletCollision/CollisionDispatch/btCollisionWorld.h"
^
compilation terminated.
Makefile:479: recipe for target 'engine/PhysEngine.o' failed
make[2]: *** [engine/PhysEngine.o] Error 1
make[2]: Leaving directory '/home/me/Utveckling/myapp/src'
Makefile:364: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/me/Utveckling/myapp'
Makefile:305: recipe for target 'all' failed
make: *** [all] Error 2
I've installed the Ubuntu package libbullet-dev, and the files exist on the file system.
Found the solution myself.
Instead of
myapp_CFLAGS = ... ${bullet_CFLAGS}
I should be using
myapp_CPPFLAGS = ... ${bullet_CFLAGS}

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.

GLFW Can't compile example netbeans mingw w64

I used the precompiled version of GLFW for windows. I use netbeans and i can't resolve this error.
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
"/E/Develop/Util/msys/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe
make.exe[2]: Entering directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
mkdir -p build/Debug/MinGW-w64_x64_-posix-seh-Windows
rm -f "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d"
g++ -c -g -I/E/Develop/Library/C++/GLFW\ 3.0.4/include -MMD -MP -MF "build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o.d" -o build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o main.cpp
mkdir -p dist/Debug/MinGW-w64_x64_-posix-seh-Windows
g++ -o dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1 build/Debug/MinGW-w64_x64_-posix-seh-Windows/main.o -L../../../../Library/C++/GLFW\ 3.0.4/lib-mingw -L../../../../Compiler/C++/MinGW-w64\(x64\)-posix-seh/x86_64-w64-mingw32/lib -lglfw3 -lglfw3dll
e:/Develop/Compiler/C++/MinGW-w64(x64)-posix-seh/bin/../lib/gcc/x86_64-w64-mingw32/4.9.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lglfw3dll
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-w64_x64_-posix-seh-Windows/cppapplication_1.exe] Error 1
make.exe[2]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/e/Develop/Project/Netbeans/C++/CppApplication_1' make.exe": *** [.build-impl] Error 2
i add the directory and linked the Libraries like this
this is the code
how can i fix this?
The GLFW has two versions of libraries - static and dynamic (DLL). If you want to link with the static library, then you won't have to include the glfw3dll (which is a DLL link library) into the list of libraries. Please see the Building programs that use GLFW for more info. They also mention other libraries you need to link to.