Error building Sage 9.6 on Cygwin

130 views
Skip to first unread message

Lucas Tan

unread,
Jul 20, 2022, 5:12:49 AM7/20/22
to sage-devel
Good day, 

I have encountered an error when building Sage 9.6 on the Cygwin Terminal. I am very new to Sage and am unfamiliar with debugging methods. 

It seems that Python3 could not be built, I suppose. I have attached the relevant .log files. 
My computer is running on "Windows 10 Home 64-bit (10.0, Build 19044)", a Lenovo Yoga Slim 7 Pro 14ACH5, with Processor: "AMD Ryzen 7 5800H with Radeon Graphics (16 CPUs), ~3.2GHz. 

Your assistance is greatly appreciated. Thank you. 

Yours sincerely, 
Lucas Tan
config.log
python3-3.10.3.log

Dima Pasechnik

unread,
Jul 20, 2022, 5:40:29 AM7/20/22
to sage-devel
On Wed, Jul 20, 2022 at 10:12 AM Lucas Tan <lucas....@gmail.com> wrote:
>
> Good day,
>
> I have encountered an error when building Sage 9.6 on the Cygwin Terminal. I am very new to Sage and am unfamiliar with debugging methods.
>
> It seems that Python3 could not be built, I suppose. I have attached the relevant .log files.

please check out the list of Cygwin packages recommended for
installation, printed at the end of
./configure
run, and follow it.

Cygwin is very tricky to support (we actually recommend that on
Windows people install/use Sage with WSL (WSL2, to be precise), not
Cygwin)

> My computer is running on "Windows 10 Home 64-bit (10.0, Build 19044)", a Lenovo Yoga Slim 7 Pro 14ACH5, with Processor: "AMD Ryzen 7 5800H with Radeon Graphics (16 CPUs), ~3.2GHz.
>
> Your assistance is greatly appreciated. Thank you.
>
> Yours sincerely,
> Lucas Tan
>
> --
> 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 view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/aa905e46-7e7b-491b-a89b-2e5fd17e5f17n%40googlegroups.com.

Lucas Tan

unread,
Jul 20, 2022, 6:28:32 AM7/20/22
to sage-devel
Hi, 

Thank you. 

I have now installed all the packages recommended ./configure
Do I run "make" again?

(I have decided to use Cygwin as I hope to (1) add Sage to PATH, (2) use as a kernel/interpreter in VSCode, and (3) to later upload some .sage files from VSCode to Github)

Sincerely, 
Lucas

Dima Pasechnik

unread,
Jul 20, 2022, 6:42:51 AM7/20/22
to sage-devel


On Wed, 20 Jul 2022, 11:28 Lucas Tan, <lucas....@gmail.com> wrote:
Hi, 

Thank you. 

I have now installed all the packages recommended ./configure
Do I run "make" again?

of course

Dima Pasechnik

unread,
Jul 20, 2022, 6:45:40 AM7/20/22
to sage-devel
On Wed, 20 Jul 2022, 11:28 Lucas Tan, <lucas....@gmail.com> wrote:
Hi, 

Thank you. 

I have now installed all the packages recommended ./configure
Do I run "make" again?

(I have decided to use Cygwin as I hope to (1) add Sage to PATH, (2) use as a kernel/interpreter in VSCode, and (3) to later upload some .sage files from VSCode to Github)

2) VSCode on Windows has ability to use remote kernels, including ones on its WSL.

1) Adding Sage to Windows PATH?
Not sure this will fly.

3) can be done with WSL, sure

Lucas Tan

unread,
Jul 20, 2022, 11:59:08 AM7/20/22
to sage-devel
Hi, 

I have installed all the files that I could and ran "make". 
I could not install some files, the error returned was "Unable to locate package NAME", example NAME= openblas

The Python package could still not be built, particularly python3-SAGE_VENV-no-deps

I have attached the updated logs as well. 

Thank you, 
Lucas
python3-3.10.3.log
config.log

Matthias Koeppe

unread,
Jul 20, 2022, 12:06:17 PM7/20/22
to sage-devel
From config.log:
## -------------------------------------------------------- ## 
## Checking whether SageMath should install SPKG python3... ## 
## -------------------------------------------------------- ## 
configure:32387: checking whether any of bzip2 liblzma libffi is installed as or will be installed as SPKG 
configure:32391: result: yes; install python3 as well

This is from a prior run of "make" before you installed the system (Cygwin) packages.
To fix this, use "make bzip2-clean liblzma-clean libffi-clean"

