An alternative to statically compiling is to use the deploy feature of csc
to make a directory with all the items you need. When you start working
with IUP I think it will be your only choice. Here is a snippet of a
Makefile that I used to deploy a project to a directory on windows. You can
then use Inno Setup to make an installer
http://www.jrsoftware.org/isinfo.php with the directory contents or just
zip it up and share.

=====================Makefile example===============

PROXY =

CHICKEN_INSTALL=chicken-install $(PROXY) -deploy -p farmsim

farmsim/farmsim : farmsim.scm boxes.scm common.scm ezxcolors.scm
simevents.scm farmsim/coops.so farmsim/format.so farmsim/ezxdisp.so
farmsim/ezxgui.so farmsim/qtree.so farmsim/vcd.so farmsim/geolib.so
farmsim/pdf.so farmsim/regex.so
        csc -deploy farmsim.scm

farmsim/coops.so :
        $(CHICKEN_INSTALL) coops

farmsim/ezxdisp.so :
        $(CHICKEN_INSTALL) ezxdisp

farmsim/regex.so :
        $(CHICKEN_INSTALL) regex

farmsim/pdf.so :
        $(CHICKEN_INSTALL) pdf

farmsim/format.so :
        $(CHICKEN_INSTALL) format

farmsim/regex.so :
        $(CHICKEN_INSTALL) regex

farmsim/qtree.so : # $(MATTSUTILS)/qtree/qtree.scm
        $(CHICKEN_INSTALL) qtree -l $(MATTSUTILS) -transport local

farmsim/vcd.so :   # $(MATTSUTILS)/vcd/vcd.scm
        $(CHICKEN_INSTALL) vcd -l $(MATTSUTILS) -transport local

farmsim/ezxgui.so : # $(MATTSUTILS)/ezxgui/ezxgui.scm
        $(CHICKEN_INSTALL) ezxgui -l $(MATTSUTILS) -transport local

farmsim/geolib.so : # $(MATTSUTILS)/geolib/geolib.scm
        $(CHICKEN_INSTALL) geolib -l $(MATTSUTILS) -transport local


On Sat, Oct 3, 2015 at 6:50 PM, Robert Herman <[email protected]> wrote:

> I have been learning Chicken by incrementally building a program that
> returns a number of digits of Pi based on an already-existing algorithm
> that implements the Chudnovsky method. I have a command line version
> working, thanks to all of the help here, that writes the file as well as
> displays the output in the command line.
> If I just: csc Pi-Ch.scm I get a 77kB exe that runs fine on my machine. In
> order to share it with my son, I need to statically compile it with all of
> its dependencies, like so:
>
> csc -deploy -static Pi-Ch.scm
>
> I returns an error:
>
> Error: (require) cannot load extension: numbers
>         Call history:
>         Pi-Ch.scm:16: ##sys#require             <--
>
> I found the numbers.so file, but Windows needs a dll file. I plan on
> downloading the numbers egg source, and seeing if there's any reason I
> could not compile the numbers.so file to numbers.dll. Any leads or tips?
>
> Next step will be to create an IUP GUI for the program to complete the
> exercise.
>
> Thanks!
>
> Rob
>
> PS: Here's the code to date:
>
> ;;; Program to use the chudnovsky formula to compute pi.
> ;;; Written by Bakul Shah.
> ;;; Changed by Bradley Lucier to use standard arithmetic operations
> ;;; available in Gambit Scheme and to replace (floor (/ ...)) by
> ;;; (quotient ...)
>
> ;; Don't try running this benchmark with Gauche, it'll consume all
> ;; your computer's memory!
>
> ;;;; I removed the conditional statements to make it run across different
> ;;;; scheme implementations.
> ;;;; I added the use numbers and extras at the top, and the last 8 lines
> ;;;; to prompt user and to display the results and write to a file.
> ;;;; TODO: Deploy to Windows 32-bit, and create an IUP-based GUI for it.
> ;;;; RPH - 4/10/2015
>
> (use numbers extras)
>
> (define integer-sqrt exact-integer-sqrt)
>
> (define ch-A 13591409)
> (define ch-B 545140134)
> (define ch-C 640320)
> (define ch-C^3 (expt 640320 3))
> (define ch-D 12)
>
> (define (ch-split a b)
>   (if (= 1 (- b a))
>       (let ((g (* (- (* 6 b) 5) (- (* 2 b) 1) (- (* 6 b) 1))))
>         (list g
>               (quotient (* ch-C^3 (expt b 3)) 24)
>               (* (expt -1 b) g (+ (* b ch-B) ch-A))))
>       (let* ((mid (quotient (+ a b) 2))
>              (gpq1 (ch-split a mid))    ;<<<<====
>              (gpq2 (ch-split mid b))    ;<<<<====
>              (g1 (car gpq1)) (p1 (cadr gpq1)) (q1 (caddr gpq1))
>              (g2 (car gpq2)) (p2 (cadr gpq2)) (q2 (caddr gpq2)))
>         (list (* g1 g2)
>               (* p1 p2)
>               (+ (* q1 p2) (* q2 g1))))))
>
> (define (pich digits)
>   (let* ((num-terms (inexact->exact (floor (+ 2 (/ digits 14.181647462)))))
>          (sqrt-C (integer-sqrt (* ch-C (expt 100 digits)))))
>     (let* ((gpq (ch-split 0 num-terms))
>            (gs (car gpq)) (p (cadr gpq)) (q (caddr gpq)))
>       (quotient (* p ch-C sqrt-C) (* ch-D (+ q (* p ch-A)))))))
>
> (print "How many digits of Pi to compute?")
> (define digits (read))
>
> (print "Here you go:")
> (print (pich digits))
> (define file-name "pidigits.txt")
> (with-output-to-file file-name
>   (lambda ()
>     (format #t "~A~%" (pich digits))))
>
> _______________________________________________
> Chicken-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/chicken-users
>
>
_______________________________________________
Chicken-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to