Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Build errors with existing qhull #8872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
eric-wieser opened this issue Jul 14, 2017 · 6 comments · Fixed by #10074
Closed

Build errors with existing qhull #8872

eric-wieser opened this issue Jul 14, 2017 · 6 comments · Fixed by #10074

Comments

@eric-wieser
Copy link
Contributor

eric-wieser commented Jul 14, 2017

Having trouble building matplotlib from source. It seems that QHULL_LIB_CHECK is not defined for me, which causes a chain of useless errors. My guess is that the problem is I already have a system Qhull package (for ROS), which is conflicting with the bundled one. Here's the output I get:

python setup.py build
============================================================================
Edit setup.cfg to change the build options

BUILDING MATPLOTLIB
            matplotlib: yes [2.0.2+4383.g4690576]
                python: yes [2.7.6 (default, Oct 26 2016, 20:30:19)  [GCC
                        4.8.4]]
              platform: yes [linux2]

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.8.2]
                   six: yes [using six version 1.10.0]
              dateutil: yes [using dateutil version 1.5]
backports.functools_lru_cache: yes [backports.functools_lru_cache was not
                        found. It is required forPython versions prior to
                        3.2]
          subprocess32: yes [subprocess32 was not found. It used  for Python
                        versions prior to 3.2 to improves functionality on
                        Linux and OSX]
                  pytz: yes [using pytz version 2012c]
                cycler: yes [cycler was not found. pip/easy_install may
                        attempt to install it after matplotlib.]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [using pyparsing version 2.1.10]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: yes [Using local version for testing]
                   png: yes [version 1.2.50]
                 qhull: yes [Using system Qhull (version unknown, no pkg-
                        config info)]

OPTIONAL SUBPACKAGES
           sample_data: yes [installing]
              toolkits: yes [installing]
                 tests: no  [skipping due to configuration]
        toolkits_tests: no  [skipping due to configuration]

OPTIONAL BACKEND EXTENSIONS
                macosx: no  [Mac OS-X only]
                qt5agg: no  [PySide2 not found; PyQt5 not found]
                qt4agg: yes [installing, Qt: 4.8.6, PySide: 1.2.1; Qt:
                        4.8.6, PyQt: 4.8.6]
               gtk3agg: no  [Requires gtk3 development files to be
                        installed.]
             gtk3cairo: no  [Requires gtk3 development files to be
                        installed.]
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/__init__.py:57: GtkWarning: could not open display
  warnings.warn(str(e), _gtk.Warning)
                gtkagg: no  [The C/C++ header for pygtk (pygtk/pygtk.h)
                        could not be found.  You may need to install the
                        development package.]
                 tkagg: yes [installing; run-time loading from Python Tcl /
                        Tk]
                 wxagg: yes [installing, version 2.8.12.1]
                   gtk: no  [The C/C++ header for pygtk (pygtk/pygtk.h)
                        could not be found.  You may need to install the
                        development package.]
                   agg: yes [installing]
                 cairo: yes [installing, pycairo version 1.8.8]
             windowing: no  [Microsoft Windows only]

OPTIONAL LATEX DEPENDENCIES
                dvipng: no
           ghostscript: yes [version 9.10]
                 latex: yes [version 3.1415926]
               pdftops: no

OPTIONAL PACKAGE DATA
                  dlls: no  [skipping due to configuration]

running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.7/matplotlib/mpl-data
UPDATING build/lib.linux-x86_64-2.7/matplotlib/_version.py
set build/lib.linux-x86_64-2.7/matplotlib/_version.py to '2.0.2+4383.g4690576'
running build_ext
building 'matplotlib._qhull' extension
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -DMPL_DEVNULL=/dev/null -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__qhull_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -D__STDC_FORMAT_MACROS=1 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/include/python2.7 -c src/qhull_wrap.c -o build/temp.linux-x86_64-2.7/src/qhull_wrap.o
src/qhull_wrap.c: In function ‘delaunay_impl’:
src/qhull_wrap.c:112:5: error: unknown type name ‘QHULL_LIB_CHECK’
     QHULL_LIB_CHECK
     ^
src/qhull_wrap.c:115:5: error: conflicting types for ‘points’
     points = (coordT*)malloc(npoints*ndim*sizeof(coordT));
     ^
src/qhull_wrap.c:96:13: note: previous definition of ‘points’ was here
     coordT* points = NULL;
             ^
src/qhull_wrap.c:115:14: warning: initialization makes integer from pointer without a cast [enabled by default]
     points = (coordT*)malloc(npoints*ndim*sizeof(coordT));
              ^
src/qhull_wrap.c:116:16: warning: comparison between pointer and integer [enabled by default]
     if (points == NULL) {
                ^
src/qhull_wrap.c:124:15: error: subscripted value is neither array nor pointer nor vector
         points[2*i  ] = x[i];
               ^
src/qhull_wrap.c:125:15: error: subscripted value is neither array nor pointer nor vector
         points[2*i+1] = y[i];
               ^
src/qhull_wrap.c:147:29: warning: passing argument 3 of ‘qh_new_qhull’ makes pointer from integer without a cast [enabled by default]
                             "qhull d Qt Qbb Qc Qz", NULL, error_file);
                             ^
In file included from /usr/include/libqhull/qhull_a.h:27:0,
                 from src/qhull_wrap.c:10:
/usr/include/libqhull/libqhull.h:1002:9: note: expected ‘double *’ but argument is of type ‘int’
 int     qh_new_qhull(int dim, int numpoints, coordT *points, boolT ismalloc,
         ^
src/qhull_wrap.c:230:5: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [enabled by default]
     free(points);
     ^
In file included from /usr/include/python2.7/Python.h:42:0,
                 from src/qhull_wrap.c:8:
/usr/include/stdlib.h:483:13: note: expected ‘void *’ but argument is of type ‘int’
 extern void free (void *__ptr) __THROW;
             ^
src/qhull_wrap.c:249:5: warning: passing argument 1 of ‘free’ makes pointer from integer without a cast [enabled by default]
     free(points);
     ^
In file included from /usr/include/python2.7/Python.h:42:0,
                 from src/qhull_wrap.c:8:
/usr/include/stdlib.h:483:13: note: expected ‘void *’ but argument is of type ‘int’
 extern void free (void *__ptr) __THROW;
             ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

In case it's relevant, here's some info about my installed qhull

dpkg -s libqhull-dev
Package: libqhull-dev
Status: install ok installed
Priority: optional
Section: libdevel
Installed-Size: 1092
Maintainer: Ubuntu Developers <[email protected]>
Architecture: amd64
Multi-Arch: same
Source: qhull
Version: 2012.1-4
Depends: libqhull6 (= 2012.1-4)
Description: calculate convex hulls and related structures (development files)
 Qhull computes convex hulls, Delaunay triangulations, halfspace
 intersections about a point, Voronoi diagrams, furthest-site
 Delaunay triangulations, and furthest-site Voronoi diagrams. It
 runs in 2-d, 3-d, 4-d, and higher dimensions.
 .
 This package contains the files necessary for development (headers and
 libraries), as well as the library documentation in HTML format.
Original-Maintainer: Debian Science Maintainers <[email protected]>
Homepage: http://www.qhull.org

I'm doing this on WSL.

@eric-wieser
Copy link
Contributor Author

eric-wieser commented Jul 14, 2017

The installation instructions say qhull 2012.1 is correct, yet matplotlib is actually bundled with 2015.2.

This looks like a documentation bug to me

Edit: That's actually just the difference between master and release, so everything is fine

@eric-wieser
Copy link
Contributor Author

eric-wieser commented Jul 14, 2017

qhull 2015.2 is not available on ubuntu 14.04 - so how can I tell matplotlib to use its bundled version, and not the system version?

@eric-wieser
Copy link
Contributor Author

eric-wieser commented Jul 14, 2017

So, this seems like a bug to me, in setupext

        try:
            # fails if the version is too old
            return self._check_for_pkg_config(
                'libqhull', 'libqhull/qhull_a.h', min_version='2015.2')
        except CheckFailed as e:
            use_the_old_version_anyway()

Surely if the version doesn't match, we should use the bundled qhull?

@renxinhe
Copy link

I ran into similar issue with qhull, and fixed it by manually updating libqhull-dev from 2012 to 2015. You can find the .deb files on this website.

I have a Ubuntu 14.04 machine running on Intel i5 processor, so I installed dependency libqhull7_2015.2-2_amd64.deb first, and then updated qhull with libqhull-dev_2015.2-2_amd64.deb.

Finally, I ran pip3 install matplotlib and the error went away.

@eric-wieser
Copy link
Contributor Author

Still seems strange for matplotlib to bundle qhull, yet not use it when it needs to

@anntzer
Copy link
Contributor

anntzer commented Oct 19, 2017

see #8390 (comment) for the rationale (which I definitely agree is not very strong).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants