Originally posted by: Teej42
This is weird. Matplotlib is a C++ program that is used by Python to plot a graph based on a set of data, very common tool and highly useful. However, it is exposing errors within the library header files. I am using GCC from this site (for AIX 7.1 - GCC 6.3.0):
The first error is:
/usr/bin/gcc -maix32 -D_LARGE_FILES -pthread -fno-strict-aliasing -D_GNU_SOURCE -fPIC -fno-strict-aliasing -fwrapv -D_LINUX_SOURCE_COMPAT -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DNDEBUG -D_GNU_SOURCE -fPIC -fno-strict-aliasing -fwrapv -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/opt/freeware/lib/python2.7/site-packages/numpy/core/include -I/opt/freeware/lib/python2.7/site-packages/numpy/core/include -I/opt/freeware/include -I/opt/freeware/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/opt/freeware/include/python2.7 -c src/ft2font.cpp -o build/temp.aix-7.1-2.7/src/ft2font.o
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/math.h:36:0,
from /opt/freeware/include/python2.7/pyport.h:325,
from /opt/freeware/include/python2.7/Python.h:61,
from src/mplutils.h:31,
from src/ft2font.cpp:10:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/cmath:646:11: error: '::isnan' has not been declared
using ::isnan;
^~~~~
error: command '/usr/bin/gcc' failed with exit status 1
This was an easy fix, adding std before ::isnan; resolved this issue, although std is defined earlier in this code. However, once I recompiled, this one stumped me:
/usr/bin/gcc -maix32 -D_LARGE_FILES -pthread -fno-strict-aliasing -D_GNU_SOURCE -fPIC -fno-strict-aliasing -fwrapv -D_LINUX_SOURCE_COMPAT -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DNDEBUG -D_GNU_SOURCE -fPIC -fno-strict-aliasing -fwrapv -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/opt/freeware/lib/python2.7/site-packages/numpy/core/include -I/opt/freeware/lib/python2.7/site-packages/numpy/core/include -I/opt/freeware/include -I/opt/freeware/include/freetype2 -I/usr/local/include -I/usr/include -I. -I/opt/freeware/include/python2.7 -c src/ft2font_wrapper.cpp -o build/temp.aix-7.1-2.7/src/ft2font_wrapper.o
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-default.h:30:0,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr.h:148,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/ext/atomicity.h:35,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/bits/basic_string.h:39,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/string:52,
from /opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/stdexcept:39,
from src/py_exceptions.h:7,
from src/ft2font_wrapper.cpp:4:
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-posix.h:118:1: error: 'pthread_mutex_timedlock' was not declared in this scope
__gthrw(pthread_mutex_timedlock)
^
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-posix.h: In function 'int __gthread_mutex_timedlock(__gthread_mutex_t*, const __gthread_time_t*)':
/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/6.3.0/include/c++/powerpc-ibm-aix7.1.0.0/pthread/bits/gthr-posix.h:768:69: error: '__gthrw_pthread_mutex_timedlock' cannot be used as a function
return __gthrw_(pthread_mutex_timedlock) (__mutex, __abs_timeout);
^
error: command '/usr/bin/gcc' failed with exit status 1
I have no idea how to resolve this one.
Is there a known issue with both of those header files? Why?
To reproduce, get all dependencies set up:
GCC/G++
Python 2.7
All dependencies detailed here: https://matplotlib.org/users/installing.html#dependencies
Include /opt/freeware/bin in your PATH
Then run: pip install matplotlib==2.2.3
Other option is to download the source from here (https://github.com/matplotlib/matplotlib) and try to compile ft2font.cpp and ft2font_wrapper.cpp using the above options.
Please advise on what I may be missing, or whether this whole problems are caused by a bug somewhere else (bad/old GCC header files?)
#AIX-Open-Source-Software#AIXOpenSource