swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] Followup: found work-around for missing~/swarmarchiv


From: Paul Johnson
Subject: Re: [Swarm-Support] Followup: found work-around for missing~/swarmarchiver.scm too
Date: Tue, 15 Aug 2006 13:42:22 -0500
User-agent: Thunderbird 1.5.0.5 (X11/20060808)

Pietro Terna wrote:
         Hi Paul and all,

         a few notes about Paul's communication reported below.

1.

Using the rpm distribution for Fedora 5 we have also problems in instance creation via lispAppAchiver:

e.g. "heatbugs -b" (for batch execution) fails.

In ObjC we can fix the problem as follow (//pj line is from Paul's suggestion below; //pt one is mine

(file main.m of heatbugs)

int
main (int argc, const char **argv)
{
   id theTopLevelSwarm;

   // Swarm initialization: all Swarm apps must call this first.
   initSwarm (argc, argv);

lispArchiver = [LispArchiver create: globalZone setPath: "/home/terna/.swarmArchiver.scm"]; //pj lispAppArchiver = [LispArchiver create: globalZone setPath: "heatbugs.scm"]; //pt

2.

The .swarmArchiver.scm file created in the way above is not standard, lacking a part of the Scheme expression, with the application name etc.

Since I wrote the first message, I've learned a slightly different work-around that solves the problems with .swarmArchiver.scm

lispArchiver = [[[[[LispArchiver createBegin: globalZone]
                       setDefaultPath]
                      setSystemArchiverFlag: YES]
                     setInhibitLoadFlag: NO]
                    createEnd];

That just copies the syntax out of the Swarm source and it does save window positions now.

I still do not understand why lispArchiver is not being created inside initSwarm, but feel CERTAIN that it links back to this behavior in gcc related to messages to nil and other little problems that are really starting to make me mad. I need to make models of stuff, not fuss over the compiler. But it appears the gods of GNU would have it otherwise.

Yesterday I was bug shooting a problem in and older FC4 and found that gcc treats 50 differently than 50.0 when used as a (double) parameter in a draw from a normal distribution, and the value 50 was converted to 0. It does not do that anymore in FC5.

But I ask you this. If those people who make gcc can cause havoc with a little thing like the handling of the number 50, what devistation can they wreak when they start talking about executable stacks, trampolines, and other abstractions that I can barely grasp.


3.

I tried to introduce the same correction also in jheatbugs (the Java version has the same init problems). Look at the lines below (//pt lines are mine)

(file StartHearbugs.java)

import swarm.Globals;
import swarm.defobj.LispArchiverImpl; //pt

public class StartHeatbugs {

     public static void main (String[] args) {


Globals.env.initSwarm ("jheatbugs", "2.1", "address@hidden", args);

        Globals.env.lispArchiver= new LispArchiverImpl(Globals.env.globalZone,
"~/.swarmArchiver.scm"); //pt 1 Globals.env.lispAppArchiver = new LispArchiverImpl(Globals.env.globalZone, "jheatbugs.scm");//pt 2

the '//pt 2' correction works perfectly; the 'pt 1' has no effects, as something had gone definitively wrong in the init step.

         Yours, Pietro

At 08.17 13/07/2006, you wrote:
Concerning the point that the window geometries are not saved anymore, I have a work around.

Recall the problem is that lispArchiver is not created. If you debug in main.m, of any swarm app, you'll find "lispArchiver" is not created by initSwarm (at least on Fedora Core Linux).

The global variable "lispArchiver" is defined, but it is nil. So just put in this one line in main.m:

lispArchiver = [LispArchiver create: globalZone setPath: "/tmp/swarmArchiver.scm"];

Run the model, hit the "save" button,and the settings are saved into /tmp/swarmArchiver.scm.

Still don't know the reason why gcc-4.1 (or something else in FC5 broke), but I'm starting to suspect I may figure it out someday. In Heatbugs, I find that inserting this line after initSwarm will cause the saving and recovering to work as it did before.


lispArchiver = [LispArchiver create: globalZone
          setPath: "/home/pauljohn/.swarmArchiver.scm"];

I fiddled around with ways to automate the retrieval of my HOME directory. But all the ways I try cause a seg fault. So I'll spare you.

pj


--
Paul E. Johnson                       email: address@hidden
Professor, Political Science          http://pj.freefaculty.org
1541 Lilac Lane, Rm 504
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700

_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


_______________________________________________
Support mailing list
address@hidden
http://www.swarm.org/mailman/listinfo/support


--
Paul E. Johnson                       email: address@hidden
Professor, Political Science          http://pj.freefaculty.org
1541 Lilac Lane, Rm 504 University of Kansas Office: (785) 864-9086
Lawrence, Kansas 66044-3177           FAX: (785) 864-5700



reply via email to

[Prev in Thread] Current Thread [Next in Thread]