0

I am playing around a bit bit with Microsofts ELL library/compiler to deploy a simple learning algorithm to a micro controller. But my knowledge regarding embedded development has been better in the past. The Problem is the following:

ELL creates an LLVM IR file and a C Header file from a CNTK machine learning model (There are no pure c/c++ files). So far so good. Now I can use the IR to tell llc to make an assembler or object file for the desired target from it (ARM Cortex M4 in my case).

So I end up with a header file model.h and an assembler file model.s or an object file model.o. Now I want to include this model with the header and the precompiled model in my embedded project. For developing, I use the Bosch XDK, the IDE is basically Eclipse. So, is there a way, that I can include the precompiled model in my code? When yes, how? And how do I correctly include it in Eclipse? Or do I have to do further steps? I also thought about making a static library out of the object file, but I do not have any experience on this and my tries did not end successfully so far. Thanks for your kind help.

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
masked_m0nkey
  • 133
  • 1
  • 1
  • 7
  • Without knowing the tools you use myself, I can't provide an answer ... but I would prefer an object file. With assembler files, the syntax could be different betwern different tool sets. –  Jul 27 '17 at 06:11
  • What build system are you using? – arrowd Jul 27 '17 at 09:26
  • Also see [Link object file to my project Eclipse CDR](https://stackoverflow.com/q/11810701/608639), [Is it possible to import/run object files in eclipse?](https://stackoverflow.com/q/30086902/608639), [How to link object (.o) file in Eclipse](https://stackoverflow.com/q/23396199/608639), [Include object file or assembler file in C Project?](https://stackoverflow.com/q/45338665/608639), [Adding object file to cpp code in eclipse](https://stackoverflow.com/q/25866628/608639) – jww Mar 23 '18 at 20:45

1 Answers1

1

If you make a static library from the object file, the linker will simply extract the object file and link it. That is an unnecessary step, you can add the object file to the linker command line directly. Alternatively add the .s source file to your project - the default build rules should identify it as an assembly language file and invoke the assembler rather then the compiler.

Clifford
  • 88,407
  • 13
  • 85
  • 165