2

I was trying to build numpy on Cygwin, but I got a error with xlocale.h which is defined in X11/xlocale.h. My naive patch was to add this:

#ifdef __CYGWIN__ 
   #include "X11/Xlocale.h"
#else
   #include "xlocale.h"
#endif

Alternatively I could have added -I/usr/include/X11 to the Makefile, but there is no Makefiles in setuptools and I am trying to understand how it works.

When I type python setup.py build_ext how Python builds the extensions?

nowox
  • 25,978
  • 39
  • 143
  • 293
  • I doubt `xlocale.h` is the same of `X11/Xlocale.h`. Moreover numpy is already available on cygwin as `python-numpy` and `python3-numpy` depending on python version. Check on the source cygwin package to look for the installation script (cygport). – matzeri Oct 17 '16 at 06:01
  • Yeah, it's available, but it's not the latest version, and the latest version does not build – nowox Oct 17 '16 at 06:04
  • Have you looked on the build script for hint ? – matzeri Oct 18 '16 at 07:53
  • Which one? The `setup.py`, yes indeed. – nowox Oct 18 '16 at 07:54

1 Answers1

2

I know my solution is not good, but I ended up doing this:

cd /usr/include
ln -s locale.h xlocale.h

Before running:

pip3 install --user -U numpy 

And it worked.

I removed the link after pip finiched installing the package.

fjardon
  • 7,921
  • 22
  • 31