Discussion:
Compiling COLA on x86_64
(too old to reply)
Simon Forman
2013-10-11 01:14:27 UTC
Permalink
I checked out COLA from http://piumarta.com/svn2/idst/trunk and tried compiling but I encountered an error.

cp -p CodeGenerator-x86_64.st CodeGenerator-local.st
cp: cannot stat `CodeGenerator-x86_64.st': No such file or directory

There are CodeGenerator-*.st files for arm, i386, and ppc.

Perhaps this is due to compiling on a 64-bit system (Ubuntu linux)? Is there something simple I can do to the makefile to get it to work? A define maybe?

Warm regards,
~Simon
--
"The history of mankind for the last four centuries is rather like that of
an imprisoned sleeper, stirring clumsily and uneasily while the prison that
restrains and shelters him catches fire, not waking but incorporating the
crackling and warmth of the fire with ancient and incongruous dreams, than
like that of a man consciously awake to danger and opportunity."
--H. P. Wells, "A Short History of the World"
John Carlson
2013-10-11 01:18:56 UTC
Permalink
Symlink might help
Post by Simon Forman
I checked out COLA from http://piumarta.com/svn2/idst/trunk and tried
compiling but I encountered an error.
cp -p CodeGenerator-x86_64.st CodeGenerator-local.st
cp: cannot stat `CodeGenerator-x86_64.st': No such file or directory
There are CodeGenerator-*.st files for arm, i386, and ppc.
Perhaps this is due to compiling on a 64-bit system (Ubuntu linux)? Is
there something simple I can do to the makefile to get it to work? A
define maybe?
Warm regards,
~Simon
--
"The history of mankind for the last four centuries is rather like that of
an imprisoned sleeper, stirring clumsily and uneasily while the prison that
restrains and shelters him catches fire, not waking but incorporating the
crackling and warmth of the fire with ancient and incongruous dreams, than
like that of a man consciously awake to danger and opportunity."
--H. P. Wells, "A Short History of the World"
_______________________________________________
fonc mailing list
http://vpri.org/mailman/listinfo/fonc
John Carlson
2013-10-11 01:21:50 UTC
Permalink
Or just copy the i386 file to name it's expecting.
Post by John Carlson
Symlink might help
Post by Simon Forman
I checked out COLA from http://piumarta.com/svn2/idst/trunk and tried
compiling but I encountered an error.
cp -p CodeGenerator-x86_64.st CodeGenerator-local.st
cp: cannot stat `CodeGenerator-x86_64.st': No such file or directory
There are CodeGenerator-*.st files for arm, i386, and ppc.
Perhaps this is due to compiling on a 64-bit system (Ubuntu linux)? Is
there something simple I can do to the makefile to get it to work? A
define maybe?
Warm regards,
~Simon
--
"The history of mankind for the last four centuries is rather like that of
an imprisoned sleeper, stirring clumsily and uneasily while the prison that
restrains and shelters him catches fire, not waking but incorporating the
crackling and warmth of the fire with ancient and incongruous dreams, than
like that of a man consciously awake to danger and opportunity."
--H. P. Wells, "A Short History of the World"
_______________________________________________
fonc mailing list
http://vpri.org/mailman/listinfo/fonc
Simon Forman
2013-10-12 20:49:30 UTC
Permalink
Post by John Carlson
Or just copy the i386 file to name it's expecting.
Post by John Carlson
Symlink might help
I tried a symlink but that didn't get any further. It asked me to "please implement iflush()" :D

./idc -g -k -I../objects -c CodeGenerator-local.st -o CodeGenerator-local.o
In file included from asm-common.h:33:0,
from asm-i386.h:37,
from CodeGenerator-local.o.c:2218:
asm-cache.h:143:3: error: #error : please implement iflush() for your architecture,
asm-cache.h:144:3: error: #error : and EMAIL THE CODE to: ***@inria.fr

I wish I could. :)

I created a 32-bit virtual machine and tried compiling and got the following error message (also attached in case it gets mangled by email):

***@idst32:~/idst$ make
/bin/sh -ec 'for dir in object function; do ( cd $dir; make ); done'
make[1]: Entering directory `/home/sforman/idst/object'
/bin/sh -ec '( cd st80; make IDC="../boot/idc -B../boot/ -O" BIN="../stage1/" )'
make[2]: Entering directory `/home/sforman/idst/object/st80'
../boot/idc -B../boot/ -O -k -c _object.st -o ../stage1/_object.o
/home/sforman/idst/object/st80/../boot/st80.so: /home/sforman/idst/object/st80/../boot/st80.so: undefined symbol: sin

import: st80.so: No such file or directory

make[2]: *** [../stage1/_object.o] Error 1
make[2]: Leaving directory `/home/sforman/idst/object/st80'
make[1]: *** [stage1/st80.so] Error 2
make[1]: Leaving directory `/home/sforman/idst/object'
make: *** [all] Error 2



I'm guessing the "undefined symbol: sin" is causing the failure to import st80.so..?


Any advice would be welcome. :)
--
"The history of mankind for the last four centuries is rather like that of
an imprisoned sleeper, stirring clumsily and uneasily while the prison that
restrains and shelters him catches fire, not waking but incorporating the
crackling and warmth of the fire with ancient and incongruous dreams, than
like that of a man consciously awake to danger and opportunity."
--H. P. Wells, "A Short History of the World"
Ian Piumarta
2013-10-12 21:12:11 UTC
Permalink
Simon,

Sorry for the late intervention. The error is from a missing math library (-lm in the link command) which contains the sin() function.

I will set up a 64-bit Ubuntu VirtualBox and fix whatever is broken. If I haven't done this by midweek then please do feel free to remind me.

It will all have to run in 32 bits, though, since there is no 64-bit code generator for idst/jolt. It should be possible to do this within a 64-bit environment.

FWIW, I believe all Intel (and AMD) descendants of 8086 implement I/D cache coherency in hardware and so iflush() is a no-op. But the symlink is not quite the right approach anyway. We'll do better by persuading the code that it is being compiled for x86.

Regards,
Ian
Post by Simon Forman
Post by John Carlson
Or just copy the i386 file to name it's expecting.
Post by John Carlson
Symlink might help
I tried a symlink but that didn't get any further. It asked me to "please implement iflush()" :D
./idc -g -k -I../objects -c CodeGenerator-local.st -o CodeGenerator-local.o
In file included from asm-common.h:33:0,
from asm-i386.h:37,
asm-cache.h:143:3: error: #error : please implement iflush() for your architecture,
I wish I could. :)
/bin/sh -ec 'for dir in object function; do ( cd $dir; make ); done'
make[1]: Entering directory `/home/sforman/idst/object'
/bin/sh -ec '( cd st80; make IDC="../boot/idc -B../boot/ -O" BIN="../stage1/" )'
make[2]: Entering directory `/home/sforman/idst/object/st80'
../boot/idc -B../boot/ -O -k -c _object.st -o ../stage1/_object.o
/home/sforman/idst/object/st80/../boot/st80.so: /home/sforman/idst/object/st80/../boot/st80.so: undefined symbol: sin
import: st80.so: No such file or directory
make[2]: *** [../stage1/_object.o] Error 1
make[2]: Leaving directory `/home/sforman/idst/object/st80'
make[1]: *** [stage1/st80.so] Error 2
make[1]: Leaving directory `/home/sforman/idst/object'
make: *** [all] Error 2
I'm guessing the "undefined symbol: sin" is causing the failure to import st80.so..?
Any advice would be welcome. :)
--
"The history of mankind for the last four centuries is rather like that of
an imprisoned sleeper, stirring clumsily and uneasily while the prison that
restrains and shelters him catches fire, not waking but incorporating the
crackling and warmth of the fire with ancient and incongruous dreams, than
like that of a man consciously awake to danger and opportunity."
--H. P. Wells, "A Short History of the World"<make-error.text>_______________________________________________
fonc mailing list
http://vpri.org/mailman/listinfo/fonc
Simon Forman
2013-10-19 01:44:51 UTC
Permalink
Post by Ian Piumarta
Simon,
Sorry for the late intervention. The error is from a missing math
library (-lm in the link command) which contains the sin()
function.
I will set up a 64-bit Ubuntu VirtualBox and fix whatever is
broken. If I haven't done this by midweek then please do feel
free to remind me.
It will all have to run in 32 bits, though, since there is no 64-
bit code generator for idst/jolt. It should be possible to do
this within a 64-bit environment.
FWIW, I believe all Intel (and AMD) descendants of 8086 implement
I/D cache coherency in hardware and so iflush() is a no-op. But
the symlink is not quite the right approach anyway. We'll do
better by persuading the code that it is being compiled for x86.
Regards,
Ian
No rush. I'm just tinkering. :) I tried a couple of simple things but I don't really know what I'm doing and none of it worked. It's been a long time since I've worked with C.
Ian Piumarta
2013-10-20 16:37:54 UTC
Permalink
Simon,

Sorry for the slightly late fixes. Please svn update your idst sources and then "make clean" in the top-level directory.

On 32-bit Linux make sure you have the packages libreadline-dev and execstack installed.
Then type "make" in the top-level directory.
This will build the st80 libraries for id, the idst compiler 'idc' and Jolt.

On 64-bit Linux make sure you have the packages lib32readline6-dev (or similar) and execstack installed.
Then type "make TARGET=x86_32-pc-linux" in the top-level directory.
This will build the st80 libraries for id, the idst compiler 'idc' and a 32-bit version of Jolt that can execute its own dynamic code on a 64-bit Linux system.

If your Linux does not install execstack in /usr/sbin you may have to tweak function/jolt-burg/Makefile in the obvious way.

The VPU version of Jolt is no longer built by default, so...
'cd' to function/jolt-burg and then type "./main".
At the prompt, typing "(+ 3 4)" should give you back a "7".

I've tested this on 32- and 64-bit versions of Linux Mint.

Hope that helps.

(We are certainly not alone in thinking the compiler should be part of many a language runtime system. :)

Regards,
Ian
Post by Simon Forman
Post by Ian Piumarta
I will set up a 64-bit Ubuntu VirtualBox and fix whatever is
broken. If I haven't done this by midweek then please do feel
free to remind me.
It will all have to run in 32 bits, though, since there is no 64-
bit code generator for idst/jolt. It should be possible to do
this within a 64-bit environment.
No rush. I'm just tinkering. :) I tried a couple of simple things but I don't really know what I'm doing and none of it worked. It's been a long time since I've worked with C.
From what I understand of how the COLA works I'm really blown away. The VPU alone is very impressive. I'm beginning to think that anyone who isn't using a COLA-style self-hosted system (with native code compilation!) is just punishing themselves.
Karl
2013-10-20 21:08:09 UTC
Permalink
Post by Ian Piumarta
On 64-bit Linux make sure you have the packages lib32readline6-dev (or similar)
and execstack installed.
Post by Ian Piumarta
Then type "make TARGET=x86_32-pc-linux" in the top-level directory.
This will build the st80 libraries for id, the idst compiler 'idc' and a 32-bit version of
Jolt that can execute its own dynamic code on a 64-bit Linux system.
Post by Ian Piumarta
If your Linux does not install execstack in /usr/sbin you may have to tweak
function/jolt-burg/Makefile in the obvious way.
Post by Ian Piumarta
The VPU version of Jolt is no longer built by default, so...
'cd' to function/jolt-burg and then type "./main".
At the prompt, typing
"(+ 3 4)" should give you back a "7".
I've tested this on 32- and 64-bit versions of Linux Mint.
Hope that helps.
(We are certainly not alone in thinking the compiler should be part of many a
language runtime system. :)
Post by Ian Piumarta
Regards,
Ian
Thanks for the fix. It works on Fedora 19 using the readline-devel.i686 package and
changing the execstack path to /usr/bin/.

The wiki mentions a Git mirror at git://fig.org, but this has been unreachable over the
last 24 hours. When was the last time anyone used this mirror?


-Karl
Simon Forman
2013-10-22 01:04:16 UTC
Permalink
Post by Ian Piumarta
Simon,
Sorry for the slightly late fixes. Please svn update your idst
sources and then "make clean" in the top-level directory.
On 32-bit Linux make sure you have the packages libreadline-dev
and execstack installed.
Then type "make" in the top-level directory.
This will build the st80 libraries for id, the idst compiler 'idc' and Jolt.
On 64-bit Linux make sure you have the packages lib32readline6-dev
(or similar) and execstack installed.
Then type "make TARGET=x86_32-pc-linux" in the top-level directory.
This will build the st80 libraries for id, the idst compiler 'idc'
and a 32-bit version of Jolt that can execute its own dynamic code
on a 64-bit Linux system.
If your Linux does not install execstack in /usr/sbin you may have
to tweak function/jolt-burg/Makefile in the obvious way.
The VPU version of Jolt is no longer built by default, so...
'cd' to function/jolt-burg and then type "./main".
At the prompt, typing
"(+ 3 4)" should give you back a "7".
I've tested this on 32- and 64-bit versions of Linux Mint.
Hope that helps.
(We are certainly not alone in thinking the compiler should be
part of many a language runtime system. :)
Regards,
Ian
Thank you so much Ian! I installed lib32readline6-dev and execstack and the updated code compiled fine. :) This is awesome.
Cheers,
~Simon

Continue reading on narkive:
Loading...