You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
This also affects the GCC's isnan() declaration, also from the other forum:
Undefining _XOPEN_SOURCE takes out isnan from math.h
#if (_XOPEN_SOURCE<600) || defined(_ALL_SOURCE)
extern int isnan();
So the global declaration is gone and "using ::isnan" will not work.
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 ofpthread_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
More details here:
https://www.ibm.com/developerworks/community/forums/html/topic?id=b6fca107-76a3-4059-b27d-7bbbbaf804fb#repliesPg=0
The text was updated successfully, but these errors were encountered: