Repository navigation
Closed
Labels
Description
Hello all, I have an intel-compiled version of Python 2.7.8 that I'm trying to build and install Matplotlib into. When I run "python setup.py build" everything builds fine until:
icc -pthread -fno-strict-aliasing -O3 -fPIC -fp-model strict -fomit-frame-pointer -DNDEBUG -g -O3 -Wall -fPIC -DMPL_DEVNULL=/dev/null -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__qhull_ARRAY_API -DNPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION -I/usr/local/python2/2.7.8/x86_64/intel14/nonet/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -Iextern -I/usr/local/python2/2.7.8/x86_64/intel14/nonet/include/python2.7 -c src/qhull_wrap.c -o build/temp.linux-x86_64-2.7/src/qhull_wrap.o
In file included from src/qhull_wrap.c(10):
extern/qhull/qhull_a.h(106): warning #77: this declaration has no storage class or type specifier
template <typename T>
^
In file included from src/qhull_wrap.c(10):
extern/qhull/qhull_a.h(106): error: expected a ";"
template <typename T>
^
In file included from src/qhull_wrap.c(10):
extern/qhull/qhull_a.h(115): warning #12: parsing restarts here after previous syntax error
void qh_qhull(void);
^
compilation aborted for src/qhull_wrap.c (code 2)
error: command 'icc' failed with exit status 2The issue here is that icc does not support templates. When I manually run this command with icpc rather than icc it compiles fine. Can someone advise me on how I can go about switching to icpc to compile qhull_wrap.c? I'm also happy to submit a pull request if this is something that can be generalized in the build process. Version info listed below.
[frenchwr@vmps11 matplotlib]$ uname -a
Linux vmps11 2.6.32-358.14.1.el6.x86_64 #1 SMP Tue Jul 16 23:51:20 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux[frenchwr@vmps11 matplotlib]$ lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final[frenchwr@vmps11 matplotlib]$ python --version
Python 2.7.8[frenchwr@vmps11 matplotlib]$ icc --version
icc (ICC) 14.0.2 20140120
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.[frenchwr@vmps11 matplotlib]$ pip freeze
biopython==1.65
Cython==0.22
mock==1.0.1
nose==1.3.4
numpy==1.9.1
pandas==0.15.2
pyparsing==2.0.3
python-dateutil==2.4.0
pytz==2014.10
scikit-learn==0.15.2
scipy==0.15.1
seaborn==0.4.dev0
six==1.9.0
word-count==0.1.0[frenchwr@vmps11 matplotlib]$ git describe
v1.4.3-1743-ga951b75
Activity
tacaswell commentedon Jun 12, 2015
Taking a quick look at
setupext.pyit looks like we outsource this work todistutils(and maybe specificallydistutils.sysconfig?). I suspect we are using it wrong and relying on gcc 'just working' if you throw c++ at it which we should fix, but that involves touching the build system which is a terrifying prospect.I think you can get it to behave by doing
which gives me output like
which correctly fails as I don't have the intel compilers installed.
Hope some of that is helpful!
WeatherGod commentedon Jun 12, 2015
I think you can do
python setup.py build --compiler icpcor something tothe effect?
On Fri, Jun 12, 2015 at 12:22 PM, Will French notifications@github.com
wrote:
frenchwr commentedon Jun 12, 2015
When I use
CC=icpc python setup.py buildthe build makes a bit more progress but eventually bombs out with:This looks like the opposite problem as before, i.e. the C++ compiler is having trouble with C code. I then tried
CC=icc CXX=icpc python setup.py buildwhich triggers the original error. It does appear that in this case both icc and icpc are invoked, but it looks somewhat random...C files are occasionally compiled with icpc, C++ files occasionally compiled with icc, so I don't know what to make of that.I suspect there is a flag I can pass either icc to give it better C++ support, or icpc to give it better C support. I'll keep poking around.
tacaswell commentedon Jun 12, 2015
https://mail.python.org/pipermail/python-dev/2012-March/117219.html <- is
that helpful at all? I suspect you may get better help upstream talking to
either the numpy/scipy folks or the distutils folks.
Do you have similar issues compiling numpy/scipy/scikit-image ?
On Fri, Jun 12, 2015 at 3:37 PM Will French notifications@github.com
wrote:
frenchwr commentedon Jun 12, 2015
Yes I battled with numpy for quite some time before getting it to build and pass all tests, but what I learned there does not help much in this case. I explored the use of different compiler flag options for both icc and icpc but I could not manage to get the matplotlib build to succeed.
In the end, I decided to modify a few lines of code to remove Intel preprocessors and the template definition that triggered the original error. The build succeeded and no additional unit test errors or failures were introduced.
See PR here: #4519
CLN: explicitly cast (void *) -> (char *)
tacaswell commentedon Jun 14, 2015
Reading this again, it looks like the errors you are getting from the
icpcare finding sloppyness in our c code. See #4524tacaswell commentedon Jun 19, 2015
This has been fixed two different ways, closing.