Yo yo --
I'd like to get Meroon up in Gambit. I'm using Bradley Lucier's port, which seems to almost work. With the requisite (load "_meroon") in gambcini, I can use meroon in gsi. But gsc complains quite a bit:
$ gsc class.scm [ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] *** WARNING -- "Class-allocator" is not defined, *** referenced in: ("class.c") *** WARNING -- "Inlinable-Class-class" is not defined, *** referenced in: ("class.c") ... and so on.
The build succeeds, but the executable fails like so:
*** ERROR IN | class| -- Operator is not a PROCEDURE (#!unbound #!unbound)
Am I doing something wrong?
-- John
Afficher les réponses par date
On Feb 9, 2006, at 4:40 PM, John wrote:
Yo yo --
I'd like to get Meroon up in Gambit. I'm using Bradley Lucier's port, which seems to almost work. With the requisite (load "_meroon") in gambcini, I can use meroon in gsi. But gsc complains quite a bit:
$ gsc class.scm [ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] *** WARNING -- "Class-allocator" is not defined, *** referenced in: ("class.c") *** WARNING -- "Inlinable-Class-class" is not defined, *** referenced in: ("class.c") ... and so on.
The build succeeds, but the executable fails like so:
*** ERROR IN | class| -- Operator is not a PROCEDURE (#!unbound #!unbound)
Am I doing something wrong?
Well, it's kind of a pain to build a standalone executable with Meroon. ... When I just tried it I found out I didn't know how to do it, either. Here's how far I got, perhaps someone can finish it.
First you build _meroon, but keep .c files around.
euler-45% ./make_meroon <whatever>
Then you find out what the options are for compiling C code on your machine.
euler-45% cat `which gsc-cc-o` #! /bin/sh GSC_CC_O_ARG1=$1 shift GSC_CC_O_ARG2=$1 shift GSC_CC_O_ARG3=$1 shift gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 -fno- trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -rdynamic -shared -I${GSC_CC_O_ARG1}include - D___DYNAMIC -D___SINGLE_HOST -o ${GSC_CC_O_ARG2} $* ${GSC_CC_O_ARG3}
My application file is called linearalgebra.scm; compile it, link it with _meroon.c:
euler-55% gsc Gambit Version 4.0 beta 17
(load "_meroon")
[ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] "/export/users/lucier/programs/MeroonV3-2001Apr24/_meroon.o1"
(compile-file-to-c "linearalgebra")
#t
(link-incremental '("_meroon" "linearalgebra") "linearalgebra_.c")
Then I tried to compile it, but got
euler-69% gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule- insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame- pointer -fPIC -fno-common -mieee-fp -I/pkgs/Gambit-C/include -L/pkgs/ Gambit-C/lib -D___SINGLE_HOST _meroon.c linearalgebra.c linearalgebra_.c -o linearalgebra -lgambc -lm /tmp/ccXgPFhV.o(.text+0x8d1b3): In function `____20___meroon_2e_o1': : undefined reference to `___S_gambit' collect2: ld returned 1 exit status
I haven't built a standalone application with Meroon in years, sorry, I always do stuff like:
euler-72% gsc Gambit Version 4.0 beta 17
(load "_meroon")
[ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] "/export/users/lucier/programs/MeroonV3-2001Apr24/_meroon.o1"
(compile-file "linearalgebra")
#t
(load "linearalgebra")
#f64(4. 6.) "/export/users/lucier/programs/MeroonV3-2001Apr24/linearalgebra.o1"
On Feb 9, 2006, at 9:03 PM, Bradley Lucier wrote:
euler-69% gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule- insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame- pointer -fPIC -fno-common -mieee-fp -I/pkgs/Gambit-C/include -L/ pkgs/Gambit-C/lib -D___SINGLE_HOST _meroon.c linearalgebra.c linearalgebra_.c -o linearalgebra -lgambc -lm /tmp/ccXgPFhV.o(.text+0x8d1b3): In function `____20___meroon_2e_o1': : undefined reference to `___S_gambit' collect2: ld returned 1 exit status
For some reason it wasn't finding /pkgs/Gambit-C/lib/libgambc.a, this works:
euler-138% gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule- insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame- pointer -fPIC -fno-common -mieee-fp -I/pkgs/Gambit-C/include -L/pkgs/ Gambit-C/lib -D___SINGLE_HOST _meroon.o linearalgebra.c linearalgebra_.c -o linearalgebra /pkgs/Gambit-C/lib/libgambc.a -ldl - lutil -lm euler-139% ./linearalgebra [ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] #f64(4. 6.)
So you need to compile things that depend on meroon with compile-file interactively (I don't know why), and you need to link in _meroon.c with your other files:
euler-55% gsc Gambit Version 4.0 beta 17
(load "_meroon")
[ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] "/export/users/lucier/programs/MeroonV3-2001Apr24/_meroon.o1"
(compile-file-to-c "linearalgebra")
#t
(link-incremental '("_meroon" "linearalgebra") "linearalgebra_.c")
You can precompile _meroon.c to _meroon.o if you like.
Brad
Ah, that should do nicely! Thanks much Brad!
-- John
Bradley Lucier wrote:
On Feb 9, 2006, at 9:03 PM, Bradley Lucier wrote:
euler-69% gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -I/pkgs/Gambit-C/include -L/pkgs/Gambit-C/lib -D___SINGLE_HOST _meroon.c linearalgebra.c linearalgebra_.c -o linearalgebra -lgambc -lm /tmp/ccXgPFhV.o(.text+0x8d1b3): In function `____20___meroon_2e_o1': : undefined reference to `___S_gambit' collect2: ld returned 1 exit status
For some reason it wasn't finding /pkgs/Gambit-C/lib/libgambc.a, this works:
euler-138% gcc -Wall -W -Wno-unused -O1 -fno-math-errno -fschedule-insns2 -fno-trapping-math -fno-strict-aliasing -fwrapv -fomit-frame-pointer -fPIC -fno-common -mieee-fp -I/pkgs/Gambit-C/include -L/pkgs/Gambit-C/lib -D___SINGLE_HOST _meroon.o linearalgebra.c linearalgebra_.c -o linearalgebra /pkgs/Gambit-C/lib/libgambc.a -ldl -lutil -lm euler-139% ./linearalgebra [ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] #f64(4. 6.)
So you need to compile things that depend on meroon with compile-file interactively (I don't know why), and you need to link in _meroon.c with your other files:
euler-55% gsc Gambit Version 4.0 beta 17
(load "_meroon")
[ Meroon V3 Paques2001+1 $Revision: 1.1 $ ] "/export/users/lucier/programs/MeroonV3-2001Apr24/_meroon.o1"
(compile-file-to-c "linearalgebra")
#t
(link-incremental '("_meroon" "linearalgebra") "linearalgebra_.c")
You can precompile _meroon.c to _meroon.o if you like.
Brad