INSTALL.CYGWIN

46 views
Skip to first unread message

Qian Yun

unread,
Mar 10, 2021, 11:09:30 AM3/10/21
to fricas...@googlegroups.com
I was trying to make INSTALL.CYGWIN up to date.

One serious problem occurs:

The cygwin version of clisp contains a patch from March 2015
that says "Don't allow saving executable memory images on Cygwin".

Don't know why cygwin developer choose to apply this,
but it effectively makes building FriCAS on Cygwin more
difficult.

The problem is, shall we still support Cygwin at all?

(Clearly, no one have built FriCAS successful on Cygwin
with Clisp for the past 6 years.)

Advantages:

1. Cygwin can have HyperDoc with X11.
2. Clisp is packaged by Cygwin. But this advantage is gone now.

Disadvantages:

1. Clisp on Cygwin is slow, and not have a release for years.
2. Cygwin is not as portable as msys2/mingw64.


So, if we choose to support Cygwin, we may need to use ecl, ccl,
or a unmodified clisp.

- Qian

Dima Pasechnik

unread,
Mar 10, 2021, 11:25:01 AM3/10/21
to fricas...@googlegroups.com
ecl is actively developed, and works on Cygwin (as well as on "native" Windows)

>
> - Qian
>
> --
> You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/fricas-devel/8765c74e-7b93-b05d-4b76-73e869d653dd%40gmail.com.

Waldek Hebisch

unread,
Mar 10, 2021, 1:56:46 PM3/10/21
to fricas...@googlegroups.com
On Thu, Mar 11, 2021 at 12:09:18AM +0800, Qian Yun wrote:
> I was trying to make INSTALL.CYGWIN up to date.
>
> One serious problem occurs:
>
> The cygwin version of clisp contains a patch from March 2015
> that says "Don't allow saving executable memory images on Cygwin".
>
> Don't know why cygwin developer choose to apply this,
> but it effectively makes building FriCAS on Cygwin more
> difficult.
>
> The problem is, shall we still support Cygwin at all?

If we can.

> (Clearly, no one have built FriCAS successful on Cygwin
> with Clisp for the past 6 years.)

I would drop support for _clisp_ on Cygwin. IIRC during
initial Cygwin port clisp was the only free Lisp running on
Cygwin. And in practice the only free Lisp on Windows,
as theoreticaly one could use GCL, but in practice building
GCL dependend on exactly matching rather specific configuration
of obsolete software.

> Advantages:
>
> 1. Cygwin can have HyperDoc with X11.

Yes, that is important advantage.

Let me add another point:

1a. Cygwin may be prefered by Unix folks which have to use
Windows

I am not sure how important this is now, but I was in situations
that I was given computer to use. I could install software on
it but changing OS was out of question. Since computer run
Windows I installed Cygwin. Now everybody (including myself)
travels with a laptop, so main reason for using Windows is gone.
Still, I can imagine situations that people would prefer Linux
but for some reason have to use Windows.

> 2. Clisp is packaged by Cygwin. But this advantage is gone now.

People in the past had trouble building ECL on Cygwin, but it
seems that now ECL build reliably. Using ECL may require gcc
as dependency (so that user files can benefit from compilation).
Once we are past build problems and gcc dependency ECL
should be preferable to clisp.

> Disadvantages:
>
> 1. Clisp on Cygwin is slow, and not have a release for years.
> 2. Cygwin is not as portable as msys2/mingw64.

3. True Windows user hates Cygwin.

Still, as long as no Windows lover comes to give FriCAS on
Windows needed uplift Cygwin is our best option. I wrote
"Windows lover" because developers who are not immersed
into Windows culture are likely to miss many aspects
deemed important by Windows users.

> So, if we choose to support Cygwin, we may need to use ecl, ccl,
> or a unmodified clisp.

I have no idea if ccl (or sbcl???) runs with Cygwin. I somebody
manages to build using one of them, we could get better performance.
But realisticaly, it looks better to go for something that is
easy to build which now seem to be ECL.

--
Waldek Hebisch

Ralf Hemmecke

unread,
Mar 10, 2021, 2:45:23 PM3/10/21
to fricas...@googlegroups.com
>> Advantages:
>>
>> 1. Cygwin can have HyperDoc with X11.
>
> Yes, that is important advantage.

Until HyperDoc is obsolete... ;-)

> Let me add another point:
>
> 1a. Cygwin may be prefered by Unix folks which have to use
> Windows

Why would someone choose cygwin if he can have WSL2?

