build with clisp on windows, finally

8 views
Skip to first unread message

Qian Yun

unread,
Apr 20, 2026, 8:38:16 PM (2 days ago) Apr 20
to fricas-devel
It's been almost 10 years since I tried to compile fricas with clisp
on windows. Finally, I've done it.

Recap:

1. clisp is packaged in cygwin, but it can't dump executable.

2. clisp provides binary compiled by mingw, namely
clisp-2.49-win32-mingw-big.zip , it also can't dump executable.
(Dumped executable does not run.)

3. I didn't try clisp-2.49-win32-mingw-small.zip before,
but this one can dump executable.

(I guess that some of the extra clisp modules cause the
dump executable trouble.)


Beyond that, one more patch is needed: remove "merge-pathnames"
in "|make_full_namestring|" in src/interp/nlib.lisp.

"merge-pathnames" uses *default-pathname-defaults*, which is
#P"C:" for clisp on windows. This causes trouble.

I see that in git history, all other "merge-pathnames" calls
are removed. I think this one is safe to remove as well.
(The comment says that this is for CMS compatibility?!)

- Qian

Waldek Hebisch

unread,
Apr 20, 2026, 9:22:38 PM (2 days ago) Apr 20
to fricas...@googlegroups.com
I actually recently looked at 'make_full_namestring', with the
intent of cleaning up our code. The 'merge-pathnames' part
is the only one doing real job, namely 'make_full_namestring'
receives string as an argument and 'namestring' there is only
to get back string (as opposed to Lisp pathname). So if
we remove call to 'merge-pathnames' we can remove
'make_full_namestring'.

Concerning CMS compatibility, IIUC Scratchpad II was for some
time developed under VM/CMS combination, where VM provides
multitasking and CMS is a single tasked OS providing user
interaction. CMS organizes file into minidiscs, each having
a single directory. Directrory entries have name and type
part, so INT.NRLIB is a full name of file with name INT and
type NRLIB. IIUC under VM/CMS Scratchpad II used thing
called "partitioned data set", which from point of view of
filesystem was a single file, but programs could extract
from it names parts. When Scratchpad II was ported to
other systems this structure was emulated, instead of
partitioned data sets Scratchpad II used directories, with
files in the directory giving needed parts.

To simplify file handling I tried to eliminate CMS specific
stuff, instead using more general concepts. In particular,
I would prefer to consistently use strings as file names
(as opposed to Lisp pathnames or tuples emulating CMS
handling). Large part of this is done, but there are still
some remaining things.

Anyway, comments about CMS compatibility are historically
accurate, that is how the code evolved. In case of
'make_full_namestring' this comment actually irrelevant
now: we removed some time ago call which builds name from
parts (needed to emulate CMS), and 'merge-patnames'
remained to preserve its effects under assumption that
some other place may depend on it. If fact, I hope
that it is not needed, but I did not test that.

--
Waldek Hebisch

Qian Yun

unread,
Apr 21, 2026, 5:21:26 AM (yesterday) Apr 21
to fricas...@googlegroups.com
Thanks for the insight on CMS history, very fascinating.

I plan to commit this CI file soon:

https://github.com/oldk1331/fricas/blob/b8c09260a200b1c770d0f770e1aab74e09ac0918/.github/workflows/conditional-lisp.yml

It can trigger test automatically for different lisps
(ccl/ecl/gcl/clisp/cmucl) on different operating systems
(linux/macos/windows), based on their name appearance in commit message.

(Currently there are 12 combinations of lisp-os, 20 combinations of
lisp-os-arch.)

This should be a completed coverage of fricas's supported platforms.
With the only exception being ecl on windows.

I've tried it with "remove-make_full_namestring.patch" (in attachment),
no breakage.

- Qian
remove-make_full_namestring.patch

Waldek Hebisch

unread,
Apr 21, 2026, 7:51:39 AM (yesterday) Apr 21
to fricas...@googlegroups.com
On Tue, Apr 21, 2026 at 05:21:21PM +0800, Qian Yun wrote:
> Thanks for the insight on CMS history, very fascinating.
>
> I plan to commit this CI file soon:
>
> https://github.com/oldk1331/fricas/blob/b8c09260a200b1c770d0f770e1aab74e09ac0918/.github/workflows/conditional-lisp.yml
>
> It can trigger test automatically for different lisps
> (ccl/ecl/gcl/clisp/cmucl) on different operating systems
> (linux/macos/windows), based on their name appearance in commit message.
>
> (Currently there are 12 combinations of lisp-os, 20 combinations of
> lisp-os-arch.)
>
> This should be a completed coverage of fricas's supported platforms.
> With the only exception being ecl on windows.

Looks good.

> I've tried it with "remove-make_full_namestring.patch" (in attachment),
> no breakage.

Do you need 'namestring'? All changed places receive strings
as arguments and 'namestring' should be no-op.

> ---
> src/interp/lisplib.boot | 2 +-
> src/interp/m_util.boot | 2 +-
> src/interp/nlib.lisp | 14 +++++---------
> src/interp/setvars.boot | 2 +-
> 4 files changed, 8 insertions(+), 12 deletions(-)
>
> diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot
> index a5ab78eb5..ab4f4b8a0 100644
> --- a/src/interp/lisplib.boot
> +++ b/src/interp/lisplib.boot
> @@ -196,7 +196,7 @@ compDefineLisplib(df:=["DEF",[op,:.],:.],m,e,prefix,fal,fn) ==
> PROGN(if $compiler_output_stream then CLOSE($compiler_output_stream),
> kaf_close($libFile)))
> lisplibDoRename(name)
> - compile_lib(make_full_namestring(make_filename2(name, $spadLibFT)))
> + compile_lib(make_filename2(name, $spadLibFT))
> FRESH_-LINE(get_algebra_stream())
> sayMSG(filler_chars(72, '"-"))
> merge_info_from_objects([get_database(op, 'ABBREVIATION)], [], false)
> diff --git a/src/interp/m_util.boot b/src/interp/m_util.boot
> index 0678e467a..1c572b8e2 100644
> --- a/src/interp/m_util.boot
> +++ b/src/interp/m_util.boot
> @@ -60,7 +60,7 @@ get_io_index_table(stream, io?) ==
>
> kaf_open(name, io?) ==
> full_name :=
> - io? => make_full_namestring(name)
> + io? => NAMESTRING(name)
> make_input_filename1(name)
> if io? then
> kind := file_kind(full_name)
> diff --git a/src/interp/nlib.lisp b/src/interp/nlib.lisp
> index a9ffb7170..0b9e6ae59 100644
> --- a/src/interp/nlib.lisp
> +++ b/src/interp/nlib.lisp
> @@ -75,10 +75,6 @@
>
> ;; cms file operations
>
> -(defun |make_full_namestring| (filearg)
> - (if (not (STRINGP filearg)) (BREAK))
> - (namestring (merge-pathnames filearg)))
> -
> ;; ($ERASE filearg) -> 0 if succeeds else 1
> (defun |erase_lib|(filearg)
> (if (|fricas_probe_file| filearg)
> @@ -105,17 +101,17 @@
> 1))
>
> (defun |replace_lib|(filespec2 filespec1)
> - (|erase_lib| (setq filespec1 (|make_full_namestring| filespec1)))
> + (|erase_lib| (setq filespec1 (namestring filespec1)))
> #-(or :clisp :openmcl :ecl)
> - (rename-file (|make_full_namestring| filespec2) filespec1)
> + (rename-file (namestring filespec2) filespec1)
> #+(or :clisp :openmcl :ecl)
> - (|run_program| "mv" (list (|make_full_namestring| filespec2) filespec1))
> + (|run_program| "mv" (list (namestring filespec2) filespec1))
> )
>
>
> (defun |copy_file|(filespec1 filespec2)
> - (let ((name1 (|make_full_namestring| filespec1))
> - (name2 (|make_full_namestring| filespec2)))
> + (let ((name1 (namestring filespec1))
> + (name2 (namestring filespec2)))
> (copy-lib-directory name1 name2)
> ))
>
> diff --git a/src/interp/setvars.boot b/src/interp/setvars.boot
> index 6de42007a..bd2e49a12 100644
> --- a/src/interp/setvars.boot
> +++ b/src/interp/setvars.boot
> @@ -668,7 +668,7 @@ try_open(fn, ft, append) ==
> if not((ptype := file_extention(fn)) = '"") then
> fn := drop_extention(fn)
> ft := ptype
> - filename := make_full_namestring(make_filename2(fn, ft))
> + filename := make_filename2(fn, ft)
> null filename => [NIL, NIL]
> (testStream := makeStream(append, filename)) => [testStream, filename]
> [NIL, NIL]


--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages