Opened 16 years ago

Last modified 14 years ago

#35 new enhancement

ABCL.Net.dll -- Using IKVM-patch to make ABCL run on .NET and MONO

Reported by: Douglas Miles Owned by: somebody
Priority: major Milestone: unscheduled
Component: other Version: 1.0
Keywords: ikvm Cc:
Parent Tickets:

Description

HOWTO:

First Patch the ABCL sources:

[root@titan abcl]# patch -p0 < svn11486-ikvm.patch
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/Complex.java
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/IkvmSite.java
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/Lisp.java
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/Load.java
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/Nil.java
(Stripping trailing CRs from patch.)
patching file src/org/armedbear/lisp/Pathname.java

Clean:
[root@titan abcl]# rm -rf build dist

Build ABCL:
[root@titan abcl]#ant abcl.dist
....

Download the latest binaries from http://ikvm.net
I use the "stable" ones: 0.36.0.11

Unzip the binaries to a $ABCL_HOME/bin/

Update MON_PATH:

export MONO_PATH=.:bin

Build the ABCL.Net.dll and abcl.exe
alias ikvmc='mono bin/ikvmc.exe '

[root@titan abcl]# ikvmc -compressresources -recurse:build/classes/ -out:ABCL.Net.dll
Note IKVMC0003: automatically adding reference to "/development/mirrors/ABCL-SVN/trunk/abcl/bin/IKVM.OpenJDK.ClassLibrary?.dll"

[root@titan abcl]# ikvmc -r:ABCL.Net.dll -main:org.armedbear.lisp.Main -out:abcl.exe
Note IKVMC0003: automatically adding reference to "bin/IKVM.OpenJDK.ClassLibrary?.dll"

Run it:

[root@titan abcl]# mono abcl.exe
Armed Bear Common Lisp 0.13.0-dev (built Fri Dec 26 2008 19:15:42 PST)
Java 1.6.0 Jeroen Frijters
IKVM.NET
Low-level initialization completed in 0.159 seconds.
Startup completed in 3.067 seconds.
Type ":help" for a list of available commands.
CL-USER(1): *FEATURES*
(:IKVM :X86 :JAVA-1.6 :ARMEDBEAR :ABCL :COMMON-LISP :ANSI-CL)

I use the following .dll in a C# project at http://code.google.com/p/opensim4opencog/source/detail?r=28

Have fun.. how soon can we just have this patch applied to ABCL src?

Attachments (2)

ikvm-existing.patch (5.2 KB) - added by Douglas Miles 16 years ago.
Svn 11486 ikvm patch
svn11486-ikvm.patch (14.3 KB) - added by Douglas Miles 16 years ago.
This path is for 11724 and includes the SVN Added of IkvmSite?.java

Download all attachments as: .zip

Change History (6)

comment:1 Changed 16 years ago by Douglas Miles

One note:

before invoking:
ikvmc -compressresources -recurse:build/classes/ -out:ABCL.Net.dll

Do this:
rm -f build/classes/org/armedbear/lisp/top-level.abcl
rm -f build/classes/org/armedbear/lisp/top-level*.cls

If you do not, there is a small problem when trying to jump to the toplevel stack frame introduced by the compiler that seems to be not present in the interpreter.

org.armedbear.lisp.Go

at org.armedbear.lisp.top_level_46._execute(top-level.lisp:439)
at org.armedbear.lisp.ClosureTemplateFunction?._execute

(ClosureTemplateFunction?.java:147)

at org.armedbear.lisp.CompiledClosure?.execute(CompiledClosure?.java:56)

so the above in fastforward mode it's:

patch -p0 < svn11486-ikvm.patch
rm -rf build dist
ant abcl.dist
#optional# export MONO_PATH=.:bin
#optional# alias ikvmc='mono bin/ikvmc.exe '
rm -f build/classes/org/armedbear/lisp/top-level.abcl
rm -f build/classes/org/armedbear/lisp/top-level*.cls
ikvmc -compressresources -recurse:build/classes/ -out:ABCL.Net.dll
ikvmc -r:ABCL.Net.dll -main:org.armedbear.lisp.Main -out:abcl.exe
mono abcl.exe

comment:2 Changed 16 years ago by Douglas Miles

Oh heck, just one more note:

Since some of us on win32/win64 I better show what DLLs are needed in the ABCL dir:

IKVM.Runtime.dll and IKVM.OpenJDK.ClassLibrary?.dll

Otherwise a MS Windows user gets an error:

T:\development\mirrors\ABCL-SVN\trunk\abcl>abcl.exe

Unhandled Exception: System.TypeInitializationException?: The type initializer for "java.lang.ExceptionHelper?" threw an exception. ---> System.IO.FileNotFoundException?: File or assembly name IKVM.Runtime, or one of its dependencies, was not found.
File name: "IKVM.Runtime"

at java.lang.ExceptionHelper?.SafeGetEnvironmentVariable?(String )
at java.lang.ExceptionHelper?..cctor()

SO they must
T:\development\mirrors\ABCL-SVN\trunk\abcl>copy bin\IKVM.OpenJDK.ClassLibrary?.dll .

1 file(s) copied.

T:\development\mirrors\ABCL-SVN\trunk\abcl>copy bin\IKVM.Runtime.dll .

1 file(s) copied.

T:\development\mirrors\ABCL-SVN\trunk\abcl>abcl.exe
Armed Bear Common Lisp 0.13.0-dev (built Fri Dec 26 2008 19:15:42 PST)
Java 1.6.0 Jeroen Frijters
IKVM.NET
Low-level initialization completed in 0.721 seconds.
Startup completed in 19.534 seconds.
Type ":help" for a list of available commands.
CL-USER(1):

And now they have a happy "native?" abcl.exe in Windows with no need for Java installed!

comment:3 Changed 16 years ago by Mark Evenson

Needs to be analyzed for incorporation into 0.13.

At a minimum it needs a sponsor with commit rights to ABCL svn. Takers?

Changed 16 years ago by Douglas Miles

Attachment: ikvm-existing.patch added

Svn 11486 ikvm patch

Changed 16 years ago by Douglas Miles

Attachment: svn11486-ikvm.patch added

This path is for 11724 and includes the SVN Added of IkvmSite?.java

comment:4 Changed 14 years ago by ehuelsmann

Milestone: 0.13unscheduled

Waiting for updated patch, given the amount of change on trunk, that would definitely be required. Switching to 'unscheduled': it's definitely not in 0.13 anymore.

Note: See TracTickets for help on using tickets.