﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3488	Vendor-specific annotations for advanced flags and options	Francesco Casella	Lennart Ochel	"Testing is essential to guide the development of new advanced features in the OMC. This requires setting compiler/simulation flags, which might be specific to an entire library, or possibly just to single models. 

It is much easier for all people involved in the process if these flags are specified once in the model source code as an annotation, instead of requiring to set up test-scripts/hudson flags/command line flags/OMEdit options or other heterogeneous and exotic means. The rationale is that there is only one Modelica source code but many ways to execute it (including the automated test suites), so the options should be specified in the source code and only there.

On the other hand, the ultimate goal is to set up the OMC so that it makes the best choices automatically. It should then be possible to enable/disable all these advanced settings annotations at once by just setting one global flag, so that it is very easy to compare the performance one can get with the ad-hoc flags to the performance obtained by a plain vanilla compilation of the same test suite.

Based on these requirements, I would propose introducing the annotation {{{__OpenModelica_setCommandLineOptions(<String>)}}}. When applied to a package, it is automatically propagated to all models in the package. If a sub-package has another such annotation, it overrides the one of the container package. When applied to a model, it is used for compiling and simulating that model, and overrides any package annotations. This is a very flexible mechanism, it is based on the well-documented omc flags, and works at the source-code level.

I would also propose introducing yet another OMC flag {{{--useCommandLineAnnotations}}} (Boolean, default: true), that could be used to disable all such annotations and see how the plain vanilla compiler works on a given model or library with default settings.

The only thing which is still unclear to me is how to combine these command line options specified by annotations with other command line options that are given when invoking OMC at the command line or through the API. For instance, one might want to additionally turn on profiling, or enable some logging for debugging purposes. It would be nice if the two can be merged somehow, without losing either one. In case of conflict, I guess the options set when invoking OMC should override the ones specified by the annotations.

"	enhancement	closed	high		Frontend		fixed		Adrian Pop