Dima Pasechnik

unread,
Jul 20, 2022, 12:23:11 PM7/20/22
to sage-devel
do you have the corr. Cygwin packages (e.g. openblas) installed?

Do you run make in a native shell, rather than a cygwin shell?

Dima Pasechnik

unread,
Jul 20, 2022, 12:25:07 PM7/20/22
to sage-devel
and once you have the needed python3 packages installed, you don't need to build python3 from source anymore.

John H Palmieri

unread,
Jul 20, 2022, 2:02:29 PM7/20/22
to sage-devel
I don't think anyone has said this explicitly: after installing the packages recommended by ./configure, then you need to run ./configure again. Then run make.

Lucas Tan

unread,
Jul 20, 2022, 10:26:06 PM7/20/22
to sage-devel

Thank you Matthias and Dima, 

I am still unable to build Sage. 
This is the error I received is pasted at the end of this message text. 

To Matthias: 
I ran "make" again after running the command you provided. The error below still occurred. 

To Dima: 
I am using the Cygwin shell. 
I could not install several packages using "apt-cyg". Some packages could not be found, and some packages are not of the same build or version (e.g. apt-cyg install python3 -> python 3.9, not python 3.10 as used by "make"). 
Here is the full list of packages that I could not "apt-cyg install": (I also ran the 2 install command provided by the hints)
```
configure:

    notice: the following SPKGs did not find equivalent system packages:

        appdirs arb distlib eclib fflas_ffpack filelock giac gsl iml linbox openblas python3 r singular suitesparse sympow toml tox virtualenv   4ti2 cbc coxeter3 ffmpeg gp2c igraph isl libgraphviz libnauty libsemigroups lrslib pandoc pari_elldata pari_galpol pari_nftables pari_seadata pdf2svg perl_cpan_polymake_prereq perl_mongodb polymake _recommended texlive

checking for the package system in use... cygwin
configure:

    hint: installing the following system packages, if not
    already present, is recommended and may avoid having to
    build them (though some may have to be built anyway):

    first install apt-cyg from https://github.com/transcode-open/apt-cyg
      $ apt-cyg install libgsl-devel liblapack-devel libopenblas python39-devel R libtirpc-devel singular-devel singular libsuitesparseconfig-devel

configure:

    hint: installing the following system packages, if not
    already present, may provide additional optional features:

    first install apt-cyg from https://github.com/transcode-open/apt-cyg
      $ apt-cyg install lib4ti2_0 lib4ti2-devel libisl-devel graphviz texlive

configure:

    hint: After installation, re-run configure using:

      $ ./config.status --recheck && ./config.status
```


ERROR MESSAGE: 
```
make[4]: *** [Makefile:2793: python3-SAGE_VENV-no-deps] Error 1
make[3]: *** [Makefile:2793: /home/Lucas/sage/sage-9.6/local/var/lib/sage/venv-python3.10.3/var/lib/sage/installed/python3-3.10.3] Error 2
make[2]: *** [Makefile:2497: all-start] Error 2
make[2]: Leaving directory '/home/Lucas/sage/sage-9.6/build/make'


real    18m29.595s
user    9m34.791s
sys     7m56.507s
***************************************************************
Error building Sage.

The following package(s) may have failed to build (not necessarily
during this run of 'make all-start'):

* package:         python3-3.10.3
  last build time: Jul 21 08:52
  log file:        /home/Lucas/sage/sage-9.6/logs/pkgs/python3-3.10.3.log

It is safe to delete any log files and build directories, but they
contain information that is helpful for debugging build problems.
WARNING: If you now run 'make' again, the build directory of the
same version of the package will, by default, be deleted. Set the
environment variable SAGE_KEEP_BUILT_SPKGS=yes to prevent this.

make[1]: *** [Makefile:39: all-start] Error 1
make[1]: Leaving directory '/home/Lucas/sage/sage-9.6'
make: *** [Makefile:13: all] Error 2
```


config.log
python3-3.10.3.log

Matthias Koeppe

unread,
Jul 20, 2022, 10:34:41 PM7/20/22
to sage-devel
On Wednesday, July 20, 2022 at 7:26:06 PM UTC-7 lucas....@gmail.com wrote:

I could not install several packages using "apt-cyg". Some packages could not be found, and some packages are not of the same build or version (e.g. apt-cyg install python3 -> python 3.9, not python 3.10 as used by "make"). 

That's normal. There's no python 3.10 for Cygwin. Use Cygwin's python 3.9 package.



