Sage 9.1 build fails on cygwin due to lack of xlocale.h in the new cygwin-devel package

85 views
Skip to first unread message

ilyub

unread,
May 27, 2020, 5:39:30 PM5/27/20
to sage-support
(Cygwin 64: cygwin-devel package version: 3.1.4-1 | SageMath version 9.1, Release Date: 2020-05-20)

Building Sage fails when compiling numpy with "fatal error: xlocale.h: No such file or directory".

I was able to complete the build after copying xlocale.h from the old cgwyn-devel package (version 3.0.7-1 still contains it) to /usr/include/.

Can an environment variable be set for build not to look for xlocale.h and use locale.h instead?

Dima Pasechnik

unread,
May 27, 2020, 8:37:11 PM5/27/20
to sage-support
On Wed, May 27, 2020 at 10:39 PM ilyub <ilyub...@gmail.com> wrote:
>
> (Cygwin 64: cygwin-devel package version: 3.1.4-1 | SageMath version 9.1, Release Date: 2020-05-20)
>
> Building Sage fails when compiling numpy with "fatal error: xlocale.h: No such file or directory".

We used to have a patch for this: https://trac.sagemath.org/ticket/22049
but it was removed, and we are able to build Sage on recent cygwins.

Should it be put back again (it probably needs a rebase for the
version of numpy we use)?


>
> I was able to complete the build after copying xlocale.h from the old cgwyn-devel package (version 3.0.7-1 still contains it) to /usr/include/.
>
> Can an environment variable be set for build not to look for xlocale.h and use locale.h instead?
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/96243366-3667-4d9c-9332-e2aed2cd528c%40googlegroups.com.

ilyub

unread,
May 27, 2020, 8:56:44 PM5/27/20
to sage-support
Yes please put it back, so it can build on latest cygwin

Dima Pasechnik

unread,
May 28, 2020, 3:35:39 AM5/28/20
to sage-support
On Thu, May 28, 2020 at 1:56 AM ilyub <ilyub...@gmail.com> wrote:
>
> Yes please put it back, so it can build on latest cygwin

It should be back in cygwin soon, see
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=90e35b1eb3df4070e68afc5e7060665214d586be
https://sourceware.org/pipermail/cygwin-cvs/2017q1/013271.html
(Rename <sys/_locale.h> to <xlocale.h>)

(it's not in cygwin 3.1.4-1, which was released in Feb 2020, whereas
that fix was committed in March)
I presume you can just patch your cygwin with it.
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/3f45394e-5cd8-47db-a958-93ce8287c64b%40googlegroups.com.

ilyub

unread,
May 28, 2020, 10:07:20 AM5/28/20
to sage-support

Sorry, unless I'm missing something - the links below are for changes committed in March 2017, and are not fixing the problem.  I think the change we need is to include xlocale.h in the next Cygwin-devel package.  Unless there was another change to Cygwin in March this year?


On Thursday, May 28, 2020 at 3:35:39 AM UTC-4, Dima Pasechnik wrote:
On Thu, May 28, 2020 at 1:56 AM ilyub <ilyub...@gmail.com> wrote:
>
> Yes please put it back, so it can build on latest cygwin

It should be back in cygwin soon, see
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=90e35b1eb3df4070e68afc5e7060665214d586be
https://sourceware.org/pipermail/cygwin-cvs/2017q1/013271.html
(Rename <sys/_locale.h> to <xlocale.h>)

(it's not in  cygwin 3.1.4-1, which was released in Feb 2020, whereas
that fix was committed in March)
I presume you can just patch your cygwin with it.






>
> On Wednesday, May 27, 2020 at 5:39:30 PM UTC-4, ilyub wrote:
>>
>> (Cygwin 64: cygwin-devel package version: 3.1.4-1 | SageMath version 9.1, Release Date: 2020-05-20)
>>
>> Building Sage fails when compiling numpy with "fatal error: xlocale.h: No such file or directory".
>>
>> I was able to complete the build after copying xlocale.h from the old cgwyn-devel package (version 3.0.7-1 still contains it) to /usr/include/.
>>
>> Can an environment variable be set for build not to look for xlocale.h and use locale.h instead?
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.

Dima Pasechnik

unread,
May 28, 2020, 10:15:25 AM5/28/20
to sage-support
you are right, I messed up the year.
Does it mean Cygwin people removed this change for some reason later on?
Weird.

To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/2229b43f-a558-4fda-b813-123ca3670b2e%40googlegroups.com.

ilyub

unread,
May 28, 2020, 10:21:35 AM5/28/20
to sage-support
The cygwin people seemed to have removed the physical file (xlocale.h) from the cygwin distribution starting with version 3.1.1-1   https://cygwin.com/packages/summary/cygwin-devel.html.
Because the include file is missing, sage build fails because the numpy module has an include of xlocale.h .

Matthias Koeppe

unread,
May 28, 2020, 2:10:39 PM5/28/20
to sage-support
On Thursday, May 28, 2020 at 7:21:35 AM UTC-7, ilyub wrote:
The cygwin people seemed to have removed the physical file (xlocale.h) from the cygwin distribution starting with version 3.1.1-1   https://cygwin.com/packages/summary/cygwin-devel.html.
Because the include file is missing, sage build fails because the numpy module has an include of xlocale.h .


Is upstream numpy aware of this issue?
 

Dima Pasechnik

unread,
May 28, 2020, 5:13:30 PM5/28/20
to sage-support
It has been done and dusted in numpy:
https://github.com/numpy/numpy/pull/8367

they took Sage's patch from embray, and then Sage's patch was removed.
I have no idea why this pops up again.
Please post the logs.


>
>
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/c3fdd81b-e6a4-4f1f-94e9-088a6d803491%40googlegroups.com.

Matthias Koeppe

unread,
May 29, 2020, 1:38:39 PM5/29/20
to sage-support


On Thursday, May 28, 2020 at 2:13:30 PM UTC-7, Dima Pasechnik wrote:
On Thu, May 28, 2020 at 7:10 PM Matthias Koeppe
<matthia...@gmail.com> wrote:
>
> On Thursday, May 28, 2020 at 7:21:35 AM UTC-7, ilyub wrote:
>>
>> The cygwin people seemed to have removed the physical file (xlocale.h) from the cygwin distribution starting with version 3.1.1-1   https://cygwin.com/packages/summary/cygwin-devel.html.
>> Because the include file is missing, sage build fails because the numpy module has an include of xlocale.h .
>>>>
>>>>
>
> Is upstream numpy aware of this issue?

It has been done and dusted in numpy:
https://github.com/numpy/numpy/pull/8367

they took Sage's patch from embray, and then Sage's patch was removed.
I have no idea why this pops up again.
Please post the logs.


Indeed we need to see the logs to know what is happening on the reporter's machine.

Numpy within Sage 9.1 builds just fine on current Cygwin (with 3.1.4) -- see https://github.com/sagemath/sage/runs/694846429?check_suite_focus=true


ilyub

unread,
May 29, 2020, 11:54:13 PM5/29/20
to sage-support
Attached is the log.  There are two fatal errors there: one is:
[numpy-1.16.6_configtest.c:1:10: fatal error: xlocale.h: No such file or directory
[numpy-1.16.6]     1 | #include <xlocale.h>
[numpy-1.16.6]       |          ^~~~~~~~~~~
[numpy-1.16.6] compilation terminated.
install.log

Dima Pasechnik

unread,
May 30, 2020, 4:07:58 AM5/30/20
to sage-support
Note that Numpy 1.16.6 has in numpy/core/setup_common.py
xlocale.h listed in

OPTIONAL_HEADERS = [
# sse headers only enabled automatically on amd64/x32 builds
"xmmintrin.h", # SSE
"emmintrin.h", # SSE2
"features.h", # for glibc version linux
"xlocale.h", # see GH#8367
"dlfcn.h", # dladdr
"sys/mman.h", #madvise
]

(and the xlocale.h entry there is commented pointing at the GitHub
issue I mentioned)
I imagine that OPTIONAL_HEADERS are meant to be optional, absence of
any of them should not
create a problem.
E.g. on Debian 10 there is no xlocale.h, but Numpy builds just fine.

I'd say it's an upstream bug/feature, not Sage's bug - but I'd be glad
to be proved wrong.
It appears one needs to debug this on cygwin, so that's your turn...

HTH
Dima
> --
> You received this message because you are subscribed to the Google Groups "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/f9d09f43-d327-4c78-bac4-b705848d74c4%40googlegroups.com.

Dima Pasechnik

unread,
May 30, 2020, 5:45:18 AM5/30/20
to sage-support
I looked in the log you posted and noticed that the build of Numpy
actually succeeds, despite showing an error about xlocale.h not found.
So this error was ignored, as expected.
It's actually pretty common that a configuration script tests things
and shows errors, only to ignore them - that's by design.

HTH
Dima

ilyub

unread,
May 30, 2020, 10:34:37 AM5/30/20
to sage-support
You are right, my sage build failed for other reasons after all.  I think there was a clash with my python environment on Windows.  I resolved it by creating symbolic links python3->/usr/bin/python3.7.  I also copied xlocale.h locally and the error went away and masked the original problem.  Thanks for your help.
Ilya
> > To unsubscribe from this group and stop receiving emails from it, send an email to sage-s...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages