Page 1 of 1
NXC compiler optimisation level
Posted: 17 Jan 2011, 22:06
by h-g-t
Under the 'preferences' menu in Bricx Command Center there is a reference to the NXC compiler optimisation level. Am I correct in assuming that the higher the number the smaller the final program or does it refer to the speed of the compiled program?
When the brick is not attached and I have opted to save the compiler output, I get both .sym &.rxe files. Which (if any) of these two is the file to be stored in the brick? Sorry that this is so basic but I am new to this system, last time I programmed it was using Excel keystroke macros!
Re: NXC compiler optimisation level
Posted: 18 Jan 2011, 01:53
by afanofosc
Level 2 optimization is what I recommend that people use unless they run into an optimizer bug. There used to be a lot of level 2 bugs but most of them are gone now. Some probably do still remain. If you find one please let me know. Level 1 just removes unused functions and variables but does not fiddle around with the generated NBC otherwise. Level 0 leaves everything and the kitchen sink in (which is a lot). Levels greater than 2 don't really have any affect right now and should not be used.
The .rxe file is what gets sent to the brick. The .sym file is used by the BricxCC variable watch tool and the program pause/single step feature that is in BricxCC but requires that you are running the enhanced NBC/NXC firmware on your NXT (and is not, by any stretch, perfect or fully functional at this time). I used to delete .sym files but I changed it so that they are left behind so you can load a .sym file manually. Each time you compile a program BricxCC loads that programs sym file as the "current program" symbols.
John Hansen
Re: NXC compiler optimisation level
Posted: 18 Jan 2011, 04:12
by h-g-t
OK, thank you for an informative and prompt reply.