feeley on master
fix too few arguments passed to… Merge pull request #668 from Fr… (compare)
feeley on master
Remove redundant definition of … Precompute (- ##min-fixnum) (compare)
feeley on master
Avoid uninitialized variables (compare)
feeley on master
Add ##dead-end primitive Fix optimize-dead-local-variabl… (compare)
feeley on master
Avoid needlessly wrapping quasi… (compare)
feeley on master
Expose procedure to raise synta… Add ##c-id? to check C identifi… (compare)
feeley on master
Use define-prim&proc for make-p… (compare)
I'm getting a failed unit test from make check
when trying to build the Gambit master branch with the options:
./configure --prefix=/usr/local/gambit
--enable-single-host
--enable-multiple-versions
--enable-shared
--enable-smp
--enable-gcc-opts
--enable-openssl
--enable-absolute-shared-libs
--enable-poll
--enable-bignum
The relevant make check
output is:
LD_LIBRARY_PATH=../lib:../gsi:../gsc: ../gsi/gsi -:tl,~~bin=../bin,~~lib=../lib,~~include=../include -f ./run-unit-tests.scm
[226| 0] 90% ##############.. 6.9s 13-modules/prim_exception.scm
*** FAILED 13-modules/prim_exception.scm WITH EXIT CODE HI=1 LO=0
(with-exception-handler ##list (lambda () (##cons 1 (##raise 123)))) in (include "~~lib/gambit/prim/exception#.scm") returned #<unbound-global-exception #2> but expected (1 123)
(with-exception-handler ##list (lambda () (##cons 1 (##raise 123)))) in (namespace ("##")) returned #<unbound-global-exception #3> but expected (1 123)
[250| 1] 100% ################ 7.5s
FAILED 1 UNIT TESTS OUT OF 251 (.4%)
This is my first time building Gambit with this many options. Any insights to share on why this might be happening?
(define-structure point x)
expands to
gsc -c -expansion crap.scm
Expansion:
(define ##type-1-point
('#<procedure #2 ##structure> ##type-type ('#<procedure #3 ##string->uninterned-symbol> "##type-1-point") 'point 8 #f #(x 0 #f)))
(define make-point (lambda (p1) ('#<procedure #2 ##structure> ##type-1-point p1)))
(define point-copy (lambda (obj) (##structure-copy obj)))
(define point? (lambda (obj) ('#<procedure #4 ##structure-direct-instance-of?> obj ('#<procedure #5 ##type-id> ##type-1-point))))
(define point-x
(lambda (obj)
(let ((temp.3 point-x) (temp.2 ##type-1-point))
(if ('#<procedure #4 ##structure-direct-instance-of?> obj ('#<procedure #5 ##type-id> temp.2))
('#<procedure #6 ##unchecked-structure-ref> obj 1 temp.2 temp.3)
('#<procedure #7 ##direct-structure-ref> obj 1 temp.2 temp.3)))))
(define point-x-set!
(lambda (obj val)
(let ((temp.8 point-x-set!) (temp.7 ##type-1-point))
(if ('#<procedure #4 ##structure-direct-instance-of?> obj ('#<procedure #5 ##type-id> temp.7))
('#<procedure #8 ##unchecked-structure-set!> obj val 1 temp.7 temp.8)
('#<procedure #9 ##direct-structure-set!> obj val 1 temp.7 temp.8)))))
(define point-x-set (lambda (obj val) (##direct-structure-set obj val 1 ##type-1-point point-x-set)))
How do I get rid of point-copy
? I want to define my own with that name.
gsc -:help
i would've thought the option would need to be provided with the compilation command
% cat limited.scm
#! /usr/bin/env gsi -:max-heap=100M
(##gc-report-set! #t)
(##gc)
(define (go)
(let loop ((size 1000000) (last #f))
(println size)
(loop (* size 2) (make-vector size))))
(with-exception-catcher pp go)
% chmod +x limited.scm
% ./limited.scm
*** GC: 135us, 130K alloc, 12M heap, 84K live (1% 84288+1488)
1000000
2000000
*** GC: 2.4ms, 135K alloc, 52M heap, 23M live (44% 85168+24001584)
4000000
*** GC: 5.1ms, 139K alloc, 101M heap, 46M live (46% 85168+48001584)
8000000
*** GC: 9.3ms, 143K alloc, 105M heap, 92M live (88% 85168+96001584)
16000000
*** GC: 17ms, 147K alloc, 108M heap, 61M live (57% 85168+64001536)
#<heap-overflow-exception #2>
% gsc -exe limited.scm
% ./limited
*** GC: 109us, 71K alloc, 12M heap, 64K live (1% 64464+1488)
1000000
2000000
*** GC: 525us, 75K alloc, 36M heap, 15M live (42% 64928+16001536)
4000000
*** GC: 260us, 79K alloc, 69M heap, 31M live (45% 64928+32001536)
8000000
*** GC: 1.9ms, 82K alloc, 108M heap, 61M live (57% 64928+64001536)
16000000
*** GC: 3.4ms, 86K alloc, 12M heap, 65K live (1% 64928+1488)
#<heap-overflow-exception #2>
misc/build-gambit-emscripten.tgz
... it is quite likely that it has suffered from bitrot, but it shouldn't be too hard to get it working again. This biggest problem is probably the evolution of emscripten, so doing a checkout of an old version of emscripten may be needed if you just want to quickly experiment with this.
(eval '(begin
(##namespace ("c#"))
(##include "~~/lib/header.scm")))
This seems to work
heine:~/programs/gambit/gambit> gsi -:=. gsc/igsc.scm
loading "~~/gsc/_host.scm"
loading "~~/gsc/_utils.scm"
loading "~~/gsc/_source.scm"
loading "~~/gsc/_parms.scm"
loading "~~/gsc/_env.scm"
loading "~~/gsc/_ptree1.scm"
loading "~~/gsc/_ptree2.scm"
loading "~~/gsc/_gvm.scm"
loading "~~/gsc/_back.scm"
loading "~~/gsc/_front.scm"
loading "~~/gsc/_prims.scm"
loading "~~/gsc/_assert.scm"
loading "~~/gsc/_asm.scm"
loading "~~/gsc/_x86.scm"
loading "~~/gsc/_arm.scm"
loading "~~/gsc/_riscv.scm"
loading "~~/gsc/_codegen.scm"
loading "~~/gsc/_t-univ-1.scm"
loading "~~/gsc/_t-univ-2.scm"
loading "~~/gsc/_t-univ-3.scm"
loading "~~/gsc/_t-univ-4.scm"
loading "~~/gsc/_t-cpu-abstract-machine.scm"
loading "~~/gsc/_t-cpu-primitives.scm"
loading "~~/gsc/_t-cpu-object-desc.scm"
loading "~~/gsc/_t-cpu-utils.scm"
loading "~~/gsc/_t-cpu-backend-x86.scm"
loading "~~/gsc/_t-cpu-backend-arm.scm"
loading "~~/gsc/_t-cpu-backend-riscv.scm"
loading "~~/gsc/_t-cpu.scm"
loading "~~/gsc/_t-c-1.scm"
loading "~~/gsc/_t-c-3.scm"
loading "~~/gsc/_t-c-2.scm"
loading "~~/gsc/_gsclib.scm"
loading "~~/gsc/_gsc.scm"
loading "~~/gsc/_gscdebug.scm"
Gambit v4.9.3-1234-g6acd87df
> (compile-file "c.scm")
"/home/lucier/programs/gambit/gambit/c.o1"
This is in the Gambit source directory after a build.