[Matplotlib-devel] fail to build matplotlib on smartos(like open solaris) system

Frank Yu flyxiaoyu at gmail.com
Wed Jun 22 22:43:33 EDT 2016


Hi there,

I am trying build matplotlib on smartos(like open solaris) system. but
failed with error. I am build the latest matplotlib. steps as below:


# git describe

v2.0.0b1-1699-g4b3350d

# python setup.py install

============================================================================

Edit setup.cfg to change the build options


BUILDING MATPLOTLIB

            matplotlib: yes [2.0.0b1+1699.g4b3350d]

                python: yes [2.7.11 (default, Jan 11 2016, 23:16:55)  [GCC

                        4.9.3]]

              platform: yes [sunos5]


REQUIRED DEPENDENCIES AND EXTENSIONS

                 numpy: yes [version 1.11.0]

                   six: yes [The installed version of six is 1.9.0 but a the

                        minimum required version is 1.10. pip/easy install

                        will attempt to install a newer version.]

              dateutil: yes [using dateutil version 2.4.0]

           functools32: yes [using functools32]

                  pytz: yes [using pytz version 2014.10]

                cycler: yes [using cycler version 0.10.0]

               tornado: yes [using tornado version 4.3]

             pyparsing: yes [using pyparsing version 2.0.2]

                libagg: yes [pkg-config information for 'libagg' could not

                        be found. Using local copy.]

              freetype: yes [version 2.5.5]

                   png: yes [version 1.6.17]

                 qhull: yes [pkg-config information for 'qhull' could not be

                        found. Using local copy.]


OPTIONAL SUBPACKAGES

           sample_data: yes [installing]

              toolkits: yes [installing]

                 tests: yes [using nose version 1.3.7 / mock is required to

                        run the matplotlib test suite. Please install it

                        with pip or your preferred tool to run the test

                        suite]

        toolkits_tests: yes [using nose version 1.3.7 / mock is required to

                        run the matplotlib test suite. Please install it

                        with pip or your preferred tool to run the test

                        suite]


OPTIONAL BACKEND EXTENSIONS

                macosx: no  [Mac OS-X only]

                qt5agg: no  [PySide2 not found; PyQt5 not found]

                qt4agg: no  [PySide not found; PyQt4 not found]

               gtk3agg: no  [Requires pygobject to be installed.]

             gtk3cairo: no  [Requires pygobject to be installed.]

                gtkagg: no  [Requires pygtk]

                 tkagg: yes [installing; run-time loading from Python Tcl /

                        Tk]

                 wxagg: no  [requires wxPython]

                   gtk: no  [Requires pygtk]

                   agg: yes [installing]

                 cairo: yes [installing, pycairo version 1.10.0]

             windowing: no  [Microsoft Windows only]


OPTIONAL LATEX DEPENDENCIES

                dvipng: no

           ghostscript: no

                 latex: no

               pdftops: no


OPTIONAL PACKAGE DATA

                  dlls: no  [skipping due to configuration]


running install

running bdist_egg

running egg_info

creating lib/matplotlib.egg-info

writing requirements to lib/matplotlib.egg-info/requires.txt

writing lib/matplotlib.egg-info/PKG-INFO

writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt

writing top-level names to lib/matplotlib.egg-info/top_level.txt

writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt

writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'

reading manifest file 'lib/matplotlib.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'

installing library code to build/bdist.solaris-2.11-i86pc.64bit/egg

running install_lib

running build_py

creating build

creating build/lib.solaris-2.11-i86pc.64bit-2.7

copying lib/pylab.py -> build/lib.solaris-2.11-i86pc.64bit-2.7

creating build/lib.solaris-2.11-i86pc.64bit-2.7/matplotlib

copying lib/matplotlib/_version.py ->
build/lib.solaris-2.11-i86pc.64bit-2.7/matplotlib
​............

​running build_ext

building 'matplotlib.ft2font' extension

creating build/temp.solaris-2.11-i86pc.64bit-2.7

creating build/temp.solaris-2.11-i86pc.64bit-2.7/src

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

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

In file included from /opt/local/include/python2.7/Python.h:44:0,

                 from src/mplutils.h:21,

                 from src/ft2font_wrapper.cpp:1:

/usr/include/unistd.h:521:75: error: declaration of C function 'void
swab(const void*, void*, ssize_t)' conflicts with

In file included from /opt/local/include/python2.7/Python.h:42:0,

                 from src/mplutils.h:21,

                 from src/ft2font_wrapper.cpp:1:

/usr/include/stdlib.h:170:13: error: previous declaration 'void swab(const
char*, char*, ssize_t)' here

error: command 'gcc' failed with exit status 1

​The error is clear, swab was declared twice in both unistd.h and stdlib.h

# sed -n 519,522p /usr/include/unistd.h

#if defined(_XPG4)

/* __EXTENSIONS__ makes the SVID Third Edition prototype in stdlib.h
visible */

extern void swab(const void *_RESTRICT_KYWD, void *_RESTRICT_KYWD, ssize_t);

#endif /* defined(_XPG4) */

# sed -n 170p /usr/include/stdlib.h
extern void swab(const char *, char *, ssize_t);​


# sed -n 158,171p /usr/include/stdlib.h

#if (defined(__EXTENSIONS__) || \

(!defined(_STRICT_STDC__) && !defined(_POSIX_C_SOURCE))) && \

(!defined(_XOPEN_SOURCE) || (defined(_XPG3) && !defined(_XPG4)))

#ifndef _SSIZE_T

#define _SSIZE_T

#if defined(_LP64) || defined(_I32LPx)

typedef long ssize_t; /* size of something in bytes or -1 */

#else

typedef int ssize_t; /* (historical version) */

#endif

#endif /* !_SSIZE_T */


extern void swab(const char *, char *, ssize_t);

#endif /* defined(__EXTENSIONS__) || !defined(_STRICT_STDC) ... */


​I saw someone has asked this question, but can't get a proper answer.

​

-- 
Regards
Frank Yu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-devel/attachments/20160623/9ee5c739/attachment-0001.html>


More information about the Matplotlib-devel mailing list