-
Notifications
You must be signed in to change notification settings - Fork 1k
Support precompiled libraries #606
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
Comments
Hi @massimiliano-mantione |
@massimiliano-mantione any update on this ? Thanks. |
No feedback since and enough information to reproduce. |
Sorry for the late reply. There is this repository on github that shows what I am trying to do: rust-arduino-st-nucleo-l432kc. It contains a small rust library, an arduino sketch, and a script that puts everything in place so that an arduino build of that sketch uses the rust library as an arduino precompiled library. You should look at it at this commit, particularly at the "build.sh" script. The script does the following:
After this, in principle, building the sketch should succeed. I have been able to make this procedure work for a Teensy 3.5 board. If I try this with stm32duino I get the error described at the beginning of this issue. I am attaching a zip file of the full library directory, I hope this helps. Thanks! |
rust-main-lib.zip |
Ok. Thanks for update. |
Hi @massimiliano-mantione
In this core the So, to get it working, |
Library can provide a precompiled library. See precompiled option here: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format The .a(archive)/.so(shared object) file must be located at: `src/{build.mcu}` So the `build.mcu` could not contain `fpu` and `float-abi` options and should only contain `cortex-mx` value. Else Arduino IDE, instead of searching `cortex-mx`, searches `cortex-mx -mfpu=fpv4-sp-d16 -mfloat-abi=hard` if floating-point options are set. `build.flags.fp` has been added to contain floating-point options if any. Fixes stm32duino#606 Signed-off-by: Frederic Pillon <[email protected]>
@massimiliano-mantione
|
Library can provide a precompiled library. See precompiled option here: https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#libraryproperties-file-format The .a(archive)/.so(shared object) file must be located at: `src/{build.mcu}` So the `build.mcu` could not contain `fpu` and `float-abi` options and should only contain `cortex-mx` value. Else Arduino IDE, instead of searching `cortex-mx`, searches `cortex-mx -mfpu=fpv4-sp-d16 -mfloat-abi=hard` if floating-point options are set. `build.flags.fp` has been added to contain floating-point options if any. Fixes #606 Signed-off-by: Frederic Pillon <[email protected]>
I am trying to use a precompiled library but the build system does not recognize it properly.
The reason: I am mixing Rust code into an Arduino sketch.
I compile the Rust code into a static library and then link this library into the Arduino sketch.
To link it, I put the Rust library in the Arduino library folder with a proper
library.properties
file and directory structure.This works perfectly for Teensy 3.5 and 4 boards.
I tried to do it for an STM32 board (specifically, a Nucleo L432KC), with the following
library.properties
file:where
find rust-main-lib
from the Arduino libraries directory gives the following:but the build process terminates with the following error message:
The message is confusing: the
cortex-m4
directory is there, and it contains the precompiled library.When doing the same for the Teensy boards if I did not create the CPU-specific directory the error message was the proper one (it could not find the library file).
How can this be fixed?
Or, if this is not the proper repository where to file the issue, where should I file it?
The text was updated successfully, but these errors were encountered: