swarm-support
[Top][All Lists]
Advanced

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

Re: arborgames complile


From: Li An
Subject: Re: arborgames complile
Date: Tue, 10 Dec 2002 12:25:10 -0500

Thanks. It worked well after I made changes to the step method in the associated .h and .m files and add #import <stdlib.h> in the species.m file. But there seems to be a little problem as suggested by the Werror below:

address@hidden arborgames-2.1]$ make
gcc3 -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=ar borgames -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Species.m /bin/sh /usr/bin/libtool-swarm --mode link gcc3 -g -O2 -march=i386 -mcpu=i686 -L/usr/lib/swarm -rpath /us r/lib/swarm -o arborgames SeedSpace.o Forest.o MatureForest.o YoungForest.o Spring.o Fire.o Tree.o Speci es.o ForestModelSwarm.o ForestObserverSwarm.o ForestBatchSwarm.o main.o -lswarm -lobjc gcc3 -g -O2 -march=i386 -mcpu=i686 -o arborgames SeedSpace.o Forest.o MatureForest.o YoungForest.o Spring .o Fire.o Tree.o Species.o ForestModelSwarm.o ForestObserverSwarm.o ForestBatchSwarm.o main.o -L/usr/lib /swarm /usr/lib/swarm/libswarm.so -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=wi th-hdf/src/space -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/analys is -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/simtoolsgui -L/home/ pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/simtools -L/home/pauljohn/Linux Downloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/random -L/home/pauljohn/LinuxDownloads/redhat /BUILD/swarm-2.1.140.20020514/=with-hdf/src/tkobjc -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1 .140.20020514/=with-hdf/src/tclobjc -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/= with-hdf/src/objectbase -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src /activity -L/home/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/defobj -L/hom e/pauljohn/LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/collections -L/home/pauljohn/ LinuxDownloads/redhat/BUILD/swarm-2.1.140.20020514/=with-hdf/src/misc -L/home/pauljohn/LinuxDownloads/red hat/BUILD/swarm-2.1.140.20020514/=with-hdf/libobjc -L/usr/lib -L/usr/X11R6/lib /usr/lib/swarm/libspace.so /usr/lib/swarm/libanalysis.so /usr/lib/swarm/libsimtoolsgui.so /usr/lib/swarm/libsimtools.so /usr/lib/sw arm/librandom.so /usr/lib/swarm/libtkobjc.so /usr/lib/swarm/libtclobjc.so /usr/lib/swarm/libobjectbase.so /usr/lib/swarm/libactivity.so /usr/lib/swarm/libdefobj.so /usr/lib/swarm/libcollections.so /usr/lib/swar m/libmisc.so -lBLT24 -ltk8.3 -ltcl8.3 -lXpm -lpng /usr/lib/libhdf5.so -lz -lX11 -lm -ldl /usr/lib/swarm/l ibobjc.so -lgcc -Wl,--rpath -Wl,/usr/lib/swarm -Wl,--rpath -Wl,/usr/lib/swarm -Wl,--rpath -Wl,/usr/lib -W
l,--rpath -Wl,/usr/X11R6/lib







  At 08:05 AM 12/10/2002 -0600, you wrote:
Interesting. I've not tried this one for a while. Now, with gcc3, we are getting warnings about many small errors that were ignored by gcc-2.96

Follow the error. Look at line 126 in Species.m.

Think to myself, "where is the compiler supposed to find the program "exit"?"

Hmm.

Lets go looking

 $ cd /usr/include
 $ grep exit s*

In that output I spot:

stdlib.h:extern void exit (int __status) __THROW __attribute__ ((__noreturn__));

So if at the top of Species.m, I insert an include for that, everything is OK:

#import <stdlib.h>

But then I was remembering that Swarm includes a "catch all" header file "misc.h" and it includes stdlib.h, so instead of using that import, you can also do:

#import <misc.h>

-----------------------


Now, to save you some trouble and another message to the list, here is what happens when the compile continues:

gcc3 -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=arborgames -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm ForestObserverSwarm.m
cc1obj: warnings being treated as errors
ForestObserverSwarm.m: In function `-[ForestObserverSwarm _drawGraphs:]':
ForestObserverSwarm.m:333: warning: multiple declarations for method `step'
ForestModelSwarm.h:35: warning: using `-step'
/usr/include/swarm/analysis.h:591: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:564: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:541: warning: also found `-(void)step'
ForestObserverSwarm.m:338: warning: multiple declarations for method `step'
ForestModelSwarm.h:35: warning: using `-step'
/usr/include/swarm/analysis.h:591: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:564: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:541: warning: also found `-(void)step'
ForestObserverSwarm.m:344: warning: multiple declarations for method `step'
ForestModelSwarm.h:35: warning: using `-step'
/usr/include/swarm/analysis.h:591: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:564: warning: also found `-(void)step'
/usr/include/swarm/analysis.h:541: warning: also found `-(void)step'
make: *** [ForestObserverSwarm.o] Error 1
make: Target `all' not remade because of errors.

Compilation exited abnormally with code 2 at Tue Dec 10 07:47:44

--------------------------------------

Note that in ForestModelSwarm.h, there is a method declared

-step;

But that does not match the declaration of step that we now have in the swarm libraries. You see in the error messages, the libraries have

- (void)step;

and you can't introduce a method with the same name unless the declaration is exactly the same.

-(void)step {
  int total, i ;

  total = 0 ;

  for(i = 0 ; i < speciesNumber ; i++)
    total += [[speciesList atOffset: i] getCount] ;

  for(i = 0 ; i < speciesNumber ; i++)
    [[speciesList atOffset: i] setTotalNumberOfTrees: total] ;

  //  return self ;
}


After making corresponding changes in several of the files in this package, I get a clean compile and it runs just the way I remember it.

I will put the fixed version up in ftp sometime soon, but why not try this on your own? If you try edit/compile in Emacs, it is easy work, and you will learn something.

Li An wrote:
Hi,
I tried to run make command at the arborgames-2.1 directory after I changed the SWARMHOME to /usr, but have the following warning--still a mismatch problem? how to fix the problem? Thanks. Li
address@hidden arborgames-2.1]$ make
gcc3 -c -g -O2 -march=i386 -mcpu=i686 -Wall -Wno-import -Wno-protocol -Werror -D_GNU_SOURCE -DAPPNAME=arborgames -DAPPVERSION=2.1 address@hidden -I/usr/include/swarm Species.m
cc1obj: warnings being treated as errors
Species.m: In function `-[Species getLevelAtAge:]':
Species.m:126: warning: implicit declaration of function `exit'
make: *** [Species.o] Error 1
Li An
Systems Modeling Lab

--
Paul E. Johnson                       email: address@hidden
Dept. of Political Science            http://lark.cc.ku.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700


                 ==================================
  Swarm-Support is for discussion of the technical details of the day
  to day usage of Swarm.  For list administration needs (esp.
  [un]subscribing), please send a message to <address@hidden>
  with "help" in the body of the message.

Li An
Systems Modeling Lab
Department of Fisheries and Wildlife
Michigan State University
East Lansing, MI 48824
Phone (Work): 517-353-7981
Fax: 517-432-1699


                 ==================================
  Swarm-Support is for discussion of the technical details of the day
  to day usage of Swarm.  For list administration needs (esp.
  [un]subscribing), please send a message to <address@hidden>
  with "help" in the body of the message.



reply via email to

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