-
-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve precompiled libraries handling #512
Improve precompiled libraries handling #512
Conversation
General change: - library compilation bails out if the precompiled object is found. This allows mixed libraries that fallback using sources if no suitable precompiled object is found ARM float specification change: - Cortex M4+ allows specifying different flags for floating point ABI This patch introduces a second level of subfolder that MUST be used is -mfpu or -mfloat-abi are specified on the commandline Since there's no clear specification (unlike build.mcu), the values are extracted from c++ recipe For example, for a target which commandline contains `-mfloat-abi=hard -mfpu=fpv4-sp-d16` , the precompiled search path will be `$libfolder/cortex-m4/fpv4-sp-d16-hard` If that folder doesn't exist the library will be compiled from sources Fixes arduino/arduino-builder#256
Unfortunately this is not working for me with the For the Arduino Nano 33 BLE, I see the following:
when compiling the however when compiling for the MKR Zero, I get linker errors:
Note the following changes are needed to the sketch:
|
@sandeepmistry that's because you need a specially crafted version of tflite library with the |
@facchinm of course! Totally my bad :) ... the zip you provided links perfectly for MKR Zero! |
hi folks, is there a way i could test the PR? |
hihi folks checkin' in again if there's anything i can do to help test this PR |
If not needed maybe it's better to remove it, there are known use cases? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the .a
with non-standard name (that was already handled so it's not part of this pr) LGTM
- Fix library priority selection (again) arduino/arduino-cli#574 - Improve precompiled libraries handling arduino/arduino-cli#512
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
This patch restores some functionalities broken by arduino#512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * arduino#512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled)
* Fix mixed code precompiled libraries This patch restores some functionalities broken by #512 . It introduces a BREAKING CHANGE to "precompiled" field If merged, "precompiled" means that the library ONLY contains a precompiled library and its headers. No file containing implementation will be compiled if the library is specified as such. Fixes arduino/arduino-builder#353 Tested with * #512 (comment) (Nano33BLE and generic MKR board) * https://github.com/BoschSensortec/BSEC-Arduino-library (works after removing precompiled=true directive in library.properties) * https://github.com/vidor-libraries/USBBlaster (MKRVidor, fully precompiled) * Added test-build for Arduino_TensorFlowLite * Added another test for Bosch Sensor lib * Fallback search for precompiled libraries in non-fpu specific directories * variable renamed * Moved fixLDFLAG inside compileLibraries * Inlined FixLDflags * Using more paths helpers to simplify code * Added support for "precompiled=full" in library.properties This flag allow the deployment of a pure precompiled library that ships also the source code of the precompiled part. This allows to possibly compile-from-source as a fallback if the library does not provide a precompiled build for the current architecture. The "precompiled=true" instead has been ported back to the old behaviour (for libraries that ships a precompiled binary and support source code that wraps/uses the precompiled part). * Updated tests * Fixed test compile-build on very long paths on Windows * Removed constants.BUILD_PROPERTIES_COMPILER_LIBRARIES_LDFLAGS * Add space before "-L" gcc flag to allow multiple precompiled libs to be included Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>
General change:
This allows mixed libraries that fallback using sources if no suitable precompiled object is found
ARM float specification change:
Cortex M4+ allows specifying different flags for floating point ABI
This patch introduces a second level of subfolder that MUST be used if -mfpu or -mfloat-abi are specified on the commandline
Since there's no clear specification (unlike build.mcu), the values are extracted from c++ recipe
For example, for a target which commandline contains
-mfloat-abi=hard -mfpu=fpv4-sp-d16
, the precompiled search path will be$libfolder/cortex-m4/fpv4-sp-d16-hard
If that folder doesn't exist the library will be compiled from sources
Open questions:
While reviewing this I found a code path just to add static libraries with non standard name (not starting with "lib" ). Should we keep it or not? @cmaglie
I don't like the name of the subfolder but it's super precise. We should be able to get away with
-float-abi=xxx
only but I'm not 100% sure. Experts' advise are welcome 🙂Fixes arduino/arduino-builder#256