[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Windows deployment - Numbers egg

From: Robert Herman
Subject: Re: [Chicken-users] Windows deployment - Numbers egg
Date: Sun, 4 Oct 2015 22:23:26 +0800

Yes, I read the manual. All of the examples seem to be a linux host with .so files. Windows uses .dll files.
When I try to deploy a static build of the exe, it makes an exe, and the size makes you think it has bundled any dependencies like numbers (from 77kb to 1.6mb), but on MinGW64-32 bit, it hasn't. If you try and run the exe on a different Windows box, or through a non-MinGW command line on the same Windows box, it complains it cannot find the numbers extension. My guess is that it has statically linked and bundled libchicken.dll in the exe, but not the numbers extension that is in a '(use numbers)' statement in the source file.
If I simply compile the file in the MinGW command line, the exe works perfectly. It knows where to find the numbers library it needs, my guess from the CHICKEN install directory. The program works. What I am trying to do is make a static exe with the dependencies all in the exe. This way I can give it to somebody who is not a programmer and does not have CHICKEN installed, to run as is. Later I would like to dynamically compile, so the user only needs the libchicken.dll once, but I would like to statically link any program-specific libs (like numbers). This way the user only needs one copy of libchicken.dll in a directory, and any exe I send them will have the oddball dependencies statically linked right in the exe.
For instance, the same program on a Gambit-C MinGW64-64 bit system is compiled: "gsc -exe "file.scm"" The resulting exe (4 mb) runs to whomever I send it on their Windows box. It includes all of what it needs, i.e. the gambit runtime dll, and any libs (like numbers). I guess they made Gambit-C more Windows friendly, but it  alas it does not have the packages CHICKEN has. On the other hand, if the packages (eggs) only work  if you have MinGW64-32 bit installed with a CHICKEN dev environment, it sort of defeats the purpose of being able to create stand alone exe files.

I apologize for the lengthy description, and I am grateful for the help! I hope I was clear (need sleep) :)


On 4 October 2015 at 21:30, Peter Bex <address@hidden> wrote:
On Sun, Oct 04, 2015 at 08:50:59PM +0800, Robert Herman wrote:
> Matt,
> "csc -deploy -static Pi-Ch.scm" creates a deploy directory, and the
> resulting executable is 1.6MB vs 77KB, but it still throws the "cannot the
> load the extension: numbers".
> I then tried putting libchicken.dll in the deploy directory that was
> created, and making a numbers.dll file, since Windows does not
> use .so files, only .dll.

I think this is incorrect; looking at my VM mingw install, and all the eggs
(even all the import libraries from CHICKEN core), it uses .so for all the
dynamically loaded extensions.  And if I install it normally, and type
(use numbers) at the REPL, it prints that it's loaded /path/to/

Renaming manually is something I would definitely not recommend, because
then you would be messing with the names that CHICKEN expects.

> I used chicken-install -r to retrieve the numbers
> egg into the current directory. I then tried "csc -dll numbers.scm" and it
> created I tried putting it in the deploy directory, but no
> luck. I changed the .so to .dll, and again no luck.

I've tried to do it "by the book" on mingw (msys):

$ /path/to/chicken-install.exe numbers
$ echo '(use numbers) (print 1/2)' > foo.scm
$ /path/to/csc.exe -deploy -X numbers-syntax foo.scm
$ /path/to/chicken-install.exe -deploy -prefix foo numbers
$ # To prove that it's not loading numbers from install dir:
$ /path/to/chicken-uninstall.exe numbers
$ ./foo/foo.exe

This works perfectly.  The book, incidentally, is here:

Hope this helps,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]