<div dir="ltr"><div class="gmail_default" style="font-family:simsun,serif;font-size:large">Hi there,</div><div class="gmail_default" style="font-family:simsun,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:simsun,serif;font-size:large">I am trying build matplotlib on smartos(like open solaris) system. but failed with error. I am build the latest matplotlib. steps as below:</div><div class="gmail_default" style="font-family:simsun,serif;font-size:large"><br></div><div class="gmail_default" style="font-family:simsun,serif;font-size:large"><br></div><div class="gmail_default" style="font-size:large"><span style="font-size:small"><font face="simsun, serif"># git describe</font></span></div>








<p class=""><span class=""><font face="simsun, serif">v2.0.0b1-1699-g4b3350d</font></span></p><div><font face="simsun, serif"><br></font></div><div>







<p class=""><span class=""><font face="simsun, serif"># python setup.py install </font></span></p>
<p class=""><span class=""><font face="simsun, serif">============================================================================</font></span></p>
<p class=""><span class=""><font face="simsun, serif">Edit setup.cfg to change the build options</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">BUILDING MATPLOTLIB</font></span></p>
<p class=""><span class=""><font face="simsun, serif">            matplotlib: yes [2.0.0b1+1699.g4b3350d]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                python: yes [2.7.11 (default, Jan 11 2016, 23:16:55)  [GCC</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        4.9.3]]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">              platform: yes [sunos5]</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">REQUIRED DEPENDENCIES AND EXTENSIONS</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 numpy: yes [version 1.11.0]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                   six: yes [The installed version of six is 1.9.0 but a the</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        minimum required version is 1.10. pip/easy install</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        will attempt to install a newer version.]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">              dateutil: yes [using dateutil version 2.4.0]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">           functools32: yes [using functools32]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                  pytz: yes [using pytz version 2014.10]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                cycler: yes [using cycler version 0.10.0]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">               tornado: yes [using tornado version 4.3]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">             pyparsing: yes [using pyparsing version 2.0.2]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                libagg: yes [pkg-config information for 'libagg' could not</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        be found. Using local copy.]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">              freetype: yes [version 2.5.5]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                   png: yes [version 1.6.17]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 qhull: yes [pkg-config information for 'qhull' could not be</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        found. Using local copy.]</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">OPTIONAL SUBPACKAGES</font></span></p>
<p class=""><span class=""><font face="simsun, serif">           sample_data: yes [installing]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">              toolkits: yes [installing]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 tests: yes [using nose version 1.3.7 / mock is required to</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        run the matplotlib test suite. Please install it</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        with pip or your preferred tool to run the test</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        suite]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">        toolkits_tests: yes [using nose version 1.3.7 / mock is required to</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        run the matplotlib test suite. Please install it</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        with pip or your preferred tool to run the test</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        suite]</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">OPTIONAL BACKEND EXTENSIONS</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                macosx: no  [Mac OS-X only]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                qt5agg: no  [PySide2 not found; PyQt5 not found]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                qt4agg: no  [PySide not found; PyQt4 not found]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">               gtk3agg: no  [Requires pygobject to be installed.]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">             gtk3cairo: no  [Requires pygobject to be installed.]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                gtkagg: no  [Requires pygtk]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 tkagg: yes [installing; run-time loading from Python Tcl /</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                        Tk]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 wxagg: no  [requires wxPython]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                   gtk: no  [Requires pygtk]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                   agg: yes [installing]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 cairo: yes [installing, pycairo version 1.10.0]</font></span></p>
<p class=""><span class=""><font face="simsun, serif">             windowing: no  [Microsoft Windows only]</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">OPTIONAL LATEX DEPENDENCIES</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                dvipng: no</font></span></p>
<p class=""><span class=""><font face="simsun, serif">           ghostscript: no</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 latex: no</font></span></p>
<p class=""><span class=""><font face="simsun, serif">               pdftops: no</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">OPTIONAL PACKAGE DATA</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                  dlls: no  [skipping due to configuration]</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">running install</font></span></p>
<p class=""><span class=""><font face="simsun, serif">running bdist_egg</font></span></p>
<p class=""><span class=""><font face="simsun, serif">running egg_info</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating lib/matplotlib.egg-info</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing requirements to lib/matplotlib.egg-info/requires.txt</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing lib/matplotlib.egg-info/PKG-INFO</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing top-level names to lib/matplotlib.egg-info/top_level.txt</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'</font></span></p>
<p class=""><span class=""><font face="simsun, serif">reading manifest file 'lib/matplotlib.egg-info/SOURCES.txt'</font></span></p>
<p class=""><span class=""><font face="simsun, serif">reading manifest template 'MANIFEST.in'</font></span></p>
<p class=""><span class=""><font face="simsun, serif">writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'</font></span></p>
<p class=""><span class=""><font face="simsun, serif">installing library code to build/bdist.solaris-2.11-i86pc.64bit/egg</font></span></p>
<p class=""><span class=""><font face="simsun, serif">running install_lib</font></span></p>
<p class=""><span class=""><font face="simsun, serif">running build_py</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating build</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating build/lib.solaris-2.11-i86pc.64bit-2.7</font></span></p>
<p class=""><span class=""><font face="simsun, serif">copying lib/pylab.py -> build/lib.solaris-2.11-i86pc.64bit-2.7</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating build/lib.solaris-2.11-i86pc.64bit-2.7/matplotlib</font></span></p>
<p class=""><span class=""><font face="simsun, serif">copying lib/matplotlib/_version.py -> build/lib.solaris-2.11-i86pc.64bit-2.7/matplotlib</font></span></p></div><div><div class="gmail_default" style="font-size:large"><font face="simsun, serif">​............</font></div><div class="gmail_default" style="font-size:large"><font face="simsun, serif"><br></font></div><div class="gmail_default" style="font-size:large"><font face="simsun, serif">​<span style="font-size:small">running build_ext</span></font></div>








