Re: [eclipse-clp-users] compact eclipse platform

From: Joachim Schimpf <joachim.schimpf_at_infotech.monash.edu.au>
Date: Wed, 30 Dec 2009 23:35:29 +1100
  luke2k4_at_gmail.com wrote:
> Hi All,
> I am writing to ask if there is a convenient way to compile a set of 
> eclipse libraries into one assembly that could be loaded at start-up of 
> the eclipse engine ?
> I would like the platform to be as compact as possible containing only 
> the necessary libraries compiled in one libs_all.eco file which would be 
> loaded at eclipse start-up..
> 
> I've tried the following approach:
> I've loaded the solver and therefore all necessary libraries got loaded.
> Than used a short eclipse script to:
> 
>    1. get a list of all compiled files
>    2. filter out those that belong to the solver ( leaving only the
>       library files belonging to the platform )
>    3. concatenate the files to one lib_all.ecl
>    4. compile lib_all.ecl to lib_all.eco
> 
> than use the lib_all when starting eclipse.exe with -b option , or 
> better to include the assembly when running the eclipse via the c interface.
> I am running into some problems during point 4.
> 
> I would be grateful if someone could let me know if there is an easy way 
> to prepare such a compact eclipse platform.
> 
> Best regards
> Luke


Hi Luke,

similar to the situation with Java, you need a directory with a minimum
of runtime environment to execute ECLiPSe code.  For an embedded ECLiPSe,
this minimum consists of the following 6 files (for version 6.0)

<eclipsedir>/lib/$ARCH/libeclipse.so    (or eclipse.dll on Windows)
<eclipsedir>/lib/$ARCH/libgmp.so        (or gmp33.dll on Windows)
<eclipsedir>/lib/eclipse_language.eco
<eclipsedir>/lib/kernel.eco
<eclipsedir>/lib/suspend.eco
<eclipsedir>/lib/version.pl

This minimun runtime contains neither compiler nor toplevel, but
you can load .eco files and execute goals via the C/C++ interface.

If you want to run a command-line eclipse, you need in addition

<eclipsedir>/lib/$ARCH/eclipse.exe

Assuming I'm in <eclipsedir> on my x86_64_linux machine, I can then run e.g.

% LD_LIBRARY_PATH=lib/x86_64_linux:$LD_LIBRARY_PATH lib/x86_64_linux/eclipse.exe -D . -e 
"writeln(hello)"
hello

Again, this contains neither a compiler nor a toplevel, but you can
load your application as a .eco file with the -b option, and use -e
to execute your main goal.

Your real application will most likely need more libraries.  You
can find out which by calling current_compiled_file/3 when
everything is loaded.  Then copy the relevant .eco files into
the lib directory of your compact ECLiPSe runtime directory.

As for combining things into a single .eco file:
It is actually possible to simply concatenate different .eco file
in the same way you can concatenate source files.  However, the
use_module mechanism currently expects that modules are loaded
from their own files, so this technique currently won't work
well with libraries that are loaded using lib/1 or use_module/1.
As there is not really a big advantage to having a single .eco
file (as compared to a lib/ directory with several of them)
I would not waste time trying to make this work.


-- Joachim
Received on Wed Dec 30 2009 - 15:35:46 CET

This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET