Opened 6 years ago

Closed 6 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 Francesco Casella, 6 years ago

Cc: albertoleva added

comment:2 by Adeel Asghar, 6 years ago

Cc: Adrian Pop added

The target options are retrieved from omc via getConfigFlagValidOptions API 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.

comment:3 by Francesco Casella, 6 years ago

Possibly add a button somewhere to check if the selected compiler is actually installed and works properly

comment:4 by Martin Sjölund, 6 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:5 by Francesco Casella, 6 years ago

Milestone: 1.13.01.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:6 by Adeel Asghar, 6 years ago

comment:7 by Adeel Asghar, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.