Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 [2]  Send TopicPrint
Very Hot Topic (More than 25 Replies) Compiling taking extremely long time? (Read 5191 times)
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling taking extremely long time?
Reply #20 - Feb 19th, 2020 at 6:06pm
Print Post  
It is not compiling the core. The core is shared over many projects so it is in a different cache place.

You can see the core is not built in the output. If you switch off "vMicro>Compiler>Shared Cache for Cores" then the core cache will be were you expect and rebuilt for each project. In that case the first build of each project will probably take as long as the arduino ide did.

You can clearly see in the output that the core is not built. It doesn't say it is using the cache but then it doesn't compile any files.

I have given you the build times you should expect for an empty new project. I suggest you try to reach those times with an empty project, then you larger project will also build quickly. Process monitor might show what is happening.

Code
Select All
Building variant ...

  Using previously compiled variant

Building core ...

Building libraries ...

Using library tiny-AES-c-1.0.0 version 0.0.0 in folder "file:///C:/Users/Richa/Documents/Arduino/libraries/tiny-AES-c-1.0.0"
  Using previously compiled file: -1.0.0\aes.c.o
 

« Last Edit: Feb 19th, 2020 at 6:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Compiling taking extremely long time?
Reply #21 - Feb 19th, 2020 at 6:10pm
Print Post  
Ok i've got it compiling the files to the folder now by disabling the shared cache, but it looks like its missing a few files?

It's missing the stm32 core files for some reason?
« Last Edit: Feb 19th, 2020 at 6:10pm by Bambo »  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Compiling taking extremely long time?
Reply #22 - Feb 19th, 2020 at 6:14pm
Print Post  
It keeps on recompiling the files because it's not saving the object output right?
g++ 
-I"c:\program files (x86)\microsoft visual studio\2019\preview\common7\ide\extensions\4vo0sprc.5q1\Micro Platforms\default\debuggers\VM_DBG"

"C:\Users\Richa\Documents\Arduino\libraries\STM32RTC-master\src\STM32RTC.cpp" -o "nul"

This file keeps getting rebuilt every time i compile it, shouldn't it be cached?
  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Compiling taking extremely long time?
Reply #23 - Feb 19th, 2020 at 6:21pm
Print Post  
See these two images:

This is a compile at 18:13AM (you can see the date on the files e.g. stm32yyxx_hal.c.d date modified 18:13)


And this one is a compiler afterwards at 18:17AM (you can see the date has changed on the same file e.g. stm32yyxx_hal.c.d date modified 18:17AM).




It keeps recompiling these files but it doesn't need to, along with many others?
« Last Edit: Feb 19th, 2020 at 6:23pm by Bambo »  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Compiling taking extremely long time?
Reply #24 - Feb 19th, 2020 at 6:22pm
Print Post  
Aha i think i see whats wrong, these files are all held as libraries, therefore the entire stm32 stuff is held as a library, not as the core.

So the core is being cached ok, but the libraries are being recompiled every time, and because there are so many files in the library, it takes ages. is there any way around this? to cache the libraries too?
« Last Edit: Feb 19th, 2020 at 6:43pm by Bambo »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling taking extremely long time?
Reply #25 - Feb 19th, 2020 at 9:57pm
Print Post  
You are looking at the wrong part of the output. You are looking at the deep search for libraries that can not be cached so easily due to the fact that the stm32 writes out files to notify an extra library needs building. The core writes this file regardless of if it has changed or not. It is outside of your control. When you re-enabled deep search that would have caused the deep search to run.

In the case of stm32 they write out an include that automatically forces deep search to discover a library called SrcWrapper.  You could add #include <SrcWrapper.h> to your ino code and switch off deep search but be warned that if any other library you use relies on deep search to discover other libraries you would need to ensure you have #included the other libraries in your .ino code. It is under your control but please dont let it cause support issues.

If you look further down the build output you will see that the ScrWrapper library is detected as already cached and is not rebuilt. Here is a snippet of the compile of a the library from lower in the output.

Code
Select All
Using library SrcWrapper version 1.0.1 in folder /libraries/SrcWrapper"
  Using previously compiled file: D:\System\WinTemp\VMBuilds\Testme3\STM32_GenF0\Release\SrcWrapper\syscalls.c.o
  Using previously compiled file: hal.c.o
  Using previously compiled file: hal_adc.c.o 



As stated earlier, you should take an empty project that has just a setup() and loop(). The full clean build time with deep search on should be around 80secs and 2nd build sub 10 seconds with deep search enabled, faster without.

To clearly see any issues you should do as I say with empty project and also as I have said ensure debug is off. With debug on there is a lot more in the trace which makes it less clear.

When you can build a simple project at reasonable speed I suggest adding one simple .cpp to your project. Then see the difference between 1st and 2nd build after adding the file. We should see the new file is not compiled the 2nd time because the cache is used.

Then add one library, a simple one that does not include lots of files or other libraries. Then in two builds we should see it being cached.


  
Back to top
WWW  
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Compiling taking extremely long time?
Reply #26 - Feb 20th, 2020 at 11:56am
Print Post  
Thank you for your help Tim! It is really appreciated, i will just continue as is considering it builds and uploads correctly anyway. I can wait a few minutes no problem.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compiling taking extremely long time?
Reply #27 - Feb 22nd, 2020 at 5:44pm
Print Post  
Great and thanks for all the info and the support!
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint