2.3 Advanced Installation

2.3.3 Optimization

In the interest of successful compilation of a usable software package “out of the box,” the default configuration for OOMMF does not stretch to maximize optimization. However, the configuration files config/options.tcl and config/platforms/<platform>.tcl include optimization controls. In the former,

Oc_Option Add * Platform optlevel 2

selects a relatively high but robust level of optimization, equivalent typically to a compiler option of “-O2” or similar. You may try increasing optlevel to 3. If you are familiar with your compiler’s command line options, then for finer control you can experiment with the <platform>.tcl file options

  •             

    program_compiler_c++_remove_flags

  • and
  •             

    program_compiler_c++_add_flags

The remove flags control selects options to be removed from the compiler command line. The setting value should be a Tcl list of regular expressions. (Refer to the Tcl documentation on the regexp command for details.) The add flags value is a list of values to append to the compile command (applied after the remove flags request, if any). An extended discussion of these controls can be found in the “Configuration Files” section of the OOMMF Programming Manual.