Lucas Tan

unread,
Jul 20, 2022, 11:05:47 PM7/20/22
to sage-devel
Hi Matthias, 

I keep receiving the error: package: python3-3.10.3 failed to build. 
How do I restrict "make" to python 3.9?

Sincerely, 
Lucas

Matthias Koeppe

unread,
Jul 20, 2022, 11:08:50 PM7/20/22
to sage-devel
Did you install the cygwin python3.9 packages?

Matthias Koeppe

unread,
Jul 20, 2022, 11:11:29 PM7/20/22
to sage-devel
Your config.log is still saying:
## -------------------------------------------------------- ## #
# Checking whether SageMath should install SPKG python3... ## #
# -------------------------------------------------------- ## 
configure:32387: checking whether any of bzip2 liblzma libffi is installed as or will be installed as SPKG c
configure:32391: result: yes; install python3 as well


You need to uninstall these packages:
make bzip2-clean liblzma-clean libffi-clean xz-clean

Lucas Tan

unread,
Jul 20, 2022, 11:11:42 PM7/20/22
to sage-devel
Hi Matthias, 

I would believe so. 
```
$ apt-cyg install python39
Package python39 is already installed, skipping

$ apt-cyg install python3
Package python3 is already installed, skipping
```

Lucas Tan

unread,
Jul 21, 2022, 12:47:16 AM7/21/22
to sage-devel
Hi Matthias, 

I ran  "make bzip2-clean liblzma-clean libffi-clean xz-clean" twice to ensure that the files are removed. 
I check for the following message: "No legacy uninstaller found for 'xz'; nothing to do", for all files. 
I have also ensured that I have python3.9 installed with "python3 --version"
After running the above, I run "./configure" once more as suggested by John H Palmieri above. 

I'm not sure if this is relevant, but I noticed these messages when running "make": 
(first line of xz) 
[xz-5.2.5] Using cached file /home/Lucas/sage/sage-9.6/upstream/xz-5.2.5.tar.gz
[xz-5.2.5] xz-5.2.5
[xz-5.2.5] ====================================================
[xz-5.2.5] Setting up build directory for xz-5.2.5
[xz-5.2.5] Finished extraction
(similarly for libffi, the cached file is used)

(first line of python3)
[python3-3.10.3] Using cached file /home/Lucas/sage/sage-9.6/upstream/Python-3.10.3.tar.xz
[python3-3.10.3] python3-3.10.3
[python3-3.10.3] ====================================================
[python3-3.10.3] Setting up build directory for python3-3.10.3
[python3-3.10.3] Finished extraction
(shortly later...)
[python3-3.10.3] Thread model: posix
[python3-3.10.3] Supported LTO compression algorithms: zlib zstd
[python3-3.10.3] gcc version 11.3.0 (GCC)
[python3-3.10.3] ****************************************************
[python3-3.10.3] Package 'python3' is currently not installed
[python3-3.10.3] Uninstalling 'python3' with legacy uninstaller
[python3-3.10.3] Cleaning out old python / python3 / python3 venv binaries
[python3-3.10.3] Configuring python3-3.10.3

Lucas Tan

unread,
Jul 21, 2022, 1:01:30 AM7/21/22
to sage-devel
Apologies, my log files are here
config.log
python3-3.10.3.log

Matthias Koeppe

unread,
Jul 21, 2022, 1:22:48 AM7/21/22
to sage-devel
Are these cygwin packages installed?  bzip2 libbz2-devel xz liblzma-devel 

Lucas Tan

unread,
Jul 21, 2022, 2:47:41 AM7/21/22
to sage-devel
Hi Matthias, 
Yes, they are. I have just uninstalled them via Cygwin setup. Should I uninstall libffi as well?

Matthias Koeppe

unread,
Jul 21, 2022, 3:12:29 AM7/21/22
to sage-devel
No, these system packages need to be installed. Otherwise you won't get Cygwin's python package accepted.

I recommend to start from scratch. Run configure, read what it recommends to install via Cygwin, do this installation, then run configure again.
Before running "make", verify that it accepts the Cygwin python3.

Lucas Tan

unread,
Jul 21, 2022, 3:37:08 AM7/21/22
to sage-devel
How do I verify that Cygwin python3 is accepted?

Matthias Koeppe

unread,
Jul 21, 2022, 3:45:57 AM7/21/22
to sage-devel
By reading the configure messages

Lucas Tan

unread,
Jul 21, 2022, 8:39:25 PM7/21/22
to sage-devel
Hi Matthias, 

I restarted the installation from scratch and verified that python3 has been accepted. This issue has been resolved, thank you. 
After running "make" for 10+  hours, a new error has occurred. I apologize for troubling you once more. 

The process [sagemath_doc_html-none] could not be completed. I have attached the relevant logs files below. 
As recommended by the error message, I ran the command "make doc-clean doc-uninstall" before trying "make" again. After 3 tries, the issue remains persistent. 

Thank you very, very much for your assistance. 

Sincerely, 
Lucas
sagemath_doc_html-none.log
config.log

Dima Pasechnik

unread,
Jul 21, 2022, 9:09:56 PM7/21/22
to sage-devel
your log appears to show that Singular was not built correctly.
Can you look at logs/pkg/singular*.log,
or just post it here?


--
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.

Lucas Tan

unread,
Jul 21, 2022, 9:11:19 PM7/21/22
to sage-devel
Sure, thanks Dima.
singular-4.2.1p3.log

Dima Pasechnik

unread,
Jul 22, 2022, 5:19:34 AM7/22/22
to sage-devel
Could you uninstall Cygwin's Singular package (which is too old to be used by Sage, but can still conflict with Sage's Singular)

and run

     make

again?

Lucas Tan

unread,
Jul 22, 2022, 5:46:31 AM7/22/22
to sage-devel
Do I run by "make singular-clean"?

Dima Pasechnik

unread,
Jul 22, 2022, 5:53:25 AM7/22/22
to sage-devel


On Fri, 22 Jul 2022, 10:46 Lucas Tan, <lucas....@gmail.com> wrote:
Do I run by "make singular-clean"?

no, no, I am talking about Cygwin package Singular. You'd need to use apt-cyg or whatever the Cygwin package manager is called.

Lucas Tan

unread,
Jul 22, 2022, 6:32:53 AM7/22/22
to sage-devel
There is both "singular" and "singular-devel", should I uninstall both?

Sincerely, 
Lucas

Dima Pasechnik

unread,
Jul 22, 2022, 6:34:44 AM7/22/22
to sage-devel

Lucas Tan

unread,
Jul 23, 2022, 9:09:24 PM7/23/22
to sage-devel
Hi Dima and Matthias, 

The build has failed again. I have attached the relevant logs. 
Thank you. 
sagemath_doc_html-none.log
config.log

Dima Pasechnik

unread,
Jul 24, 2022, 3:10:09 AM7/24/22
to sage-devel
Did you try clearing the docs?

   make doc-clean

as recommended by the builder,

and re-running make ?

Lucas Tan

unread,
Jul 24, 2022, 5:40:31 AM7/24/22
to sage-devel

Yes,I tried a few times. Each time I tried, I always run "make doc-clean doc-uninstall" first. 

Dima Pasechnik

unread,
Jul 24, 2022, 5:49:08 AM7/24/22
to sage-devel
It could be something obscure, Cygwin only.
Can you start Sage, can you run tests via
./sage -t <file name>?

Lucas Tan

unread,
Jul 24, 2022, 6:24:08 AM7/24/22
to sage-devel
Hi Dima, 

Thanks. Sage can be started. 
Is there no way to resolve or complete the build? 

Sincerely, 
Lucas

Dima Pasechnik

unread,
Jul 24, 2022, 6:32:04 AM7/24/22
to sage-devel


On Sun, 24 Jul 2022, 12:24 Lucas Tan, <lucas....@gmail.com> wrote:
Hi Dima, 

Thanks. Sage can be started. 
Is there no way to resolve or complete the build? 

not sure if it ever reliably worked on Cygwin, cf e.g. https://trac.sagemath.org/ticket/25089

Given that Cygwin isn't really supported by CPython, it's hard to expect that sphinx (the tool behind doc building) is tested and debugged there.

That's why I pointed you to WSL as a preferred solution.

John H Palmieri

unread,
Jul 24, 2022, 4:17:48 PM7/24/22
to sage-devel
I don't have any insights on how to fix this, but the error doesn't looks particularly specific to the documentation:

Traceback (most recent call last): File "sage/libs/singular/function.pyx", line 1814
...
NameError: Singular kernel function 'freeAlgebra' is not defined

Lucas Tan

unread,
Jul 25, 2022, 12:50:09 PM7/25/22
to sage-devel
Thanks all. I will simply leave the error unsolved. Thank you for your time. 

Sincerely, 
Lucas
Reply all
Reply to author
Forward
0 new messages