<p class=""><span class=""><font face="simsun, serif">building 'matplotlib.ft2font' extension</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating build/temp.solaris-2.11-i86pc.64bit-2.7</font></span></p>
<p class=""><span class=""><font face="simsun, serif">creating build/temp.solaris-2.11-i86pc.64bit-2.7/src</font></span></p>
<p class=""><span class=""><font face="simsun, serif">gcc -fno-strict-aliasing -O2 -pipe -O2 -gdwarf-2 -DHAVE_DB_185_H -pthread -I/usr/include -I/opt/local/include -I/opt/local/include/db4 -I/opt/local/include/ncurses -DNDEBUG -O2 -pipe -O2 -gdwarf-2 -DHAVE_DB_185_H -pthread -I/usr/include -I/opt/local/include -I/opt/local/include/db4 -I/opt/local/include/ncurses -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/opt/local/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/freetype2 -I/usr/local/include -I. -I/opt/local/include/python2.7 -c src/ft2font.cpp -o build/temp.solaris-2.11-i86pc.64bit-2.7/src/ft2font.o</font></span></p>
<p class=""><span class=""><font face="simsun, serif">gcc -fno-strict-aliasing -O2 -pipe -O2 -gdwarf-2 -DHAVE_DB_185_H -pthread -I/usr/include -I/opt/local/include -I/opt/local/include/db4 -I/opt/local/include/ncurses -DNDEBUG -O2 -pipe -O2 -gdwarf-2 -DHAVE_DB_185_H -pthread -I/usr/include -I/opt/local/include -I/opt/local/include/db4 -I/opt/local/include/ncurses -fPIC -DFREETYPE_BUILD_TYPE=system -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib_ft2font_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/opt/local/lib/python2.7/site-packages/numpy/core/include -I/opt/local/include/libpng16 -I/opt/local/include -I/opt/local/include/freetype2 -I/usr/local/include -I. -I/opt/local/include/python2.7 -c src/ft2font_wrapper.cpp -o build/temp.solaris-2.11-i86pc.64bit-2.7/src/ft2font_wrapper.o</font></span></p>
<p class=""><span class=""><font face="simsun, serif">In file included from /opt/local/include/python2.7/Python.h:44:0,</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 from src/mplutils.h:21,</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 from src/ft2font_wrapper.cpp:1:</font></span></p>
<p class=""><span class=""><font face="simsun, serif">/usr/include/unistd.h:521:75: error: declaration of C function 'void swab(const void*, void*, ssize_t)' conflicts with</font></span></p>
<p class=""><span class=""><font face="simsun, serif">In file included from /opt/local/include/python2.7/Python.h:42:0,</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 from src/mplutils.h:21,</font></span></p>
<p class=""><span class=""><font face="simsun, serif">                 from src/ft2font_wrapper.cpp:1:</font></span></p>
<p class=""><span class=""><font face="simsun, serif">/usr/include/stdlib.h:170:13: error: previous declaration 'void swab(const char*, char*, ssize_t)' here</font></span></p>
<p class=""><span class=""><font face="simsun, serif">error: command 'gcc' failed with exit status 1</font></span></p><br></div><div><div class="gmail_default" style="font-family:simsun,serif;font-size:large">​The error is clear, swab was declared twice in both unistd.h and stdlib.h</div><div class="gmail_default" style="font-family:simsun,serif;font-size:large"><br></div>















<p class=""><span class=""><font face="simsun, serif"># sed -n 519,522p /usr/include/unistd.h </font></span></p>
<p class=""><span class=""><font face="simsun, serif">#if defined(_XPG4)</font></span></p>
<p class=""><span class=""><font face="simsun, serif">/* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h visible */</font></span></p>
<p class=""><span class=""><font face="simsun, serif">extern void swab(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, ssize_t);</font></span></p>
<p class=""><font face="simsun, serif">#endif /* defined(_XPG4) */</font></p><p class=""><span style="font-family:simsun,serif"># sed -n 170p /usr/include/stdlib.h</span><br></p>
<div class="gmail_default" style="font-size:large"><font face="simsun, serif"><span style="font-size:small">extern void swab(const char *, char *, ssize_t);</span>​</font></div><br></div><div><br></div><div>







<p class=""><span class=""><font face="simsun, serif"># sed -n 158,171p /usr/include/stdlib.h</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#if (defined(__EXTENSIONS__) || \</font></span></p>
<p class=""><span class=""><font face="simsun, serif"><span class="">   </span>(!defined(_STRICT_STDC__) && !defined(_POSIX_C_SOURCE))) && \</font></span></p>
<p class=""><span class=""><font face="simsun, serif"><span class="">   </span>(!defined(_XOPEN_SOURCE) || (defined(_XPG3) && !defined(_XPG4)))</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#ifndef<span class="">    </span>_SSIZE_T</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#define<span class="">    </span>_SSIZE_T</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#if defined(_LP64) || defined(_I32LPx)</font></span></p>
<p class=""><span class=""><font face="simsun, serif">typedef long<span class="">       </span>ssize_t;<span class="">    </span>/* size of something in bytes or -1 */</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#else</font></span></p>
<p class=""><span class=""><font face="simsun, serif">typedef int<span class="">        </span>ssize_t;<span class="">    </span>/* (historical version) */</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#endif</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#endif<span class="">     </span>/* !_SSIZE_T */</font></span></p>
<p class=""><font face="simsun, serif"><span class=""></span><br></font></p>
<p class=""><span class=""><font face="simsun, serif">extern void swab(const char *, char *, ssize_t);</font></span></p>
<p class=""><span class=""><font face="simsun, serif">#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */</font></span></p><p class=""><span class=""><font face="simsun, serif"><br></font></span></p><p class=""><span class=""><font face="simsun, serif"></font></span></p><div class="gmail_default" style="font-family:simsun,serif;font-size:large;display:inline"><font face="simsun, serif">​I saw someone has asked this question, but can't get a proper answer.</font></div><p></p><p class=""><span class=""><font face="simsun, serif"></font></span></p><div class="gmail_default" style="font-family:simsun,serif;font-size:large;display:inline"><font face="simsun, serif">​</font></div><font face="simsun, serif"><br></font><p></p></div><font face="simsun, serif">-- <br></font><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><font face="simsun, serif">Regards<br>Frank Yu</font><br></div></div>
</div>