# Portenta Pre-compiled Library

**URL:** <https://forum.arduino.cc/t/portenta-pre-compiled-library/952921>\
**Category:** Portenta H7\
**Created:** [January 29, 2022, 4:38pm UTC](https://forum.arduino.cc/t/portenta-pre-compiled-library/952921 "2022-01-29T16:38:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerteach](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/jerteach/32/257433_2.png) [@jerteach](https://forum.arduino.cc/u/jerteach)\
**Post date:** [January 29, 2022, 4:38pm UTC](https://forum.arduino.cc/t/portenta-pre-compiled-library/952921/1 "2022-01-29T16:38:35Z")

</div>

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

> [@Precompiling a big library?](https://forum.arduino.cc/t/precompiling-a-big-library/626128/7#msg4407422):
>
> Generate archives Open [the library.properties file](https://arduino.github.io/arduino-cli/latest/library-specification/#libraryproperties-file-format) from the root folder of your library in a text editor. Add this line to the file ([reference](https://github.com/arduino/arduino-builder/issues/326#issuecomment-505357704)):dot\_a\_linkage=true Save the file. In the Arduino IDE, select a target from the Tools \> Board menu. Select File \> Preferences from the Arduino IDE menus. Check the box next to Show verbose output during: ☐ compilation. Click the OK button. Compile any sketch that has an #include directive for your library. This could just be a bare minimum sketch. Fo…

* * *

* * *

I thought I might attempt making a pre-compiled library for the [edgeImpulse.com](http://edgeImpulse.com) bootloader which is a ridiculous hour long compile for installation from the sketch.

> **[GitHub - edgeimpulse/firmware-arduino-portenta-h7: Edge Impulse firmware for the Arduino Portenta H7...](https://github.com/edgeimpulse/firmware-arduino-portenta-h7#arduino-ide)**
>
> Edge Impulse firmware for the Arduino Portenta H7 development board

* * *

Any suggestions or updates on your previous post?

---

<div class="post-metadata">

**Author:** ![pert](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/pert/32/217111_2.png) [@pert](https://forum.arduino.cc/u/pert)\
**Post date:** [January 30, 2022, 2:46am UTC](https://forum.arduino.cc/t/portenta-pre-compiled-library/952921/2 "2022-01-30T02:46:25Z")

</div>

Hello @jerteach.

> wondering if there are any changes for the Portenta?

I don't believe so.

> [@jerteach](#):
>
> I think the `boards.local.txt` issue has been fixed on newer arduino IDE's

The need to configure Arduino boards platforms to provide support for precompiled libraries ([example](https://github.com/arduino/Arduino/issues/7005)) 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](https://arduino.github.io/arduino-cli/0.20/library-specification/#:~:text=precompiled%20%2D%20(available%20from%20Arduino%20IDE%201.8.6)

> [@jerteach](#):
>
> I thought I might attempt making a pre-compiled library for the [edgeImpulse.com](http://edgeImpulse.com) bootloader which is a ridiculous hour long compile for installation from the sketch.

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.

> [@jerteach](#):
>
> Any suggestions or updates on your previous post?

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.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 29, 2022, 2:47am UTC](https://forum.arduino.cc/t/portenta-pre-compiled-library/952921/3 "2022-07-29T02:47:17Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
