matplotlib gcc segmentation fault / exit status 1 on SLES and SUSE linux

I ran into a nasty problem and was stuck until I realized that my numpy version was 1.3 when it should of been 1.5. But the errors never gave me an indication that this was the issue. I had added the new repository but the package was from some previous installation.

I removed the old version of numpy and the reinstalled from the repository numpy 1.5 and matplotlib 1.0.0_15 and everything was happy crappy. I just thought I would save someone else from the headache.

Is there a listing of incompatible versions in matplotlib for dependencies? Because even when I tried from source it didn’t warn me it wouldn’t work.

iwm1-20:~/matplotlib # python setup.py install

basedirlist is: [‘/usr/local’, ‘/usr’]

···

============================================================================

BUILDING MATPLOTLIB

        matplotlib: 1.0.0

            python: 2.6 (r26:66714, May  5 2010, 14:33:49)  [GCC 4.3.4

                    [gcc-4_3-branch revision 152973]]

          platform: linux2

REQUIRED DEPENDENCIES

             numpy: 1.3.0

         freetype2: found, but unknown version (no pkg-config)

                    * WARNING: Could not find 'freetype2' headers in any

                    * of '/usr/local/include', '/usr/include', '.',

                    * '/usr/local/include/freetype2',

                    * '/usr/include/freetype2', './freetype2'.

It is working correctly just hope to save someone the headache.

Thanks

Jeremy

Here is all my data and I also received this error when I tried to build from easy_install or from source.

easy_install matplotlib

src/ft2font.cpp:92: error: variable or field ‘draw_bitmap’ declared void

src/ft2font.cpp:92: error: ‘FT_Bitmap’ was not declared in this scope

src/ft2font.cpp:92: error: ‘bitmap’ was not declared in this scope

src/ft2font.cpp:93: error: ‘FT_Int’ was not declared in this scope

src/ft2font.cpp:94: error: ‘FT_Int’ was not declared in this scope

error: Setup script exited with error: command ‘gcc’ failed with exit status 1

Exception OSError: (2, ‘No such file or directory’, ‘src/image.cpp’) in <bound method CleanUpFile.del of <setupext.CleanUpFile instance at 0x863edec>> ignored

Exception OSError: (2, ‘No such file or directory’, ‘src/transforms.cpp’) in <bound method CleanUpFile.del of <setupext.CleanUpFile instance at 0x8632d4c>> ignored

Exception OSError: (2, ‘No such file or directory’, ‘src/backend_agg.cpp’) in <bound method CleanUpFile.del of <setupext.CleanUpFile instance at 0x863ed6c>> ignored

or python setup.py install

gcc -pthread -fno-strict-aliasing -DNDEBUG -march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fwrapv -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/lib/python2.6/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/lib/python2.6/site-packages/numpy/core/include/freetype2 -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I./freetype2 -I/usr/include/python2.6 -c src/ft2font.cpp -o build/temp.linux-i686-2.6/src/ft2font.o

In file included from src/ft2font.cpp:3:

src/ft2font.h:16:22: error: ft2build.h: No such file or directory

src/ft2font.h:17:10: error: #include expects “FILENAME” or

src/ft2font.h:18:10: error: #include expects “FILENAME” or

src/ft2font.h:19:10: error: #include expects “FILENAME” or

src/ft2font.h:20:10: error: #include expects “FILENAME” or

src/ft2font.h:21:10: error: #include expects “FILENAME” or

In file included from src/ft2font.cpp:3:

src/ft2font.h:35: error: ‘FT_Bitmap’ has not been declared

src/ft2font.h:35: error: ‘FT_Int’ has not been declared

src/ft2font.h:35: error: ‘FT_Int’ has not been declared

src/ft2font.h:91: error: expected ‘,’ or ‘…’ before ‘&’ token

src/ft2font.h:91: error: ISO C++ forbids declaration of ‘FT_Face’ with no type

src/ft2font.h:97: error: expected ‘,’ or ‘…’ before ‘&’ token

