Sage 7.1 Windows 8.1 Cygwin make error

262 views
Skip to first unread message

Witold Żarowski

unread,
Mar 26, 2016, 10:06:19 AM3/26/16
to sage-devel
I'm trying to install Sage on Windows 8.1/Cygwin.
I'm getting the following error after make command (found in mpfr-3.1.4.log):
===============================
In file included from exceptions.c:23:0:
mpfr-impl.h:261:4: error: #error "__unix__ is defined and __GMP_LIBGMP_DLL is true"
 #  error "__unix__ is defined and __GMP_LIBGMP_DLL is true"
    ^
mpfr-impl.h:264:4: error: #error "Both __unix__ and MPFR_WIN_THREAD_SAFE_DLL are defined"
 #  error "Both __unix__ and MPFR_WIN_THREAD_SAFE_DLL are defined"
    ^
===============================

Dima Pasechnik

unread,
Mar 26, 2016, 12:36:02 PM3/26/16
to sage-devel
apparently mpfr needs a cygwin-specific patch:
and it seems that Sage does not contain it.

(Sage/cygwin used to work, with an older mpfr, but then an update was done, without any cygwin-specific patches...)

Witold Żarowski

unread,
Mar 26, 2016, 1:10:41 PM3/26/16
to sage-devel

On Saturday, March 26, 2016 at 5:36:02 PM UTC+1, Dima Pasechnik wrote:
apparently mpfr needs a cygwin-specific patch:
and it seems that Sage does not contain it.

I see.
But what should I do exactly to make Sage compile?

Erik Bray

unread,
Mar 29, 2016, 5:12:52 AM3/29/16
to sage-...@googlegroups.com
Technically, you'll need to download the Cygwin package for mpfr,
extract it, then take the patch that Dima linked to into and copy it
into build/pkgs/mpfr/patches (which would have to be created). It was
actually removed relatively recently in
http://git.sagemath.org/sage.git/commit/?id=5e534dcda6ad0b803d5db6b115cc4445721d231a
since the only patch that we did have for mpfr was taken out. So you
would have to modify the spkg-install script in build/pkgs/mpfr to
apply this patch (preferably only when building on Cygwin?).

It looks like a ticket hasn't been made for this yet either, though
there should be. I can try to work in this since I'm working on
building sage in Cygwin anyways.

Witold Żarowski

unread,
Mar 29, 2016, 1:49:27 PM3/29/16
to sage-devel
Thanks. I could theoretically do it, if I only knew
1) where to get the Cygwin package for mpfr from and
2) how exactly to change the spkg-install script.

Dima Pasechnik

unread,
Mar 29, 2016, 2:41:47 PM3/29/16
to sage-devel


On Tuesday, March 29, 2016 at 6:49:27 PM UTC+1, Witold Żarowski wrote:
Thanks. I could theoretically do it, if I only knew
1) where to get the Cygwin package for mpfr from and

probably you need this 2-line patch:
(this is perhaps not quite the same as the "proper" cygwin patch - MSYS2 is a fork of Cygwin, 
which is sort of more developer-friendly --- perhaps we should consider switching to it)
 
2) how exactly to change the spkg-install script.
look for examples in directories of other packages.
Usually you put the patch into patches/ directory in build/pkgs/mpfr/
and call patch with appropriate parameters in spkg-install.


Witold Żarowski

unread,
Mar 30, 2016, 1:15:14 PM3/30/16
to sage-devel
I can confirm that I was able to compile mprf using the patch you provided.
Then ATLAS was compiling for ages, and after that another error occurred, this time compiling brial:
========================================
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../libpolybori/include/polybori -I../../groebner/include -I../../libpolybori/include -std=c++98 -ftemplate-depth-100 -g -O2 -MT BlockDegLexOrder.lo -MD -MP -MF .deps/BlockDegLexOrder.Tpo -c BlockDegLexOrder.cc  -DDLL_EXPORT -DPIC -o .libs/BlockDegLexOrder.o
In file included from ../../libpolybori/include/polybori/cudd/../../../../Cudd/cudd/cudd.h:90:0,
                 from ../../libpolybori/include/polybori/cudd/cudd.h:20,
                 from ../../libpolybori/include/polybori/pbori_defs.h:27,
                 from ../../libpolybori/include/polybori/BlockDegLexOrder.h:19,
                 from BlockDegLexOrder.cc:18:
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdio:175:11: error: '::snprintf' has not been declared
   using ::snprintf;
           ^
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include/c++/cstdio:176:11: error: '::vfscanf' has not been declared
   using ::vfscanf;
           ^
========================================

Erik Bray

unread,
Mar 31, 2016, 8:56:32 AM3/31/16
to sage-...@googlegroups.com
On Tue, Mar 29, 2016 at 8:41 PM, Dima Pasechnik <dim...@gmail.com> wrote:
>
>
> On Tuesday, March 29, 2016 at 6:49:27 PM UTC+1, Witold Żarowski wrote:
>>
>> Thanks. I could theoretically do it, if I only knew
>> 1) where to get the Cygwin package for mpfr from and
>
>
> probably you need this 2-line patch:
> https://github.com/Alexpux/MSYS2-packages/blob/master/mpfr/mpfr-3.1.4-1.src.patch
> (this is perhaps not quite the same as the "proper" cygwin patch - MSYS2 is
> a fork of Cygwin,
> which is sort of more developer-friendly --- perhaps we should consider
> switching to it)

I'm working on that ;)

alexander.s...@googlemail.com

unread,
Apr 5, 2016, 2:56:01 AM4/5/16
to sage-devel
I faced the same error, which appears to be caused by gcc-5.3.0. After downgrading to gcc-4.9.3, brial compiled successfully.
I am now stuck with a segmentation fault related to doc-html.
dochtml.log

Dima Pasechnik

unread,
Apr 5, 2016, 4:32:06 AM4/5/16
to sage-devel


On Tuesday, April 5, 2016 at 7:56:01 AM UTC+1, alexander.s...@googlemail.com wrote:
I faced the same error, which appears to be caused by gcc-5.3.0. After downgrading to gcc-4.9.3, brial compiled successfully.
I am now stuck with a segmentation fault related to doc-html.
It seems to crash on 
"Setting permissions of DOT_SAGE directory so only you can read and write it."

do you have your home directory in an unusual location/with unusual permissions?
(cygwin is not known to be 100% compatible in this sense, e.g. on Samba shares things
can go funny, etc...)

Francesco Biscani

unread,
Apr 5, 2016, 4:38:24 AM4/5/16
to sage-...@googlegroups.com
On 29 March 2016 at 20:41, Dima Pasechnik <dim...@gmail.com> wrote:
(this is perhaps not quite the same as the "proper" cygwin patch - MSYS2 is a fork of Cygwin, 
which is sort of more developer-friendly --- perhaps we should consider switching to it)

As far as I know MSYS2  is not a fork of cygwin, it is a native mingw toolchain + plus a bunch of natively-compiled packages managed by the package manager of Arch linux, called pacman.

Dima Pasechnik

unread,
Apr 5, 2016, 4:59:14 AM4/5/16
to sage-devel

alexander.s...@googlemail.com

unread,
Apr 5, 2016, 5:39:24 AM4/5/16
to sage-devel
My home directory is in C:\cygwin64. Permission were mixed up, but after restoring them the error persists.
Although sage is no longer complaining about DOT_SAGE permissions.
dochtml.log

Dima Pasechnik

unread,
Apr 5, 2016, 5:50:01 AM4/5/16
to sage-devel
Does Sage start for you?

alexander.s...@googlemail.com

unread,
Apr 5, 2016, 5:53:28 AM4/5/16
to sage-devel
No, start-up fails with a related(?) seg fault.
Sage_crash_report.txt

Francesco Biscani

unread,
Apr 5, 2016, 6:03:09 AM4/5/16
to sage-...@googlegroups.com
On 5 April 2016 at 10:59, Dima Pasechnik <dim...@gmail.com> wrote:

I did not know that msys2 also had a cygwin toolchain. But then, I don't want to touch cygwin with a barge pole so that's hardly surprising :) 

alexander.s...@googlemail.com

unread,
Apr 7, 2016, 5:51:37 AM4/7/16
to sage-devel
The failure looks similar to http://trac.sagemath.org/ticket/11551. Any help would be appreciated :)

Erik Bray

unread,
Apr 7, 2016, 9:00:04 AM4/7/16
to sage-...@googlegroups.com
On Tue, Apr 5, 2016 at 8:53 AM, alexander.stottmeister via sage-devel
<sage-...@googlegroups.com> wrote:
> I faced the same error, which appears to be caused by gcc-5.3.0. After
> downgrading to gcc-4.9.3, brial compiled successfully.
> I am now stuck with a segmentation fault related to doc-html.

I'm starting to work on Cygwin builds now myself. I've gone ahead and
created a ticket + patch for the MPFR issue:

http://trac.sagemath.org/ticket/20380

Now I've hit the same issue with brial. Downgrading gcc is not a
solution as far as I'm concerned so I'll see if I can understand this
issue and find out what's going on. No idea yet about doc-html.
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages