# dev-python/matplotlib (emerge fallisce la compilazione)

## mrfabiolo

Ho dato "emerge --ask matplotlib" (dev-python/matplotlib)

Dopo un bel po' di compilazione fa un errore (posto la parte finale dell'output).

```
running build_ext

building 'matplotlib.ft2font' extension

creating /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7

creating /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src

creating /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c src/ft2font.cpp -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src/ft2font.o

In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,

                 from src/ft2font.cpp:7:

/usr/lib64/python2.7/site-packages/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" [-Wcpp]

 #warning "Using deprecated NumPy API, disable it by " \

  ^

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c src/mplutils.cpp -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src/mplutils.o

In file included from /usr/include/python2.7/Python.h:8:0,

                 from src/mplutils.h:18,

                 from src/mplutils.cpp:6:

/usr/include/python2.7/pyconfig.h:1182:0: warning: "_POSIX_C_SOURCE" redefined [enabled by default]

 #define _POSIX_C_SOURCE 200112L

 ^

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/x86_64-pc-linux-gnu/bits/os_defines.h:39:0,

                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/x86_64-pc-linux-gnu/bits/c++config.h:426,

                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/iostream:38,

                 from src/mplutils.cpp:3:

/usr/include/features.h:230:0: note: this is the location of the previous definition

 # define _POSIX_C_SOURCE 200809L

 ^

In file included from /usr/include/python2.7/Python.h:8:0,

                 from src/mplutils.h:18,

                 from src/mplutils.cpp:6:

/usr/include/python2.7/pyconfig.h:1204:0: warning: "_XOPEN_SOURCE" redefined [enabled by default]

 #define _XOPEN_SOURCE 600

 ^

In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/x86_64-pc-linux-gnu/bits/os_defines.h:39:0,

                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/x86_64-pc-linux-gnu/bits/c++config.h:426,

                 from /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.3/include/g++-v4/iostream:38,

                 from src/mplutils.cpp:3:

/usr/include/features.h:162:0: note: this is the location of the previous definition

 # define _XOPEN_SOURCE 700

 ^

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c CXX/cxx_extensions.cxx -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxx_extensions.o

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c CXX/cxxsupport.cxx -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxxsupport.o

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c CXX/IndirectPythonInterface.cxx -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/freetype2 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c CXX/cxxextensions.c -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxxextensions.o

x86_64-pc-linux-gnu-g++ -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe -fno-strict-aliasing /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src/ft2font.o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src/mplutils.o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxx_extensions.o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxxsupport.o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/IndirectPythonInterface.o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/CXX/cxxextensions.o -L/usr/lib -L/usr/lib64 -L/usr/lib64 -lfreetype -lstdc++ -lm -lpython2.7 -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/build/lib/matplotlib/ft2font.so

building 'matplotlib._png' extension

x86_64-pc-linux-gnu-g++ -march=native -O2 -pipe -fno-strict-aliasing -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/include -I. -I/usr/include/libpng16 -I/usr/lib64/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c src/_png.cpp -o /var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/temp.linux-x86_64-2.7/src/_png.o

In file included from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,

                 from /usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,

                 from src/_png.cpp:28:

/usr/lib64/python2.7/site-packages/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" [-Wcpp]

 #warning "Using deprecated NumPy API, disable it by " \

  ^

src/_png.cpp:243:48: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given

             if (npy_PyFile_DupClose(py_file, fp)) {

                                                ^

src/_png.cpp:264:44: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given

         if (npy_PyFile_DupClose(py_file, fp)) {

                                            ^

src/_png.cpp:577:44: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given

         if (npy_PyFile_DupClose(py_file, fp)) {

                                            ^

In file included from src/file_compat.h:4:0,

                 from src/_png.cpp:31:

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘PyObject* npy_PyFile_OpenFile(PyObject*, const char*)’:

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:348:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

     return PyObject_CallFunction(open, "Os", filename, mode);

                                                            ^

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘int npy_PyFile_CloseFile(PyObject*)’:

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:356:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

     ret = PyObject_CallMethod(file, "close", NULL);

                                                  ^

src/_png.cpp: In member function ‘Py::Object _png_module::write_png(const Py::Tuple&)’:

src/_png.cpp:243:17: error: ‘npy_PyFile_DupClose’ was not declared in this scope

             if (npy_PyFile_DupClose(py_file, fp)) {

                 ^

src/_png.cpp:264:13: error: ‘npy_PyFile_DupClose’ was not declared in this scope

         if (npy_PyFile_DupClose(py_file, fp)) {

             ^

src/_png.cpp: In member function ‘PyObject* _png_module::_read_png(const Py::Object&, bool, int)’:

src/_png.cpp:329:43: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]

     if ((fp = npy_PyFile_Dup(py_file, "rb")))

                                           ^

src/_png.cpp:577:13: error: ‘npy_PyFile_DupClose’ was not declared in this scope

         if (npy_PyFile_DupClose(py_file, fp)) {

             ^

error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1

 * ERROR: dev-python/matplotlib-1.3.0::gentoo failed (compile phase):

 *   (no error message)

 * 

 * Call stack:

 *     ebuild.sh, line   93:  Called src_compile

 *   environment, line 4062:  Called distutils-r1_src_compile

 *   environment, line 1322:  Called _distutils-r1_run_foreach_impl 'python_compile'

 *   environment, line  334:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 3601:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 2690:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 2688:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_compile'

 *   environment, line  816:  Called distutils-r1_run_phase 'python_compile'

 *   environment, line 1313:  Called python_compile

 *   environment, line 3184:  Called wrap_setup 'distutils-r1_python_compile'

 *   environment, line 4716:  Called distutils-r1_python_compile 'build' '--build-lib=/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/build/lib'

 *   environment, line 1198:  Called esetup.py 'build' 'build' '--build-lib=/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/build/lib'

 *   environment, line 1764:  Called die

 * The specific snippet of code:

 *       "${@}" || die

 * 

 * If you need support, post the output of `emerge --info '=dev-python/matplotlib-1.3.0::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=dev-python/matplotlib-1.3.0::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/dev-python/matplotlib-1.3.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/dev-python/matplotlib-1.3.0/temp/environment'.

 * Working directory: '/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7'

 * S: '/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0'

>>> Failed to emerge dev-python/matplotlib-1.3.0, Log file:

>>>  '/var/tmp/portage/dev-python/matplotlib-1.3.0/temp/build.log'

 * Messages for package dev-python/matplotlib-1.3.0:

 * ERROR: dev-python/matplotlib-1.3.0::gentoo failed (compile phase):

 *   (no error message)

 * 

 * Call stack:

 *     ebuild.sh, line   93:  Called src_compile

 *   environment, line 4062:  Called distutils-r1_src_compile

 *   environment, line 1322:  Called _distutils-r1_run_foreach_impl 'python_compile'

 *   environment, line  334:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 3601:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 2690:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'

 *   environment, line 2688:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_compile'

 *   environment, line  816:  Called distutils-r1_run_phase 'python_compile'

 *   environment, line 1313:  Called python_compile

 *   environment, line 3184:  Called wrap_setup 'distutils-r1_python_compile'

 *   environment, line 4716:  Called distutils-r1_python_compile 'build' '--build-lib=/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/build/lib'

 *   environment, line 1198:  Called esetup.py 'build' 'build' '--build-lib=/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7/build/build/lib'

 *   environment, line 1764:  Called die

 * The specific snippet of code:

 *       "${@}" || die

 * 

 * If you need support, post the output of `emerge --info '=dev-python/matplotlib-1.3.0::gentoo'`,

 * the complete build log and the output of `emerge -pqv '=dev-python/matplotlib-1.3.0::gentoo'`.

 * The complete build log is located at '/var/tmp/portage/dev-python/matplotlib-1.3.0/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/dev-python/matplotlib-1.3.0/temp/environment'.

 * Working directory: '/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0-python2_7'

 * S: '/var/tmp/portage/dev-python/matplotlib-1.3.0/work/matplotlib-1.3.0'

```

----------

## djinnZ

mi puzza di problema python hai provato a lanciare python-update e/o a compilare con PYTHON_TARGETS="pythonqualcosa" emerge?

----------

## mrfabiolo

Se intendi python-updater non credo faccia errori:

```
tux ~ # python-updater

 * Starting Python Updater...

 * Main active version of Python:    3.3

 * Active version of Python 2:       2.7

 * Active version of Python 3:       3.3

 * Globally supported Python ABIs in installed repositories:

 *   gentoo:                         2.4 2.5 2.6 2.7 3.1 3.2 3.3 2.5-jython 2.7-jython 2.7-pypy-1.7 2.7-pypy-1.8 2.7-pypy-1.9 2.7-pypy-2.0

 * No packages need to be reinstalled.
```

Per quanto riguarda python_target (non so bene cosa dovrei settare... ):

```
┌❨130 ✗❩─[mrlogick@tux]─[7, 28KB]─[19:09]

└[~] ➤ sudo PYTHON_TARGETS="python3_3" emerge --ask matplotlib

 * IMPORTANT: 9 news items need reading for repository 'gentoo'.

 * Use eselect news to read news items.

 * IMPORTANT: 2 config files in '/etc/portage' need updating.

 * See the CONFIGURATION FILES section of the emerge

 * man page to learn how to update config files.

These are the packages that would be merged, in order:

Calculating dependencies \

!!! Problem resolving dependencies for dev-python/matplotlib

... done!

!!! The ebuild selected to satisfy "matplotlib" has unmet requirements.

- dev-python/matplotlib-1.3.0::gentoo USE="cairo gtk qt4 wxwidgets -doc -examples -excel -fltk -gtk3 -latex -test -tk" ABI_X86="64" PYTHON_TARGETS="python3_3 -python2_7"

  The following REQUIRED_USE flag constraints are unsatisfied:

    gtk? ( python_targets_python2_7 ) wxwidgets? ( python_targets_python2_7 )

  The above constraints are a subset of the following complete expression:

    doc? ( any-of ( python_targets_python2_7 ) ) excel? ( any-of ( python_targets_python2_7 ) ) fltk? ( any-of ( python_targets_python2_7 ) ) gtk? ( any-of ( python_targets_python2_7 ) ) wxwidgets? ( any-of ( python_targets_python2_7 ) ) any-of ( python_targets_python2_7 python_targets_python3_3 )

```

```

┌❨1 ✗❩─[mrlogick@tux]─[7, 28KB]─[19:09]

└[~] ➤ sudo PYTHON_TARGETS="python2_7" emerge --ask matplotlib

 * IMPORTANT: 9 news items need reading for repository 'gentoo'.

 * Use eselect news to read news items.

 * IMPORTANT: 2 config files in '/etc/portage' need updating.

 * See the CONFIGURATION FILES section of the emerge

 * man page to learn how to update config files.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N     ] dev-python/matplotlib-1.3.0  USE="cairo gtk qt4 wxwidgets -doc -examples -excel -fltk -gtk3 -latex {-test} -tk" PYTHON_TARGETS="python2_7 -python3_3" 

Would you like to merge these packages? [Yes/No] No

Quitting.
```

----------

## djinnZ

 *mrfabiolo wrote:*   

>  * IMPORTANT: 2 config files in '/etc/portage' need updating.

   :Confused:  che dovresti aggiornare? le news andrebbero lette ma i file di configurazione vanno aggiornati.

Come sta adesso il tuo sistema prova a compilare la libreria sia per l'interprete 2.7 che per il 3.3, dico che forse non funziona con una delle due.

Prova a vedere se compilando solo per 2.7 o solo per 3.3 funziona.

Quello è il significato del comando che ti ho suggerito.

Come vedi dall'errore è un pacchetto che richiede il 2.7 se è attiva vxwidget

Prova a vedere se così funziona. O prova a compilarlo senza wxwidget (o senza gtk o senza qt, se usi gnome o kde)

Se è così aggiungi imposti una use personalizzata -python_target_python2_7 (o qualcosa del genere) in package.use e ti togli dalle mazzate oppure cerchi di capire cosa non va ma ti applichi sulle dipendenze del 2.7 o del 3.3. non su entrambi.  :Wink: 

----------

## WvR

Sorry, I don't speak Italian (but I can read it and understand a littlebit). I have (had) the same problem. I solved it as follows:

The problem is numpy-1.9.0-r1. I downgraded to an older version:

```
rine50 ~ # emerge -pv "<dev-python/numpy-1.9.0-r1"

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] dev-python/numpy-1.8.0-r1  USE="-doc -lapack {-test}" PYTHON_TARGETS="python2_7 python3_3 -python3_4" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB
```

Then emerge matplotlib-1.3.0.

Hope this helps.

----------

## ago

Questi sono problemi da bugzilla non da forum.

Prova a fare un sync, il problema dovrebbe essere risolto per il momento.

----------

