[Ecls-list] Dumping running image

Gabriel Dos Reis gdr at cs.tamu.edu
Sun Mar 11 10:25:04 UTC 2007


"Juan Jose Garcia-Ripoll" <jjgarcia at users.sourceforge.net> writes:

| 10 Mar 2007 18:28:26 -0600, Gabriel Dos Reis <gdr at cs.tamu.edu>:
| >   Is there a way in ECL to dump the current image to disk as
| > standalone executable?  My apologies if this is an FAQ.
| > I tried fiddling with c:build-program and epilogue-code but it was
| > getting messy with no success.
| 
| There is not such thing as dumping, because of the way ECL builds
| itself. But that is not the answer to your problem.

Ah, it is a partial answer to my problem :-)
It is good for me to know that, so at this point I can suspend my efforts
on ECL, make progress on other fronts, and return to ECL later.

| >   Is there a way in ECL to dump the current image to disk as
| > standalone executable?  My apologies if this is an FAQ.
| > I tried fiddling with c:build-program and epilogue-code but it was
| > getting messy with no success.
|
| Well, it is not that messy if you do things right: just compile all
| files you want to load, in the order in which you want to load them,
| and then pass the name of the object files to c::build-program.

In the system I'm working with, I have the following scenario:

   (I) one part does the following:
      (1) the system defines some macros
      (2) those macros need to be present in the environment while
          compiling the rest of the files.
      (3) with GCL, SBCL, CLISP the system builds fine as follows:
          (a) load the macros in a fresh lisp.
          (b) save the current image to disk.
          (c) use that image to compile the rest of the files.
          (d) use that image to load all objects and build the
              final executable.

  (II) another part does this for bootstrapping:
      (1) start with loading macros
      (2) for each file in a component II:
          (a) compile the lisp file to object code
          (b) load the just compiled object code
      (3) save the resulting image to disk.

for timing constraints, it is important that the loading of object
files doe not go from linear to quadratic.

I tried disrupting the working  setting for the three other lisps, by
laoding the macros before compiling each file

| epilogue-code is a lisp form you want to execute in the environment
| _after_ those object files have been activated. If you were more
| specific perhaps one could help you solve the issues you have with
| this.

Yes, I'm trying to isolate and reduce the problems I'm having with
using ECL to build the system... 

|
| In any case, Fare has talked here about an utility called cl-launch.
| You might want to look at it, because it does what you want,
| abstracting the steps for different implementations.

Yes, Faré effectively mentioned that to me yesterday; I took a look at
it and at this moment it would not help me much.  In particular, if I
understand cl-launch correctly is does not support ECL for dumping
current images.  Furthermore, because the system is quite old (~ 30 years)
and is heavily GCL-2.6.8-pre based, I still need to deal with all the
different implementation details, and cl-launch does not try to solve
all portability problems (a good thing!).

| Another alternative is using ASDF + build-program in a special purpose
| routine created by M. Goffioul,
| http://ecls.sourceforge.net/new-manual/re02.html  But since you do not
| like build-program, I doubt you will have much fun with it :-)

Many thanks for the link.
My issue has nothing to do with my liking or disliking build-program :-)
I'm just trying to see whether I could use ECL to build the system.
The system is not prepared at this point to use ASDF; it uses Autoconf
and regular Makefiles, and I'm making an incremental update.

I very much appreciate your answers.

[ If it were up to my liking I would be using a different language,
   but I don't have that luxury with the system, at this moment :-) ]

-- Gaby

-- 
                                                        Gabriel Dos Reis
                                                         gdr at cs.tamu.edu
	Texas A&M University -- Department of Computer Science
	301, Bright Building -- College Station, TX 77843-3112




More information about the ecl-devel mailing list