Description
Bug report
The unsetting of _XOPEN_SOURCE
is preventing compilation of matplotlib on AIX platforms, due to the use of _XOPEN_SOURCE
to define the use of pthread_mutex_timedlock
within /usr/include/pthread.h
. We need to add a check for _AIX
to disable this.
Code for reproduction
On an AIX server with relevant packages installed from AIX Toolbox website, install using command - pip install matplotlib==2.2.3
Actual outcome
/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
Expected outcome
Successful installation.
Matplotlib version
- Operating system: AIX 7.1
- Matplotlib version: 2.2.3
- Python version: 2.7.15
More details here: