Forum Rule: Always post complete source code & details to reproduce any issue!
-
Very large source code, need advice how to recompile
Hello,
I am trying to use CLAPACK inside teensy 4.1, and need an advice how to compile it.
I created a new directory src in ~/arduino-1.8.19/hardware/teensy/avr/cores/teensy4
and saved all 1700 *.c files (690k lines of code) of clapack here with some additional modifications removing printf and exit calls from this sources.
Actually I was succeed to compile it with arduino environment, however, the speed of first compilation is not nice - it takes about 5 minutes to compile, but at least it works.
I also tried to compile with Makefile from ~/arduino-1.8.19/hardware/teensy/avr/cores/teensy4 but, after uploading, my teensy 4.1 board enter into alarm stage (7 short flashes of red LED) and I discontinued to try this method.
If I build ones my project and have arduino environment open, I can recompile it fast enough, but if I close it and open again, I need to wait again 5 minutes to compile because *.o are stored at /tmp/arduino-build-* and they are removed when I am closing arduino environment.
Please, suggest me is there any possibility to save precompilled *.o files between open/close arduino environment?
Thank you!
-
Senior Member
I did a plugin for Arduino IDE that saves the build output to the sketch folder, and therefore it's saved between sessions.
https://github.com/manicken/arduinoIDEsketchBuildPath
-
Thank you very much, manicksan! It is exactly what I am searching for, I will try it right now!
-
-
Senior Member
I did just retested (to be sure that it still works) on a clean installation of Arduino IDE 1.8.19 + TD 1.56
While having the plugin activated.
Did a compile that took awhile
then restarted the ide and did a compile again
that time much faster
There is also the option to clear the build,
when you want a complete rebuild.
-
FYI, vscode with platformIO plugin keeps its build folder after you close vscode. I just checked. Another way to speed up your build it to get a good desktop Ryzen7 with 8 or more cores. By default, these C/CPP compilers will dispatch as many jobs as CPU's thread counts. I did some tests forcing different job counts and came to that conclusion. That solved my problem with ESP-IDF build taking 5 minutes on a puny 4-core 4-thread i5. Even a Ryzen7 8-core on a laptop will do
They suck at playing video games due to lower single-core speed but compiling with all cores is indeed their game! If you want a decent dev machine, get the most core count you can afford and don't bother with the single-core overclocked speed. Even with your existing cpu, make sure your CPU's hyperthreading isn't disabled by software. I have a dell. When I run dell optimizer software, it disables hyperthreading and I'm 33% slower.
-
Senior Member
While on that PlatformIO track, it also compiles much faster.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules