swarm-support
[Top][All Lists]
Advanced

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

Re: [Swarm-Support] Swarm on Mac


From: David Camacho Trujillo
Subject: Re: [Swarm-Support] Swarm on Mac
Date: Tue, 06 Feb 2007 08:12:11 +0100 (CET)
User-agent: IMP/PHP IMAP webmail program 2.2.8

Mensaje citado por: Bill Northcott <address@hidden>:

> On 06/02/2007, at 10:20 AM, David Camacho Trujillo wrote:
> > I use to work with Swarm under Linux, (some time under windows) and  
> > my model
> > runs fine. Recently I have installed Swarm on a Intel Mac (Intel  
> > Core Duo)
> > following the instructions on the wiki (many thanks to Bill  
> > Northcott, I just
> > will suggest to include the prerequisite of run X11 before run any  
> > application,
> > as you already explain in this mailing list) and the swarmapps runs  
> > fine also.
> > But now my application (Objective-c code) does not compile.
> > The output is:
> >
> > make gamodel
> > gcc -B ../../tools -c -g -O2 -Wno-long-double -B /tools -fgnu-runtime
> > -fno-strict-aliasing -Wall -Wno-import -Wno-protocol -Wno-long- 
> > long  -arch ppc
> > -D_GNU_SOURCE -DAPPNAME= -DAPPVERSION=2.2 - 
> > address@hidden
> > -I/usr/local/swarm2.2/include  BinChrom.m
> > BinChrom.m:9:20: error: malloc.h: No such file or directory
> > BinChrom.m: In function '-[BinChromosome setLength:]':
> > BinChrom.m:23: warning: pointer targets in assignment differ in  
> > signedness
> > BinChrom.m: In function '-[BinChromosome Clone:withMutation:]':
> 
> The warnings mean what they say, and I think you should change your  
> code to eliminate them.  Recent versions of gcc give more warnings  
> than old ones but they are better investigated.
> 
> The problem preventing the compile is
> > BinChrom.m:9:20: error: malloc.h: No such file or directory
> 
> You code should not be trying to include or access malloc.h.  As per  
> K&R all the utility functions are in stdlib.h.  Can you send the  
> first ten lines or so of BinChrom.m and its header if there is one.
> 
> Bill Northcott
> _______________________________________________
> Support mailing list
> address@hidden
> http://www.swarm.org/mailman/listinfo/support
> 

Many thanks Bill!

You are right,
Here is the code:
// Copyright ? 1995-2000 Swarm Development Group.
// No warranty implied, see LICENSE for terms.


#import "BinChrom.h"
#include <sys/types.h>
#include <malloc.h>
#include <random.h>

   unsigned char Wgts[9] = { 0,128,64,32,16,8,4,2,1 };
                                   // 1st number does not mind
    @implementation BinChromosome


   // Creating--------------------------------------------

This is an “old” code from another user contribution. It is a GA  (Breeder2.1) I
am working with,  and I did not feel confident enough to change it since it was
running fine under the other architectures.  Now I put "stdlib.h" instead and
compiles, but seems like I need to update more code, now says:

./gamodel
Version -1599647552 doesn't match runtime protocol version 2
Abort trap

 I found on the archives that,as far as I understood, this is a problem of
incompatibility with the Mac OS, but under Java. Is here also the same problem?
(My code is Objective-c)
David






reply via email to

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