Portenta Pre-compiled Library

Hi @pert I saw this detailed explanation you did of how to make a pre-compiled library, wondering if there are any changes for the Portenta? I think the boards.local.txt issue has been fixed on newer arduino IDE's



I thought I might attempt making a pre-compiled library for the edgeImpulse.com bootloader which is a ridiculous hour long compile for installation from the sketch.


Any suggestions or updates on your previous post?

Hello @jerteach.

wondering if there are any changes for the Portenta?

I don't believe so.

The need to configure Arduino boards platforms to provide support for precompiled libraries (example) is independent from the IDE version. Even with the IDE versions that have full support for precompiled libraries, if the boards platform is not configured correctly then there is nothing the IDE can do to fix that.

Some of the 3rd party boards platforms might still be missing the configuration, but as for official Arduino boards platforms such as the "Arduino Mbed OS Portenta Boards" platform of the Portenta H7, the configuration is already correct, and already being used successfully by Arduino and 3rd parties for some time.

That said, it is true that older IDE versions do not have support for precompiled libraries, and even in the early versions that did have support, it has evolved over time. There are details about that here

It will be a valuable improvement if the compilation time can be reduced!

The precompiled library feature has been very interesting. In the early days when people were requesting support for precompiled libraries in the Arduino IDE, there was reluctance because it seemed like the sole purpose of precompiled libraries was to avoid revealing source code.

There are actually valid use cases even for that, since some chip manufacturers simply refuse to provide source code, and so it is a choice between a closed source library and no library at all for those parts. But this much more interesting use case of precompiling to reduce sketch compilation time when using an open source library revealed itself eventually.

I'm very happy to say that, since the time I wrote that post, I had the opportunity to expand the official formal documentation of these features.

At the time I wrote the post, I had to gather information from obscure mailing list discussions and GitHub issue tracker threads. That information is now in the Arduino Library Specification and Arduino Platform Specification, where it is easier to find and possible for Arduino to maintain.

I updated the reference links in the post to point to that new formal documentation content.

Even though the official documentation now provides thorough coverage of the Arduino framework related to precompiled libraries, there is not really anything official in a guide format for creating such libraries. That would need to be done as a standalone tutorial since content in that format would not be appropriate for the Arduino Library Specification. So I think my forum post can still be a useful resource when creating a precompiled library.