Opened 7 years ago
Closed 7 years ago
#5044 closed defect (fixed)
Choice of C compiler on OMEdit under Linux is currently confusing
| Reported by: | Francesco Casella | Owned by: | Adeel Asghar |
|---|---|---|---|
| Priority: | high | Milestone: | 1.14.0 |
| Component: | OMEdit | Version: | |
| Keywords: | Cc: | albertoleva, Adrian Pop |
Description
OMEdit under Linux uses clang to compile C code, which makes it very fast, BTW. However, Tools|Options|Simulation|Target compiler shows a list of compilers including gcc and various MSVC flavours, which obviously do not apply in that case, while not mentioning clang at all.
I hardly see any reason to still use gcc on Linux, since clang works much faster and is the only option we use for all our testing, so a quick fix would be to just remove that choice entirely from the option window in the Linux version.
If there is any reason to still give the choice between gcc and clang (e.g. for library dependency in some cases using external statically compiled code?), then the choices menu should correspond to what actually happens once you click the simulate button.
I guess the situation is similar with MacOS, but I cannot verify it myself.
Change History (7)
comment:1 by , 7 years ago
| Cc: | added |
|---|
comment:2 by , 7 years ago
| Cc: | added |
|---|
comment:3 by , 7 years ago
Possibly add a button somewhere to check if the selected compiler is actually installed and works properly
comment:4 by , 7 years ago
The compiler has always been changed via setCompiler; the target option changes the kind of makefile / VS project is generated. clang is GCC-compatible and uses the same target.
comment:7 by , 7 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |

The
targetoptions are retrieved fromomcviagetConfigFlagValidOptionsAPI which returns,>> getConfigFlagValidOptions("target") ({"gcc","msvc","msvc10","msvc12","msvc13","msvc15","vxworks69","debugrt"},"Sets the target compiler to use.",{})regarless of the platform.
The value is actually extracted from flag declaration,
constant ConfigFlag TARGET = CONFIG_FLAG(5, "target", NONE(), EXTERNAL(), STRING_FLAG("gcc"), SOME(STRING_OPTION({"gcc", "msvc","msvc10","msvc12","msvc13","msvc15", "vxworks69", "debugrt"})), Util.gettext("Sets the target compiler to use."));Not sure how we can make this platform aware. One idea is to use the multiple declarations of the flag using ifdef for each platform. However, I don't know how we can do it in MetaModelica.