nasa / trick

Trick Simulation Environment. Trick provides a common set of simulation capabilities and utilities to build simulations automatically.
Other
26 stars 14 forks source link

JIT input files and code coverage #1736

Open garyt2 opened 1 week ago

garyt2 commented 1 week ago

Noticed that a sim built with code-coverage flags -fprofile-arcs -ftest-coverage will not run a JIT-input file, it cannot load the generated .so file.

Is there a workaround?

hchen99 commented 1 week ago

Interesting...will do some testing and get back.

hchen99 commented 1 week ago

Can give it a try as following:

garyt2 commented 1 week ago

That is looking like it has potential. Here's the build process that seems to work from a pristine state:

So that's a bit cumbersome, but it seems that, if the modified Makefile could be copied in instead (in place of the default Makefile) for sims that are compiled with coverage flags, then the necessity to run with expected failure, edit the default Makefile, remove the original .so, and re-make might be avoided.

Is there a way to identify a build-with-coverage, and conditionally identify which Makefile to populate jitlib with?

hchen99 commented 1 week ago

Yeah, the workaround takes some manual work. Current JIT input code doesn't generate .so target with trick or trick system CXXFLAGS like for .o target and it doesn't check if build-with-coverage. We'll look into this to make needed update such as to update trick code to have coverage flags for .so in jitlib Makefile if jit input is built with coverage.