error: command 'gcc' failed with exit status 1 while installing matplotlib - python-2.7

When installing matplotlib 1.3.0, getting below error
building 'matplotlib._png' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/local/include -I/usr/include -I. -I/usr/include/libpng12 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include/python2.7 -c src/_png.cpp -o build/temp.linux-x86_64-2.7/src/_png.o
In file included from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1781,
from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:18,
from /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from src/_png.cpp:28:
/usr/local/lib/python2.7/site-enter code herepackages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
src/_png.cpp: In member function ‘Py::Object _png_module::write_png(const Py::Tuple&)’:
src/_png.cpp:147: error: ‘npy_PyFile_Dup’ was not declared in this scope
src/_png.cpp:243: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp:264: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp: In member function ‘PyObject* _png_module::_read_png(const Py::Object&, bool, int)’:
src/_png.cpp:329: error: ‘npy_PyFile_Dup’ was not declared in this scope
src/_png.cpp:577: error: ‘npy_PyFile_DupClose’ was not declared in this scope
error: command 'gcc' failed with exit status 1
In other post suggested to install python-dev and it is already installed on my server.
Thank you in advance
Krishna

Related

Installing RMARIADB on CentOS 7.5

I have been trying to install RMariaDB on my CentOS server with no success. I am running R version 3.5. I keep getting error messages related to scope. The source files seem to be correct and the install has been MD5 Sum checked. The package will unpack but then fails with a non-zero exit status. I get similar error messages whether I am installing RMySQL or RMariaDB. They are both related to the my_bool variable. Specific error messages are posted below:
> install.packages("RMariaDB")
Installing package into ‘/home/cmiddlet#cgifederal.com/R/x86_64-redhat-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/RMariaDB_1.0.6.tar.gz'
Content type 'application/x-gzip' length 42903 bytes (41 KB)
==================================================
downloaded 41 KB
* installing *source* package ‘RMariaDB’ ...
** package ‘RMariaDB’ successfully unpacked and MD5 sums checked
Using mysql_config
Found mysql_config/mariadb_config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/mysql -m64
Using PKG_LIBS=-L/usr/lib64/mysql -lmysqlclient -lpthread -lm -lrt -lssl -lcrypto -ldl
** libs
g++ -m64 -I"/usr/include/R" -DNDEBUG -I/usr/include/mysql -m64 -I"/usr/share/R/library/BH/include" -I"/usr/share/R/library/plogr/include" -I"/home/cmiddlet#cgifederal.com/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c DbConnection.cpp -o DbConnection.o
g++ -m64 -I"/usr/include/R" -DNDEBUG -I/usr/include/mysql -m64 -I"/usr/share/R/library/BH/include" -I"/usr/share/R/library/plogr/include" -I"/home/cmiddlet#cgifederal.com/R/x86_64-redhat-linux-gnu-library/3.5/Rcpp/include" -I/usr/local/include -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -c DbResult.cpp -o DbResult.o
In file included from MariaResultPrep.h:6:0,
from DbResult.cpp:4:
MariaBinding.h:14:15: error: ‘my_bool’ was not declared in this scope
std::vector<my_bool> is_null;
^
MariaBinding.h:14:22: error: template argument 1 is invalid
std::vector<my_bool> is_null;
^
MariaBinding.h:14:22: error: template argument 2 is invalid
In file included from MariaResultPrep.h:9:0,
from DbResult.cpp:4:
MariaRow.h:18:15: error: ‘my_bool’ was not declared in this scope
std::vector<my_bool> nulls_, errors_;
^
MariaRow.h:18:22: error: template argument 1 is invalid
std::vector<my_bool> nulls_, errors_;
^
MariaRow.h:18:22: error: template argument 2 is invalid
make: *** [DbResult.o] Error 1
ERROR: compilation failed for package ‘RMariaDB’
* removing ‘/home/cmiddlet#cgifederal.com/R/x86_64-redhat-linux-gnu-library/3.5/RMariaDB’
Warning in install.packages :
installation of package ‘RMariaDB’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmpwlaf35/downloaded_packages’

