Beaglebone: gcc include path error while trying to build using 'make' - gcc

I am trying to build cmu pocketsphinx on my beaglebone black for speech recognition. I have downloaded the source code for sphinxbase and ran ./configure. Now, when I run 'make' I get the following errors:
Making all in src
make[1]: Entering directory `/home/root/Pocketsphinx/sphinxbase-0.8/src'
Making all in libsphinxbase
make[2]: Entering directory `/home/root/Pocketsphinx/sphinxbase-0.8/src/libsphinxbase'
Making all in util
make[3]: Entering directory `/home/root/Pocketsphinx/sphinxbase-0.8/src/libsphinxbase/util'
/bin/sh ../../../libtool --tag=CC --mode=compile gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/sphinxbase -I../../../include -I../../../include -I/usr/include/python2.7 -I/usr/include/python2.7 -g -O2 -Wall -MT bitvec.lo -MD -MP -MF .deps/bitvec.Tpo -c -o bitvec.lo bitvec.c
libtool: compile: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../../../include -I../../../include/sphinxbase -I../../../include -I../../../include "-I/usr/include/python2.7" -I/usr/include/python2.7 -g -O2 -Wall -MT bitvec.lo -MD -MP -MF .deps/bitvec.Tpo -c bitvec.c -fPIC -DPIC -o .libs/bitvec.o
gcc: error: -I/usr/include/python2.7: No such file or directory
make[3]: *** [bitvec.lo] Error 1
make[3]: Leaving directory `/home/root/Pocketsphinx/sphinxbase-0.8/src/libsphinxbase/util'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/root/Pocketsphinx/sphinxbase-0.8/src/libsphinxbase'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/root/Pocketsphinx/sphinxbase-0.8/src'
make: *** [all-recursive] Error 1
I have checked under /usr/include and I can see python2.7 folder there. But, in the above it says that gcc can not find the python2.7 directory. I am kind of lost. Any help would be appreciated.
Thanks

GCC is interpreting that argument as the name of a file to be compiled, not a -I option. I find it exceedingly odd that it's putting quotes around one of the arguments. My suspicion is that this is because one of the characters in that argument is not a standard ASCII character. For example maybe you've used a different dash character (not ASCII code 45 / hex 0x2d, but instead some other character code that shows up sort of like a dash).

Related

vowpal wabbit installation make file

I am having a hard time installing vowpal wabbit.
The problem I run into is after cloning vw, when I run the command make. Error message below
Would highly appreciate any help!
OS: Windows 8.1 64 bit
Thanks
A
$ make
Making all in vowpalwabbit
make[1]: Entering directory '/home/Alejandro/vowpal_wabbit/vowpalwabbit'
make all-am
make[2]: Entering directory '/home/Alejandro/vowpal_wabbit/vowpalwabbit'
/bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/include
-O3 -fomit-frame-pointer -ffast-math -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -DNDEBUG -
Wall -pedantic -std=c++0x -MT global_data.lo -MD -MP -MF .deps/global_data.Tpo -c -o global_data.lo global_data.cc
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I/usr/include -I/include -O3 -fomit-frame-pointer - ffast-math -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -DNDEBUG -Wall -pedantic -std=c++0x -MT global_data.lo -MD -MP -MF .deps/global_data.Tpo -c global_data.cc -DDLL_EXPORT -DPIC -o .libs/global_data.o
In file included from comp_io.h:7:0,
from global_data.h:17,
from global_data.cc:13:
io_buf.h: In member function 'virtual int io_buf::open_file(const char*, bool, int)':
io_buf.h:72:25: error: 'fileno' was not declared in this scope ret = fileno(stdin);
In file included from global_data.h:17:0,
from global_data.cc:13:
comp_io.h: In member function 'virtual int comp_io_buf::open_file(const char*, bool, int)':
comp_io.h:28:34: error: 'fileno' was not declared in this scope
fil = gzdopen(fileno(stdin), "rb");
^
global_data.cc: In constructor 'vw::vw()':
global_data.cc:295:32: error: 'fileno' was not declared in this scope
stdout_fileno = fileno(stdout);
^
Makefile:619: recipe for target 'global_data.lo' failed
make[2]: *** [global_data.lo] Error 1
make[2]: Leaving directory '/home/Alejandro/vowpal_wabbit/vowpalwabbit'
Makefile:390: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/Alejandro/vowpal_wabbit/vowpalwabbit'
Makefile:503: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
I could not solve the issue, but at least I can point you to a vowpalwabbit executable file. So you do not have to make it.
https://github.com/MLWave/vowpal-wabbit-cygwin-executables
A noble soul from Kaggle pointed me to this link. You need to install Cycwin and execute the .exe from cygwin.
There is also a pure Windows executable build https://github.com/MLWave/Kaggle_Rotten_Tomatoes
Also provided by Triskelion, the same folk who provided the build above. His advice: To run that use "cmd" to open a console, don't click on the file.

'glib.h' file not found on Max OSX 10.9

I'm trying to compile msg2pdf which is a tool to convert messages in mu4e (mu for Emacs) to pdf.
I'm receiving the following error :
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
CC msg2pdf.o
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Oddly, I checked the Makefile and GLIB_CFLAGS seem to be pointing on the right folder (where brew installed it).
In fact, glib.h is located in /usr/local/Cellar/glib/2.40.0_1/include/glib-2.0.
GLIB_CFLAGS = -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include
GLIB_LIBS = -L/usr/local/Cellar/glib/2.40.0_1/lib -L/usr/local/opt/gettext/lib -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl
How can I succeed compiling the file? Is there any command line "hack" I can use while calling
make?
Edit
Here are the files in the directory
https://github.com/flexdec/temp
Edit 2
This is the output when using make V=1
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
In file included from msg2pdf.c:20:
In file included from ../../lib/mu-msg.h:24:
../../lib/mu-flags.h:24:10: fatal error: 'glib.h' file not found
#include <glib.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Edit 3
The new error I get using make V=1 now that GLIB_CFLAGS issue is fixed
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in .
gcc -DHAVE_CONFIG_H -I. -I../.. -I../../lib -D_REENTRANT -I/usr/local/Cellar/glib/2.40.0_1/include/glib-2.0 -I/usr/local/Cellar/glib/2.40.0_1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -DICONDIR='""' -Wall -Wextra -Wno-unused-parameter -Wdeclaration-after-statement -g -O2 -MT msg2pdf.o -MD -MP -MF .deps/msg2pdf.Tpo -c -o msg2pdf.o msg2pdf.c
msg2pdf.c:24:10: fatal error: 'gtk/gtk.h' file not found
#include <gtk/gtk.h>
^
1 error generated.
make[2]: *** [msg2pdf.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
make V=1 instead of make will tell you what the C compiler command looks like (instead of just "CC msg2pdf.o")—check that and make sure it includes the flags you need.
Based on a quick look at your Makefile.am, you are including $(GTK_CFLAGS) and $(WEBKIT_CFLAGS) in your AM_CPPFLAGS but not $(GLIB_CFLAGS).
You need to run ./configure in mu's top-level directory on the machine where you want to compile it. configure will tell you about any missing dependencies. Optional components (such as msg2pdf) are skipped if their dependencies are not there.
Then, after configure succeeds, do a 'make'.
In any case, if configure has run successfully, the top-level 'make' should succeed as well (that's why we have configure!), otherwise please file a bug.

GCC compiling error: conflicts with the other architecture options, which specify a mips1 processor

Im trying to cross-compile valgrind for MIPS architecture but im getting errors.
$ make
make all-recursive
make[1]: Entering directory `/valgrind-3.9.0'
Making all in include
make[2]: Entering directory `/valgrind-3.9.0/include'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/valgrind-3.9.0/include'
Making all in VEX
make[2]: Entering directory `/valgrind-3.9.0/VEX'
make all-am
make[3]: Entering directory `/valgrind-3.9.0/VEX'
/toolchain/rsdk-1.5.6-5281-EB-2.6.30-0.9.30.3-110915/bin/rsdk-linux-gcc - DHAVE_CONFIG_H -I. -I.. -I.. -I../include -I../VEX/pub -DVGA_mips32=1 -DVGO_linux=1 -DVGP_mips32_linux=1 -DVGPV_mips32_linux_vanilla=1 -Ipriv -O2 -g -Wall -Wmissing-prototypes -Wshadow -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations -Wno-format-zero-length -fno-strict-aliasing -fno-builtin -mips32 -Wbad-function-cast -Wcast-qual -Wcast-align -fstrict-aliasing -Wno-long-long -Wwrite-strings -fno-stack-protector -MT priv/libvex_mips32_linux_a-main_globals.o -MD -MP -MF priv/.deps/libvex_mips32_linux_a-main_globals.Tpo -c -o priv/libvex_mips32_linux_a-main_globals.o `test -f 'priv/main_globals.c' || echo './'`priv/main_globals.c
priv/main_globals.c:1: error: '-mips32' conflicts with the other architecture options, which specify a mips1 processor
make[3]: *** [priv/libvex_mips32_linux_a-main_globals.o] Error 1
make[3]: Leaving directory `/valgrind-3.9.0/VEX'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/valgrind-3.9.0/VEX'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/valgrind-3.9.0'
make: *** [all] Error 2
I dont know if there is a problem with -mips32 argument but if i remove it i get error with 'opcodes not supported' later. Im not sure if this error complains about incompability issue.
I land up with the same issue and below is the solution. Change -march=mips32 to --march=mips32r2. I have used my build script something like -
if [[ "$PATH" == *"/usr/local/mips-2012.09/bin"* ]]; then
echo codesourcery toolchain path is already in PATH var
else
export PATH="/usr/local/mips-2012.09/bin:$PATH"
echo added codesourcery toolchain path to PATH var
fi
export AR=mips-linux-gnu-ar
export CC='mips-linux-gnu-gcc -EL'
export CXX='mips-linux-gnu-g++ -EL'
export LINK='mips-linux-gnu-g++ -EL'
export RANLIB=mips-linux-gnu-ranlib
export CFLAGS='-march=mips32r2'
export CCFLAGS='-march=mips32r2'
export CXXFLAGS='-march=mips32r2'
Happy Coding :-)

Error while installing tiff-3.8.2

pranav#pranav-Inspiron-1545:~/dependency/tiff-3.8.2$ make
Making all in port
make[1]: Entering directory `/home/pranav/dependency/tiff-3.8.2/port'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/pranav/dependency/tiff-3.8.2/port'
Making all in libtiff
make[1]: Entering directory `/home/pranav/dependency/tiff-3.8.2/libtiff'
make all-am
make[2]: Entering directory `/home/pranav/dependency/tiff-3.8.2/libtiff'
if /bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -g -O2 -Wall -W -MT tif_jpeg.lo -MD -MP -MF ".deps/tif_jpeg.Tpo" -c -o tif_jpeg.lo tif_jpeg.c; \
then mv -f ".deps/tif_jpeg.Tpo" ".deps/tif_jpeg.Plo"; else rm -f ".deps/tif_jpeg.Tpo"; exit 1; fi
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I. -I. -g -O2 -Wall -W -MT tif_jpeg.lo -MD -MP -MF .deps/tif_jpeg.Tpo -c tif_jpeg.c -fPIC -DPIC -o .libs/tif_jpeg.o
In file included from /usr/local/include/jpeglib.h:27:0,
from tif_jpeg.c:87:
/usr/local/include/jmorecfg.h:263:16: error: expected identifier before numeric constant
tif_jpeg.c: In function 'JPEGVSetField':
tif_jpeg.c:1578:8: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
make[2]: *** [tif_jpeg.lo] Error 1
make[2]: Leaving directory `/home/pranav/dependency/tiff-3.8.2/libtiff'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/pranav/dependency/tiff-3.8.2/libtiff'
make: *** [all-recursive] Error 1
Edit file: /usr/local/include/jmorecfg.h
change line:
typedef enum { FALSE = 0 , TRUE = 1 } boolean;
to:
typedef enum { false= 0 , true= 1 } boolean;
Then, make successful.
I met this error when I compile for install emacs, and I don't think this is a perfect solution, my solution is change the source file which called jpeglib.h, before change:
# include <jpeglib.h>
after:
#define HAVE_BOOLEAN
typedef unsigned char boolean;
# include <jpeglib.h>
#undef HAVE_BOOLEAN
this solution work fine.

Building memcached 1.4.x on windows error with cygwin

I'm trying to build memcached on Windows. Here's what I get:
$ make
make all-recursive
make[1]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
Making all in doc
make[2]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make all-am
make[3]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[3]: Nothing to be done for `all-am'.
make[3]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[2]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6/doc'
make[2]: Entering directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -DNDEBUG -I/usr/local/include -g -O2 -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declaration
s -Wredundant-decls -MT memcached-memcached.o -MD -MP -MF .deps/memcached-memcached.Tpo -c -o memcached-memcached.o `test -f 'memcached.c' || echo './
'`memcached.c
gcc: unrecognized option '-pthread'
cc1: warnings being treated as errors
memcached.c: In function `sanitycheck':
memcached.c:4361: error: array subscript has type `char'
make[2]: *** [memcached-memcached.o] Error 1
make[2]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/Project Storage/adam/memcached-1.4.6'
Is there something that I've missed?
First, you must configure with static linkage
export CFLAGS='-static -static-libgcc'
Then just add a cast to int in sanitycheck
!isdigit((int)ever[3]))
If you'd like the testapp.c I had to change the sigaction init to
struct sigaction action; // The init here did not work with cygwin gcc 4.5.3
action.sa_flags=0;
action.sa_handler=SIG_IGN;
The problem is that they've configured CFLAGS with -Werror . Hence the warning you got stopped the build.
You can edit the Makefile, remove -Werror and you should be able to continue with the build.

Resources