Hi Patrik,

Going by your example code, this should very definitely not pose any problem, 
Gecode itself uses way more elaborate constructions with patterns.

One reason for the problem could be the part you do not tell us: if you have 
code that uses a lot of inlining, then that could be a problem.


Otherwise, that particular version of gcc might be at fault. As I do not use 
gcc that much I don't know whether this version is a bad one.

Cheers
Christian

--
Christian Schulte, www.ict.kth.se/~cschulte/

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrik Haslum
Sent: Thursday, November 20, 2008 9:26 AM
To: [EMAIL PROTECTED]
Subject: [gecode-users] compiler memory problem


Hi,

I've written a custom propagator. It is based on one of the existing templates, 
Gecode:BinaryPropagator, with an array of boolean views as the template 
argument. It works, but the compiler (g++ 4.1.2) is having serious trouble with 
the code: if I try to use any compiler optimisation (that is, anything other 
than -O0), the compiler eats up all memory (including swap) and never finishes. 
I know that using many and/or nested templates tends to increase compiler 
memory use, but this case is worse than anything I've encountered before. Is 
this a known problem? 
(perhaps fixed in some more recent g++ compiler). Is there some way to work 
around it? (other than disabling compiler optimisation, because that *really* 
slows down the solver). The only other option I can think of is to write the 
propagator from scratch, without relying on any base template.

Attached is a simplified version of the code (it doesn't contain any actual 
functionality, just the minimum that is needed to cause the compiler to behave 
this way).

Thanks,
                        /[EMAIL PROTECTED]


_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to