can't install wsgi_mod-3.3 for django on ubuntu

I am trying to get my web server running on Ubuntu using Apache2 in order to run my site built with Django. Following the official django docs, I successfully got the apache server to run the django app. However, I am using Python 3.3, and when I installed mod_wsgi, it was configured for the wrong python version, so the app gets a 500 internal server error and the Apache error logs show ImportError: No module named django.core.wsgi.
I am attempting to install mod_wsgi built for Python 3.3 with the following terminal commands.
mkdir ~/sources
cd ~/sources
wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
tar xvfz mod_wsgi-3.3.tar.gz
cd mod_wsgi-3.3
./configure
make
sudo make install
However, when I get to make I get an error and I am unable to continue.
~/sources/mod_wsgi-3.3$ make
/usr/bin/apxs2 -c -I/usr/include/python2.7 -DNDEBUG -D_FORTIFY_SOURCE=2 mod_wsgi.c - L/usr/lib -L/usr/lib/python2.7/config -lpython2.7 -lpthread -ldl -lutil -lm
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static x86_64- linux-gnu-gcc -std=gnu99 -prefer-pic -pipe -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wformat-security -D_FORTIFY_SOURCE=2 -fno-strict-aliasing - D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 - I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -I/usr/include/python2.7 - DNDEBUG -D_FORTIFY_SOURCE=2 -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c: In function 'wsgi_process_socket':
mod_wsgi.c:10095:37: error: 'conn_rec' has no member named 'remote_addr'
if ((rv = apr_socket_addr_get(&c->remote_addr, APR_REMOTE, sock))
^
mod_wsgi.c:10103:27: error: 'conn_rec' has no member named 'remote_ip'
apr_sockaddr_ip_get(&c->remote_ip, c->remote_addr);
^
mod_wsgi.c:10103:41: error: 'conn_rec' has no member named 'remote_addr'
apr_sockaddr_ip_get(&c->remote_ip, c->remote_addr);
^
mod_wsgi.c: In function 'wsgi_hook_daemon_handler':
mod_wsgi.c:12742:18: error: 'conn_rec' has no member named 'remote_ip'
r->connection->remote_ip = (char *)apr_table_get(r->subprocess_env,
^
mod_wsgi.c: In function 'Auth_environ':
mod_wsgi.c:13262:10: error: 'conn_rec' has no member named 'remote_ip'
if (c->remote_ip) {
^
mod_wsgi.c:13263:18: error: 'conn_rec' has no member named 'remote_ip'
value = c->remote_ip;
^
mod_wsgi.c:13295:14: error: 'conn_rec' has no member named 'remote_addr'
rport = c->remote_addr->port;
^
mod_wsgi.c: In function 'wsgi_hook_access_checker':
mod_wsgi.c:14395:29: error: 'conn_rec' has no member named 'remote_ip'
host = r->connection->remote_ip;
^
mod_wsgi.c: At top level:
mod_wsgi.c:14697:5: warning: initialization from incompatible pointer type [enabled by default]
&wsgi_check_authorization,
^
mod_wsgi.c:14697:5: warning: (near initialization for 'wsgi_authz_provider.check_authorization') [enabled by default]
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
From the error message it looks like it is trying to use python2.7 when I want 3.3, although I don't know that this is the cause of the error.
I think that would stem from make, as it says it checked for python in /usr/bin/python and not /usr/bin/python3.3.
How can I get this to work properly?
I am running apache2, django1.6, ubuntu 13.10
EDIT
I was able to get ./configure to work by running ./configure --with-python=/usr/bin/python3.3, but now I get a different error:
~/sources/mod_wsgi-3.3$ make
/usr/bin/apxs2 -c -I/usr/include/python3.3m -DNDEBUG mod_wsgi.c -L/usr/lib - L/usr/lib/python3.3/config -lpython3.3 -lpthread -ldl -lutil -lm
/usr/share/apr-1.0/build/libtool --silent --mode=compile --tag=disable-static x86_64- linux-gnu-gcc -std=gnu99 -prefer-pic -pipe -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wformat-security -D_FORTIFY_SOURCE=2 -fno-strict-aliasing - D_FORTIFY_SOURCE=2 -DLINUX -D_REENTRANT -D_GNU_SOURCE -pthread -I/usr/include/apache2 - I/usr/include/apr-1.0 -I/usr/include/apr-1.0 -I/usr/include -I/usr/include/python3.3m - DNDEBUG -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
mod_wsgi.c:135:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
apxs:Error: Command failed with rc=65536
.
make: *** [mod_wsgi.la] Error 1
Instead of compiling mod_wsgi for python3.3 yourself, you could try to install the ubuntu package

"command 'gcc' failed with exit status 1" building PIL 1.1.7

I'm trying to build python-imaging and I get this error:
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBJPEG -DHAVE_LIBZ -I/usr/local/include/freetype2 -IlibImaging -I/usr/local/include -I/usr/include/tcl8.5 -I/usr/include -I/usr/local/include/python2.7 -c libImaging/JpegDecode.c -o build/temp.linux-i686-2.7/libImaging/JpegDecode.o
libImaging/JpegDecode.c: In function ‘fill_input_buffer’:
libImaging/JpegDecode.c:55:12: error: ‘FALSE’ undeclared (first use in this function)
libImaging/JpegDecode.c:55:12: note: each undeclared identifier is reported only once for each function it appears in
libImaging/JpegDecode.c: In function ‘ImagingJpegDecode’:
libImaging/JpegDecode.c:163:45: error: ‘FALSE’ undeclared (first use in this function)
libImaging/JpegDecode.c: In function ‘fill_input_buffer’:
libImaging/JpegDecode.c:56:1: warning: control reaches end of non-void function [-Wreturn-type]
error: command 'gcc' failed with exit status 1

NDK: has not been declared

I am compiling the C++ code using Android native library NDK but I am getting the following errors while trying to include the g729a.h file in g729_jni.cpp:
ERRORS:
Compile++ arm : g729_jni <= g729_jni.cpp
/usr/src/android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF ./obj/local/armeabi/objs/g729_jni/g729_jni.o.d -fpic -ffunction-sections -funwind-tables -fstack-protector -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fno-exceptions -fno-rtti -O2 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -I/usr/src/android-ndk-r8/sources/cxx-stl/system/include -Ijni -DANDROID -O3 -Wa,--noexecstack -O2 -DNDEBUG -g -I/usr/src/android-ndk-r8/platforms/android-3/arch-arm/usr/include -c jni/g729_jni.cpp -o ./obj/local/armeabi/objs/g729_jni/g729_jni.o
In file included from jni/g729_jni.cpp:34:
jni/g729/g729a.h:70: error: 'UWord8' has not been declared
jni/g729/g729a.h:126: error: 'UWord8' has not been declared
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_open(JNIEnv*, _jobject*)':
jni/g729_jni.cpp:72: error: 'UWord8' was not declared in this scope
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_encode(JNIEnv*, _jobject*, _jshortArray*, jint, _jbyteArray*, jint)':
jni/g729_jni.cpp:111: error: 'UWord8' was not declared in this scope
jni/g729_jni.cpp:111: error: expected ';' before 'serial'
jni/g729_jni.cpp:125: error: 'serial' was not declared in this scope
jni/g729_jni.cpp: In function 'jint Java_org_sipdroid_codecs_G729_decode(JNIEnv*, _jobject*, _jbyteArray*, _jshortArray*, jint)':
jni/g729_jni.cpp:156: error: cannot convert 'unsigned char*' to 'int*' for argument '2' to 'void g729a_dec_process(void*, int*, Word16*, Flag)'
make: *** [obj/local/armeabi/objs/g729_jni/g729_jni.o] Error 1
I googled to try and find the reason behind this error. As C++ is case sensitive, if we make a mistake in upper and lower case, then this kind of error occurs. But I didn't make this kind of mistakes.
If you have any idea or suggestion then please guide me through that.
Thanks
UPDATE:
[root#localhost sipdroid-read-only]# /usr/src/android-ndk-r8/ndk-build V=1 APP_ABI=armeabi APP_PROJECT_PATH=. obj/local/armeabi/objs/g729_jni/g729_jni.o
make: `obj/local/armeabi/objs/g729_jni/g729_jni.o' is up to date.
Make sure your typedef.h is similar to http://siphon.googlecode.com/svn/trunk/g729a/Headers/typedef.h
Here are the steps I made to reproduce your problem:
svn checkout http://sipdroid.googlecode.com/svn/trunk/ sipdroid
cd sipdroid
sed "s/^SILK/include $(CLEAR_VARS)\\nSILK/" -i jni/Android.mk
(note that Android.mk needed a fix after line 89).
svn checkout http://siphon.googlecode.com/svn/trunk/ ../siphon
cp -d ../siphon/g729a/Headers/ jni/g729
wget http://pastie.org/pastes/4737332/download -O jni/g729/g729a.h
wget "http://sipdroid.googlecode.com/issues/attachment?aid=7963991223373796529&name=g729_jni.cpp&token=KHEZCoq6ZYSuV_VhsV8fC3uwsSs%3A1348058591979" -O jni/g729_jni.cpp
sed -e "s/g722_jni/g729_jni/" -i jni/Android.mk
ndk-build.cmd V=1 APP_ABI=armeabi APP_PROJECT_PATH=. obj/local/armeabi/objs/g729_jni/g729_jni.o
... and your file compiles with a small warning. What have you done differently?

Make Errors: Missing Includes in C++ Script?

I just got help in how to compile this script a few mintues ago on SO but I have managed to get errors. I am only a beginner in C++ and have no idea what the below erros means or how to fix it.
This is the script in question. I have read the comments from some users suggesting they changed the #include parts but it seems to be exactly what the script has, see this comment.
[root#localhost wkthumb]# qmake-qt4 && make
g++ -c -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/qt4/mkspecs/linux-g++ -I. -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include -I. -I. -I. -o main.o main.cpp
main.cpp:5:20: error: QWebView: No such file or directory
main.cpp:6:21: error: QWebFrame: No such file or directory
main.cpp:8: error: expected constructor, destructor, or type conversion before ‘*’ token
main.cpp:11: error: ‘QWebView’ has not been declared
main.cpp: In function ‘void loadFinished(bool)’:
main.cpp:18: error: ‘view’ was not declared in this scope
main.cpp:18: error: ‘QWebSettings’ has not been declared
main.cpp:19: error: ‘QWebSettings’ has not been declared
main.cpp:20: error: ‘QWebSettings’ has not been declared
main.cpp: In function ‘int main(int, char**)’:
main.cpp:42: error: ‘view’ was not declared in this scope
main.cpp:42: error: expected type-specifier before ‘QWebView’
main.cpp:42: error: expected `;' before ‘QWebView’
make: *** [main.o] Error 1
I have the web kit on my Fedora Core 10 machine:
qt-4.5.3-9.fc10.i386
qt-devel-4.5.3-9.fc10.i386
Thanks all for any help
The error message indicates that the compiler cannot find what you're trying to include, i.e. <QWebView>. The way to tell the compiler where to look is with the -I flag, to specify include directories (these are not recursive).
Currently, you set the following include dirs:
-I/usr/lib/qt4/mkspecs/linux-g++
-I.
-I/usr/include/QtCore
-I/usr/include/QtGui
-I/usr/include
You need to find where QWebView is located on your system, and add the include path to the commandline (or install QWebView into one of the above dirs).
General note: When you get a lot of errors like this, focus on the first one or two. The later errors (such as ‘QWebView’ has not been declared) will probably be solved by fixing the missing-include error.
main.cpp:18: error: ‘view’ was not declared in this scope
Looks like namespaces have to be provided in the code. Read on namespaces.
main.cpp:20: error: ‘QWebSettings’ has not been declared
No type definition available, can be missing include.