Ralf

Samuel Lelièvre

unread,
Mar 10, 2021, 3:20:27 PM3/10/21
to fricas...@googlegroups.com
2021-03-10 19:45 UTC, Ralf Hemmecke:
Another use case is a user who has installed SageMath
using the (Cygwin-based) SageMath installer for Windows.
If that user wants to use FriCAS and SageMath together,
it helps if FriCas can be installed in Cygwin. --Samuel

Qian Yun

unread,
Mar 10, 2021, 10:16:33 PM3/10/21
to fricas...@googlegroups.com
Thanks for everyone's reply, I'll give Cygwin another try.

I don't have much experience of Common Lisp on Windows, so
please correct me if I'm wrong or missed something.

Current status:

Clisp : can't save core with ":executable t". Seems Maxima
on Windows uses with ":executable nil" though.

SBCL: SBCL actually runs in Cygwin, but it uses windows style
path like "c:\sbcl" and doesn't recognize Cygwin style path like
"/cygdrive/c/sbcl", which is confusing for me and unable to
compile FriCAS.

ECL: easy to compile ecl from source. Don't know why upstream
doesn't provide binaries or why Cygwin doesn't include it.
Currently I'm building FriCAS with it, but compile time is
much longer than SBCL on msys2/mingw64. It took me 70 minutes
on a 8 core windows VM, over 10 times longer than SBCL.

The compile process is smooth, and result binary can run
HyperDoc without problems.

======

Have not tried other lisps yet.

I didn't try to build docs or graphic example files, so I
decide to remove relevant sections in doc.

- Qian

Qian Yun

unread,
Mar 10, 2021, 10:31:48 PM3/10/21
to fricas...@googlegroups.com
update-INSTALL.CYGWIN.patch

Dima Pasechnik

unread,
Mar 11, 2021, 2:23:53 AM3/11/21
to fricas...@googlegroups.com


On Thu, 11 Mar 2021, 03:16 Qian Yun, <oldk...@gmail.com> wrote:
Thanks for everyone's reply, I'll give Cygwin another try.

I don't have much experience of Common Lisp on Windows, so
please correct me if I'm wrong or missed something.

Current status:

Clisp : can't save core with ":executable t".  Seems Maxima
on Windows uses with ":executable nil" though.

SBCL: SBCL actually runs in Cygwin, but it uses windows style
path like "c:\sbcl" and doesn't recognize Cygwin style path like
"/cygdrive/c/sbcl", which is confusing for me and unable to
compile FriCAS.

ECL: easy to compile ecl from source.  Don't know why upstream
doesn't provide binaries or why Cygwin doesn't include it.
Currently I'm building FriCAS with it, but compile time is
much longer than SBCL on msys2/mingw64.  It took me 70 minutes
on a 8 core windows VM, over 10 times longer than SBCL.

part of the slowdown you see is due to Cygwin slowness (compared to native Windows or Linux), as it does POSIX emulation, part due to ECL doing a 2-stage compilation (to C first, with the resulting C code compiled by gcc).



The compile process is smooth, and result binary can run
HyperDoc without problems.

======

Have not tried other lisps yet.

I didn't try to build docs or graphic example files, so I
decide to remove relevant sections in doc.

- Qian

--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.

Qian Yun

unread,
Mar 11, 2021, 7:50:51 AM3/11/21
to fricas...@googlegroups.com
I tried ccl and sbcl, they sort of run under Cygwin, but they
have problems on unix style pathnames "/cygdrive/xxx", claiming
the file does not exist. That makes them unable to compile FriCAS.

I don't know if this is a common pitfall of Cygwin, or impossible
to workaround.

Anyway, I got ecl working, and I'm happy with status quo.
Until a true windows user raises a valid need/bug.

- Qian

Waldek Hebisch

unread,
Mar 11, 2021, 8:26:03 AM3/11/21
to fricas...@googlegroups.com
On Thu, Mar 11, 2021 at 08:50:29PM +0800, Qian Yun wrote:
> I tried ccl and sbcl, they sort of run under Cygwin, but they
> have problems on unix style pathnames "/cygdrive/xxx", claiming
> the file does not exist. That makes them unable to compile FriCAS.

"run under Cygwin" is rathr imprecise statement. Cygwin is
really a library impementing emulation of Posix system calls.
Program linked to Cygin libraries is normal Windows program,
but shows behaviour that is Posix-like due to use of the
library. Cygwin offers a shell and collection of programs
linked to CYgwnin library. Together this gives Unix-like
environment on WIndows. IIUC cygwin shell can start normal
(non linked to Cygwin library) Windows programs, they simply
run under Windows (probably completely) unaware that they
were started from Cygwin program.

IIUC the "/cygdrive/xxx" paths are implemented in Cygwin
library. What I do not know is if Cygwin pseudoterminal
require cooperation on both sides (that is if program
running inside pty must be linked to Cygwin library),
or if they have some clever way that works without or
with limited cooperation from the program running inside
pty. In the second case one should be able to do the follownig:
- build sbcl based FRICASsys in mingw
- build FriCAS under Cygwin using different Lisp or skipping
FRICASsys and algebra (the second would require tiny modification
to makefiles)
- combine mingw FRICASsys + algebra fasls, databases, hyperdoc pages
with Cygwin parts from step two (sman, hypedoc, graphics)

There is obvious, but hopefully easy difficulty: one has to
adjust paths. Sligtly more troublesome are sockets. IIUC Cygwin
emulates Unix domain sockets, mingw has only TCP sockets so
we would have to switch Cygwin version to compatible sockets.
But unknown are pseudoterminals, ATM without working pty
the whole thing would not run.

--
Waldek Hebisch

Qian Yun

unread,
Mar 11, 2021, 8:30:09 AM3/11/21
to fricas...@googlegroups.com


On 3/11/21 9:25 PM, Waldek Hebisch wrote:
> On Thu, Mar 11, 2021 at 08:50:29PM +0800, Qian Yun wrote:
>> I tried ccl and sbcl, they sort of run under Cygwin, but they
>> have problems on unix style pathnames "/cygdrive/xxx", claiming
>> the file does not exist. That makes them unable to compile FriCAS.
>
> "run under Cygwin" is rathr imprecise statement. Cygwin is
> really a library impementing emulation of Posix system calls.
> Program linked to Cygin libraries is normal Windows program,
> but shows behaviour that is Posix-like due to use of the
> library. Cygwin offers a shell and collection of programs
> linked to CYgwnin library. Together this gives Unix-like
> environment on WIndows. IIUC cygwin shell can start normal
> (non linked to Cygwin library) Windows programs, they simply
> run under Windows (probably completely) unaware that they
> were started from Cygwin program.

Yes, ccl and sbcl are normal win32 applications, they can
run under Cygwin, but don't understand cygwin path.

> IIUC the "/cygdrive/xxx" paths are implemented in Cygwin
> library. What I do not know is if Cygwin pseudoterminal
> require cooperation on both sides (that is if program
> running inside pty must be linked to Cygwin library),
> or if they have some clever way that works without or
> with limited cooperation from the program running inside
> pty. In the second case one should be able to do the follownig:
> - build sbcl based FRICASsys in mingw
> - build FriCAS under Cygwin using different Lisp or skipping
> FRICASsys and algebra (the second would require tiny modification
> to makefiles)
> - combine mingw FRICASsys + algebra fasls, databases, hyperdoc pages
> with Cygwin parts from step two (sman, hypedoc, graphics)
>
> There is obvious, but hopefully easy difficulty: one has to
> adjust paths. Sligtly more troublesome are sockets. IIUC Cygwin
> emulates Unix domain sockets, mingw has only TCP sockets so
> we would have to switch Cygwin version to compatible sockets.
> But unknown are pseudoterminals, ATM without working pty
> the whole thing would not run.
>

I briefly tried to mix msys2 built sman with mingw64 built
FriCASsys, it doesn't run (stalls). I didn't investigate further.

- Qian

Qian Yun

unread,
Mar 11, 2021, 10:20:23 PM3/11/21
to fricas...@googlegroups.com
Okay, the secret sauce seems to be "cygpath -m".

Now let's see if we can have a complete FriCAS distribution
of Cygwin/SBCL, or mingw64/SBCL with sman.

- Qian

Qian Yun

unread,
Mar 11, 2021, 11:40:49 PM3/11/21
to fricas...@googlegroups.com
After some tweaking in Makefiles, interpsys can be generated.
Sadly, both SBCL/ccl encounters memory exception when
doing ")read boo_db.input" in src/algebra .

- Qian

Qian Yun

unread,
Mar 15, 2021, 7:34:29 AM3/15/21
to fricas...@googlegroups.com
Attaching my hacks here, so that people can start from here to
work on SBCL on Cygwin.

- Qian
cygwin-hack.patch
Reply all
Reply to author
Forward
0 new messages