Greetings,
I want to build a stand-alone (requiring no DLL's) scheme app under Windows. I re-built Gambit 4.0b19 with Microsoft VC without a problem. However, when I try to compile a trivial program I get:
C:\Systems\Scheme\Gambit>gsc a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\lib")
C:\Systems\Scheme\Gambit>gsc -dynamic a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\bin")
a.scm just contains: (display "hello world")
I tried the -verbose option and that gave me nothing useful. It would be unbelievably great if the -verbose option displayed the full compile and link commands it was running.
I have no idea what that error message is trying to tell me. I tried all sorts of -cc-options and -ld-option options with no luck. Without a display of what it's executing, I'm in the dark.
I'd prefer to use VC.
Thanks.
Blake McBride
Afficher les réponses par date
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2-Oct-06, at 1:10 AM, Blake McBride wrote:
Greetings,
I want to build a stand-alone (requiring no DLL's) scheme app under Windows. I re-built Gambit 4.0b19 with Microsoft VC without a problem. However, when I try to compile a trivial program I get:
C:\Systems\Scheme\Gambit>gsc a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\lib")
C:\Systems\Scheme\Gambit>gsc -dynamic a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\bin")
When you build Gambit-C you must indicate where it will be installed by setting the ___GAMBCDIR symbol. With gcc this can be done with:
gcc -D___GAMBCDIR="C:/Gambit-C/4.0b19" ...
Just do the equivalent thing in VC.
Note also that when you run gsc and gsi, you can force the Gambit installation directory with the -:=DIR runtime option. So you could do:
gsc -:=C:/Gambit-C/4.0b19 a.scm
a.scm just contains: (display "hello world")
I tried the -verbose option and that gave me nothing useful. It would be unbelievably great if the -verbose option displayed the full compile and link commands it was running.
I have no idea what that error message is trying to tell me. I tried all sorts of -cc-options and -ld-option options with no luck. Without a display of what it's executing, I'm in the dark.
I'll see what I can do. Note that it is the gsc-cc-o.bat script that invokes the C compiler. This file should be in
C:/Gambit-C/4.0b19/bin/gsc-cc-o.bat
You could add a trace in that script to echo the command that invokes the C compiler.
Marc
At 09:26 AM 10/2/2006, Marc Feeley wrote:
On 2-Oct-06, at 1:10 AM, Blake McBride wrote:
Greetings,
I want to build a stand-alone (requiring no DLL's) scheme app under Windows. I re-built Gambit 4.0b19 with Microsoft VC without a problem. However, when I try to compile a trivial program I get:
C:\Systems\Scheme\Gambit>gsc a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\lib")
C:\Systems\Scheme\Gambit>gsc -dynamic a.scm *** ERROR IN ##parameterize -- No such file or directory (current-directory "C:\bin")
When you build Gambit-C you must indicate where it will be installed by setting the ___GAMBCDIR symbol. With gcc this can be done with:
gcc -D___GAMBCDIR="C:/Gambit-C/4.0b19" ...
Just do the equivalent thing in VC.
Note also that when you run gsc and gsi, you can force the Gambit installation directory with the -:=DIR runtime option. So you could do:
gsc -:=C:/Gambit-C/4.0b19 a.scm
That worked and I did get a good executable file. I had to link with gambc.lib, user32.lib and ws2_32.lib (two MS libs).
I don't get the whole "compile in the destination path" stuff. That means you have to re-build the whole thing whenever you want to move anything (like to a drive with more space). It also makes distributing Gambit a real pain (use my path or else...). Why don't you build with a default path and then use an environment variable to specify the Gambit home? That's how everyone else does it.
I'd leave in the -:= ability in case someone doesn't want to use an environment variable and just wants to specify the home on the command line. But allowing the use of an environment variable is a real convenience.
The makefile I am using is as follows:
GSHOME = /Gambit-C/4.0b19
a.exe : a.scm gsc -:=$(GSHOME) a.scm cl -nologo -c -MTd -I$(GSHOME)\include a.c a_.c link /nologo /out:a.exe /libpath:$(GSHOME)\lib a.obj a_.obj gambc.lib user32.lib ws2_32.lib
clean: rm -zq *.c *.obj *.exe *~ *.bak
a.scm just contains: (display "hello world")
I tried the -verbose option and that gave me nothing useful. It would be unbelievably great if the -verbose option displayed the full compile and link commands it was running.
I have no idea what that error message is trying to tell me. I tried all sorts of -cc-options and -ld-option options with no luck. Without a display of what it's executing, I'm in the dark.
I'll see what I can do. Note that it is the gsc-cc-o.bat script that invokes the C compiler. This file should be in
C:/Gambit-C/4.0b19/bin/gsc-cc-o.bat
You could add a trace in that script to echo the command that invokes the C compiler.
I didn't realize that GSC didn't drive the compile/link phase.
Blake McBride
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2-Oct-06, at 12:12 PM, Blake McBride wrote:
That worked and I did get a good executable file. I had to link with gambc.lib, user32.lib and ws2_32.lib (two MS libs).
I don't get the whole "compile in the destination path" stuff. That means you have to re-build the whole thing whenever you want to move anything (like to a drive with more space). It also makes distributing Gambit a real pain (use my path or else...). Why don't you build with a default path and then use an environment variable to specify the Gambit home? That's how everyone else does it.
Including Gambit! Just read the Gambit-C manual page 21. The default installation directory is /usr/local/Gambit-C/VERSION, but this can be changed at build time. The environment variable that Gambit uses is called GAMBCOPT and it contains the runtime options that override the options that were used when the system was built. The runtime options on the command line (-:XXX) override the GAMBCOPT. In other words the value of a runtime option will be equal to
1) the value used at system build time 2) UNLESS the option is overriden by the GAMBCOPT environment variable 3) UNLESS the option is overriden by the -:XXX runtime option on the command line
Here's an example with Unix:
$ gsi -e '(pp (path-expand "~~"))' "/Users/feeley/Gambit-C/4.0b19/" $ export GAMBCOPT=d0,=/Users/feeley/foo $ gsi -e '(pp (path-expand "~~"))' "/Users/feeley/foo/" $ gsi -:=/Users/feeley/gambit -e '(pp (path-expand "~~"))' "/Users/feeley/gambit/"
With the GAMBCOPT approach you can change more than the Gambit installation directory. You can select the debugging level, the default file I/O encoding, etc.
You could add a trace in that script to echo the command that invokes the C compiler.
I didn't realize that GSC didn't drive the compile/link phase.
It is good to have an indirection through a script so that the user has the last word on how the C compiler is called (C compiler options, special paths, tracing, etc).
Marc
At 12:11 PM 10/2/2006, Marc Feeley wrote:
On 2-Oct-06, at 12:12 PM, Blake McBride wrote:
That worked and I did get a good executable file. I had to link with gambc.lib, user32.lib and ws2_32.lib (two MS libs).
I don't get the whole "compile in the destination path" stuff. That means you have to re-build the whole thing whenever you want to move anything (like to a drive with more space). It also makes distributing Gambit a real pain (use my path or else...). Why don't you build with a default path and then use an environment variable to specify the Gambit home? That's how everyone else does it.
Including Gambit! Just read the Gambit-C manual page 21. The default installation directory is /usr/local/Gambit-C/VERSION, but this can be changed at build time. The environment variable that Gambit uses is called GAMBCOPT and it contains the runtime options that override the options that were used when the system was built. The runtime options on the command line (-:XXX) override the GAMBCOPT. In other words the value of a runtime option will be equal to
- the value used at system build time
- UNLESS the option is overriden by the GAMBCOPT environment variable
- UNLESS the option is overriden by the -:XXX runtime option on the
command line
Here's an example with Unix:
$ gsi -e '(pp (path-expand "~~"))' "/Users/feeley/Gambit-C/4.0b19/" $ export GAMBCOPT=d0,=/Users/feeley/foo $ gsi -e '(pp (path-expand "~~"))' "/Users/feeley/foo/" $ gsi -:=/Users/feeley/gambit -e '(pp (path-expand "~~"))' "/Users/feeley/gambit/"
With the GAMBCOPT approach you can change more than the Gambit installation directory. You can select the debugging level, the default file I/O encoding, etc.
That is great that Gambit has those options. We could have avoided the whole issue by repeating your above comments on page 1 of the manual "Accessing The System". You shouldn't have to get to page 21 to figure out basic installation.
The main thing, however, which held me up was the error message "ERROR IN ##parameterize" when I had the directory path wrong. Since, as I would imagine, this could be a common error for new users, it would be great if the system detected the incorrect path and simply stated a clear message about the problem and, perhaps, some possible solutions.
This kind of stuff often seems obvious and an anal hassle to the author or experienced users but makes a big difference to new users who are trying to get up-to-speed quickly and evaluate a tool. Knowing, out of the gate, that problems are adequately described gives one confidence in the remainder of the tool.
Just some opinions. Gambit is a really great system!
Blake McBride