In the example application I linked, TVM generates C code as the final output format, this includes C sources generated via [the BYOC integration for the microNPU](https://github.com/apache/tvm/blob/main/src/relay/backend/contrib/ethosu/source_module.cc). The C code from TVM is extracted from a generated archive (in [Model Library Format](https://tvm.apache.org/docs/arch/model_library_format.html)) and added to the sources list of the application, so you have something similar to (codegen is the output from TVM): ``` gcc -o demo_app \ src/demo.c \ codegen/host/src/default_lib0.c \ codegen/host/src/default_lib1.c ```
Which allows you to specify your own GCC flags easily and integrate it as part of an existing C application. What @comaniac is suggesting is to instead use BYOC to generate C code, and use TVM to generate a binary from it (which invokes GCC behind the scenes if I remember correctly). A good example of this can be seen in [the external code generation tests](https://github.com/apache/tvm/blob/main/tests/python/relay/test_external_codegen.py), which uses the `export_library` method to convert the model into a binary shared object. This lets you use more of the Python interface to TVM and is better suited to richer environments. --- [Visit Topic](https://discuss.tvm.apache.org/t/if-target-c-how-to-execute-the-c-program/11519/11) to respond. You are receiving this because you enabled mailing list mode. To unsubscribe from these emails, [click here](https://discuss.tvm.apache.org/email/unsubscribe/2886816d2f24c0b262940dc47155e30f757515247d86179c98bfa8da26405d0e).