Slow Compiler

Use this forum to post Vensim related questions.
Post Reply
wsp
Junior Member
Posts: 5
Joined: Tue Jun 22, 2010 10:41 am

Slow Compiler

Post by wsp »

Hi,

Recently I started using the Microsoft Visual C++ 2008 Express compiler to compile my model. Previously I was using Visual studio 6.0. The compile time has gone up from seconds to minutes. Has anyone else experienced this and does anyone have any tips on what might be causing it?

Thanks
Will

[Edited on 6-22-2010 by wsp]

[Edited on 6-22-2010 by wsp]
Administrator
Super Administrator
Posts: 4841
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

I noticed this as well.

I got around it by turning off the optimisation switch on the command line.

If you edit MDL.BAT and search for "CL " you will see two lines
CL /O2 /c /I "%2" /DWIN32 mdl.c
CL /O2 /c /DWIN32 mdl.c

I think I just removed the /O2. It compiled in seconds and was still pretty fast.

Tony.
wsp
Junior Member
Posts: 5
Joined: Tue Jun 22, 2010 10:41 am

Post by wsp »

Tony,

Thanks for the reply. I tried removing the optimisation and although it sped up the compilation, it meant that the subsequent model runtime was much slower and so there wasn't an overall saving. Maybe I should load an old version of the compiler. Anyone else have any tips?

Will
Administrator
Super Administrator
Posts: 4841
Joined: Wed Mar 05, 2003 3:10 am

Post by Administrator »

Do you still have the VC 6 compiler installed?
wsp
Junior Member
Posts: 5
Joined: Tue Jun 22, 2010 10:41 am

Post by wsp »

No. And I think we only have one license, whereas we have multiple copies of Vensim. I'm not sure if there's somewhere you can download the old versions of express compiler (or if they work on Windows 7)
tomfid
Administrator
Posts: 3995
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

It might be worth trying the 2010 version. I know Bob had to skip a couple of versions of visual studio because he couldn't get Vensim to compile properly.

Tom
wsp
Junior Member
Posts: 5
Joined: Tue Jun 22, 2010 10:41 am

Post by wsp »

I tried this today and it seems to take about the same amount of time to compile. Looks like I will have to try and go back to Studio 6.0 or maybe try the gcc compiler
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

If you go to Tools>Options>Advanced there is an entry called "Variable count for function breaks is."

The default value for this is 100 and normally works reasonably well with the newer Microsoft compilers which attempt more global code optimization. If you have models that contain complicated formulas, or many equations per variable, lowering this might help.

You might also just change the optimization option from /O2 to /O1 (and experiment with some of the other variations on that as there are quite a number in the newer MS compilers).
wsp
Junior Member
Posts: 5
Joined: Tue Jun 22, 2010 10:41 am

Post by wsp »

Thanks. I will investigate this sometime this week.
Post Reply