src/ft2font.h:97: error: ISO C++ forbids declaration of ‘FT_Face’ with no type

src/ft2font.h:139: error: ‘FT_Face’ does not name a type

src/ft2font.h:140: error: ‘FT_Matrix’ does not name a type

src/ft2font.h:141: error: ‘FT_Vector’ does not name a type

src/ft2font.h:142: error: ‘FT_Error’ does not name a type

src/ft2font.h:143: error: ‘FT_Glyph’ was not declared in this scope

src/ft2font.h:143: error: template argument 1 is invalid

src/ft2font.h:143: error: template argument 2 is invalid

src/ft2font.h:144: error: ‘FT_Vector’ was not declared in this scope

src/ft2font.h:144: error: template argument 1 is invalid

src/ft2font.h:144: error: template argument 2 is invalid

src/ft2font.h:150: error: ‘FT_BBox’ does not name a type

src/ft2font.cpp:47: error: ‘FT_Library’ does not name a type

src/ft2font.cpp:110: error: variable or field ‘draw_bitmap’ declared void

src/ft2font.cpp:110: error: ‘FT_Bitmap’ was not declared in this scope

src/ft2font.cpp:110: error: ‘bitmap’ was not declared in this scope

src/ft2font.cpp:111: error: ‘FT_Int’ was not declared in this scope

src/ft2font.cpp:112: error: ‘FT_Int’ was not declared in this scope

/usr/lib/python2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:968: warning: ‘int _import_array()’ defined but not used

error: command ‘gcc’ failed with exit status 1

iwm1-20:~/matplotlib # pip pygtk

Here is the repository I have added with the dependencies.

http://download.opensuse.org/repositories/science/SLE_11/

iwm1-20:~ # gcc --version

gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]

Copyright (C) 2008 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

iwm1-20:~ # uname -a

Linux iwm1-20 2.6.32.12-0.7-pae #1 SMP 2010-05-20 11:14:20 +0200 i686 i686 i386 GNU/Linux

iwm1-20:~ # python

Python 2.6 (r26:66714, May 5 2010, 14:33:49)

[GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2

Type “help”, “copyright”, “credits” or “license” for more information.

import matplotlib; print matplotlib.version

Traceback (most recent call last):

File “”, line 1, in

AttributeError: ‘module’ object has no attribute ‘version

iwm1-20:~ # zypper info python-matplotlib

Loading repository data…

Reading installed packages…

Information for package python-matplotlib:

Repository: @System

Name: python-matplotlib

Version: 1.0.0-15.1

Arch: i586

Vendor: openSUSE Build Service

Support Level: unknown

Installed: Yes

Status: up-to-date

Installed Size: 24.4 MiB

Summary: Plotting Library for Python

Description:

matplotlib is a python 2D plotting library which produces publication

quality figures in a variety of hardcopy formats and interactive

environments across platforms. matplotlib can be used in python

scripts, the python and ipython shell (ala matlab or mathematica), web

application servers, and six graphical user interface toolkits.

iwm1-20:~ #

iwm1-20:~ # cat /etc/issue

Welcome to SUSE Linux Enterprise Server 11 SP1 (i586) - Kernel \r (\l).

iwm1-20:~ #

Jeremy Brown-9 wrote:

I ran into a nasty problem and was stuck until I realized that my numpy
version was 1.3 when it should of been 1.5. But the errors never gave me
an indication that this was the issue.

...
It is working correctly just hope to save someone the headache.

No, it was too late to save me from a headache :frowning:

But this indeed fixed my segmentation fault too, so thanks lot!

(Running OpenSuse 11.2; Python segfaulted on a mere "import
matplotlib.pyplot as plt" statement)

Can someone please update the system requirements / dependencies for
matplotlib, or fix this in the source code?

Regards,

Diederik

···

--
View this message in context: http://old.nabble.com/matplotlib-gcc-segmentation-fault---exit-status-1-on-SLES-and-SUSE-linux-tp30516102p30971237.html
Sent from the matplotlib - users mailing list archive at Nabble.com.