compiling fricas-1.3.9 with sbcl-2.3.9

6 views
Skip to first unread message

Andrey G. Grozin

unread,
Oct 10, 2023, 2:32:42 AM10/10/23
to FriCAS - computer algebra system
Hello *,

I've upgraded sbcl to 2.3.9 and started recompiling fricas. I got

....
cd lisp && make all-lisp
make[2]: Entering directory
'/var/tmp/portage/sci-mathematics/fricas-1.3.9/work/fricas-1.3.9/src/lisp'
make[2]: Circular fricas-lisp.lisp <- fricas-lisp.lisp dependency dropped.
make[2]: Circular fricas-package.lisp <- fricas-package.lisp dependency
dropped.
echo '(in-package "FRICAS-LISP")' > fricas-config.lisp
echo '(defparameter algebra-optimization' \
'(quote nil))' >> fricas-config.lisp
if [ xyes = xyes ] ; then \
echo '(if (not (member :fricas_has_remove_directory' \
' *features*)) ' \
'(push :fricas_has_remove_directory *features*))' \
>> fricas-config.lisp ; \
fi
if [ xgmp_wrap_so != x ] ; then \
sed -e "s|libgmp.so|yes/lib/libgmp.so|" num_gmp.lisp > num_gmpx.lisp ;
\
else \
(echo '(in-package "FRICAS-LISP")' ; \
echo '(defun init-gmp(x) nil)' ; \
echo '(defun uninstall-gmp-multiplication() nil)') > num_gmpx.lisp ;
\
fi
make[2]: Circular primitives.lisp <- primitives.lisp dependency dropped.
echo '(load "fricas-package.lisp")' \
'(load "fricas-config.lisp")' \
'#+(or :sbcl :openmcl) (load (compile-file "num_gmpx.lisp"))'
\
'(load (compile-file "fricas-lisp.lisp"))' \
'(load (compile-file "primitives.lisp"))' \
'(in-package "FRICAS-LISP") (save-core
"/var/tmp/portage/sci-mathematics/fricas-1.3.9/work/fricas-1.3.9/build/x86_64-pc-linux-gnu/bin/lisp")'
\
| sbcl --noinform --noprint --no-sysinit --no-userinit

; file:
/var/tmp/portage/sci-mathematics/fricas-1.3.9/work/fricas-1.3.9/src/lisp/fricas-package.lisp
; in: DEFMACRO IN-PACKAGE
; (DEFMACRO FRICAS-LISP::IN-PACKAGE (PACKAGE &REST
FRICAS-LISP::OPTIONS)
; `(IN-PACKAGE ,PACKAGE))
; --> SB-INT:NAMED-DS-BIND SB-INT:BINDING*
; ==>
; (LET* ((#:G0
; (SB-C::CHECK-DS-LIST/&REST (CDR #:EXPR) 1 1
; '(# PACKAGE &REST
FRICAS-LISP::OPTIONS)))
; (PACKAGE (POP #:G0))
; (FRICAS-LISP::OPTIONS #:G0))
; (DECLARE (SB-C::CONSTANT-VALUE PACKAGE FRICAS-LISP::OPTIONS))
; (BLOCK FRICAS-LISP::IN-PACKAGE `(IN-PACKAGE ,PACKAGE)))
;
; caught STYLE-WARNING:
; The variable OPTIONS is defined but never used.
;
; compilation unit finished
; caught 1 STYLE-WARNING condition
; compiling file
"/var/tmp/portage/sci-mathematics/fricas-1.3.9/work/fricas-1.3.9/src/lisp/num_gmpx.lisp"
(written 10 OCT 2023 01:27:44 PM):
;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Lock on package SB-BIGNUM violated when interning NEGATE-BIGNUM
while in
; package FRICAS-LISP.
; See also:
; The SBCL Manual, Node "Package Locks"
;
; (in form starting at line: 3, column: 0, position: 28)
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 1 ERROR condition

; compilation aborted after 0:00:00.002

debugger invoked on a TYPE-ERROR @52AF5A23 in thread
#<THREAD tid=163 "main thread" RUNNING {10010A8003}>:
The value
NIL
is not of type
(OR STRING PATHNAME STREAM)
when binding SB-FASL::FILESPEC

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
0: [ABORT] Exit debugger, returning to top level.

(LOAD NIL) [more]
0]

Has anybody succeeded in compiling fricas with sbcl-2.3.9?

Andrey

Waldek Hebisch

unread,
Oct 10, 2023, 4:36:04 PM10/10/23
to fricas...@googlegroups.com
On Tue, Oct 10, 2023 at 01:32:37PM +0700, Andrey G. Grozin wrote:
> Hello *,
>
> I've upgraded sbcl to 2.3.9 and started recompiling fricas. I got
>
<sbip>
> ; compiling file "/var/tmp/portage/sci-mathematics/fricas-1.3.9/work/fricas-1.3.9/src/lisp/num_gmpx.lisp"
> (written 10 OCT 2023 01:27:44 PM):
> ;
> ; caught ERROR:
> ; READ error during COMPILE-FILE:
> ;
> ; Lock on package SB-BIGNUM violated when interning NEGATE-BIGNUM while
> in
> ; package FRICAS-LISP.
> ; See also:
> ; The SBCL Manual, Node "Package Locks"
> ;
> ; (in form starting at line: 3, column: 0, position: 28)
> ;
> ; compilation unit aborted
> ; caught 1 fatal ERROR condition
> ; caught 1 ERROR condition
>
> ; compilation aborted after 0:00:00.002
<snip>
> Has anybody succeeded in compiling fricas with sbcl-2.3.9?

FriCAS depends on internals of sbcl bignum code. AFAICS sbcl-2.3.9
changed this in a way which is incompatible with fricas-1.3.9.
It will take at least few days to adapt.

--
Waldek Hebisch

Qian Yun

unread,
Oct 14, 2023, 4:37:24 AM10/14/23
to fricas...@googlegroups.com
How about using SBCL's "sb-gmp" package instead of using our
own gmp speedup?

It seems we never discussed it before.

- Qian

Grégory Vanuxem

unread,
Oct 14, 2023, 5:55:28 AM10/14/23
to fricas...@googlegroups.com
Slow

__
Greg

--
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/aedfddf4-b3c2-42f2-ad5e-5f927cde0c50%40gmail.com.

Waldek Hebisch

unread,
Oct 14, 2023, 4:59:04 PM10/14/23
to fricas...@googlegroups.com
On Sat, Oct 14, 2023 at 04:37:19PM +0800, Qian Yun wrote:
> How about using SBCL's "sb-gmp" package instead of using our
> own gmp speedup?
>
> It seems we never discussed it before.

I did not measure speed of "sb-gmp", but there are reasons
for it to be slower:
- they use higher level GMP functions which implies extra
copies and memory allocations
- they have smaller treshhold for using GMP, my measurements
indicated that higher treshold give better speed.

--
Waldek Hebisch

Waldek Hebisch

unread,
Oct 14, 2023, 6:47:47 PM10/14/23
to fricas...@googlegroups.com
With the attached patch FriCAS builds both with sbcl-2.3.9 and
with older sbcl. ATM I am not fully statisfied with the
patch: I want compile time error when neither of supported
alternatives works, but the best way I found is using
"READ-FROM-STRING", which from my point of view is
somewhat clumsy.


--
Waldek Hebisch
sum6a.diff

Andrey G. Grozin

unread,
Oct 15, 2023, 4:23:01 AM10/15/23
to fricas...@googlegroups.com
Thank you very much! I confirm that fricas-1.3.9 with this patch compiles
and works both with sbcl-2.3.8 and sbcl-2.3.9.

Andrey

Waldek Hebisch

unread,
Oct 17, 2023, 3:44:13 PM10/17/23
to fricas...@googlegroups.com
Patch that I posted broke build with Clozure CL. I have now
commited a different patch that should work with all Lisp
implementation. For sbcl it is equivalent to previous patch,
but avoids unintended breakage with Clozure CL (the changed
file is only used by sbcl and Clozure CL, so other implementation
should be not affected).

--
Waldek Hebisch

Andrey G. Grozin

unread,
Oct 18, 2023, 8:35:02 AM10/18/23
to fricas...@googlegroups.com
On Tue, 17 Oct 2023, Waldek Hebisch wrote:
> Patch that I posted broke build with Clozure CL. I have now
> commited a different patch that should work with all Lisp
> implementation. For sbcl it is equivalent to previous patch,
> but avoids unintended breakage with Clozure CL (the changed
> file is only used by sbcl and Clozure CL, so other implementation
> should be not affected).
I confirm that fricas-1.3.9 with this patch (only this, no other
post-1.3.9 patches included) successfully compiles and runs with
ccl-1.12.2, sbcl-2.3.8, and sbcl-2.3.9.

Many thanks,
Andrey
Reply all
Reply to author
Forward
0 new messages