Hi guys,
I'm working on an unusual project for the ESP32, and I'm wondering if there's an easy way to precompile most of the ESP32 libraries so that I can just link them instead of compiling them every time? Stuff like bluedroid and lwip take a long time to compile, and I would prefer to just have a static lib I can link in.
Ideally, I would like to be able to run some sort of make that spits out one bit .a file that I can just link in with the few files that I'm actually working on.
The general idea is that I want to be able to zip up all of the static libs/include files/my source and send them to a server that does the compilation and then returns the final binary. I'm trying to minimize compile time on the server.
-Nick
Precompile ESP32 core
Re: Precompile ESP32 core
There isn't really anything like this at the moment, however if you keep the "build" directory between builds then nothing unchanged should be recompiled on a second "make" unless you change config (which requires everything to be recompiled, with the new config settings).
The other thing you can do is install "ccache" on your server, this can help a lot with build times (there are a few ways to configure ccache, but the easiest is to go to "SDK Tools" in menuconfig and set the compiler prefix to "ccache xtensa-esp32-elf-".)
The other thing you can do is install "ccache" on your server, this can help a lot with build times (there are a few ways to configure ccache, but the easiest is to go to "SDK Tools" in menuconfig and set the compiler prefix to "ccache xtensa-esp32-elf-".)
Re: Precompile ESP32 core
For a project I'm working on at the moment, I am doing something similar.
I have the following:
/build/esp-idf <--- The ESP-IDF
/build/esp-idf-template <--- A normal template app that I run "make" within that results in a hello world app. This owns "sdkconfig"
/build/source <--- My application source. This contains my source plus a "hand-made" linker shell script that links everything together. Basically I just copied the commands that are executed by the normal build system.
This technique means that when the source files of my project change, only they need be recompiled. This has then been dockerized so that we can compile user applications that are edited through a browser.
I have the following:
/build/esp-idf <--- The ESP-IDF
/build/esp-idf-template <--- A normal template app that I run "make" within that results in a hello world app. This owns "sdkconfig"
/build/source <--- My application source. This contains my source plus a "hand-made" linker shell script that links everything together. Basically I just copied the commands that are executed by the normal build system.
This technique means that when the source files of my project change, only they need be recompiled. This has then been dockerized so that we can compile user applications that are edited through a browser.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Precompile ESP32 core
Thanks Angus,ESP_Angus wrote:There isn't really anything like this at the moment, however if you keep the "build" directory between builds then nothing unchanged should be recompiled on a second "make" unless you change config (which requires everything to be recompiled, with the new config settings).
The other thing you can do is install "ccache" on your server, this can help a lot with build times (there are a few ways to configure ccache, but the easiest is to go to "SDK Tools" in menuconfig and set the compiler prefix to "ccache xtensa-esp32-elf-".)
The issue with your first approach, in my case, is that you cannot move the build directory after building. All of .o files and stuff like that have absolute paths in them.
I will look into ccache. If it can save me enough time, then that seems like a simple way to go.
Thanks,
-Nick
Who is online
Users browsing this forum: Dhruvit, Konstantin and 134 guests