Compilation time of Arduino PLC IDE

Hey Guys,

I am working on a new project where I have connected an Arduino Portenta H7 to the Arduino PLC IDE. My code is a simple one where I display information on a LCD connected to the board. However the compliing time is really high, around 20-30 mins.

I am new to using this PLC IDE. However in the Output tab while compilation, I see the following,

--> Candidate: [Wire]
"C:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_arm-none-eabi-gcc_7-2017q4_7b7be9f526b2cb64/bin/arm-none-eabi-g++" -c -w -g3 -nostdlib "@C:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\variants\PORTENTA_H7_M7/defines.txt" "@C:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\variants\PORTENTA_H7_M7/cxxflags.txt" -mcpu=cortex-m7 -mfloat-abi=softfp -mfpu=fpv5-d16 -w -x c++ -E -CC -DARDUINO=10607 -DARDUINO_PORTENTA_H7_M7 -DARDUINO_ARCH_MBED_PORTENTA -DARDUINO_ARCH_MBED -DARDUINO_LIBRARY_DISCOVERY_PHASE=1 "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\cores\arduino" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\variants\PORTENTA_H7_M7" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\AlPlc_PMC_1.0.3_e7d207fb4adc4f4f\AlPlc_PMC\src" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\Arduino_MachineControl_1.1.1_0b68abd64cd04e7b\Arduino_MachineControl\src" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\libraries\SPI" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\ArduinoRS485_1.0.5_a61cd3c6d72c41a3\ArduinoRS485\src" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\libraries\Wire" -DCM4_BINARY_START=0x60000000 "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\cores\arduino/api/deprecated" "-IC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\cores\arduino/api/deprecated-avr-comp" "-iprefixC:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\cores\arduino" "@C:\Users\h.selvakumar\AppData\Local\T\A\internal\arduino_mbed_portenta_3.5.4_6b52e2f35dd4808f\variants\PORTENTA_H7_M7/includes.txt" "U:\h.selvakumar\Arduino\LFeed\MichaelsProject\LLSketch_build\sketch\LLSketch.ino.cpp" -o nul

The above line of code is executed again for all the libraries present. My suspicion is that when compiling a single library, all the files of other libraries are executed as well and when compiling another library, the same process of executing all the files takes place. This could possibly be the reason of having a longer compiling time[I might be also totally wrong, but just a suspicion].

So, Does anyone have some suggestions on solving this issue and reducing the compiling time?
Is it also possible to change the path to the libraries?

Any help would be greatly appreciated.

No solution. That's just how Arduino IDE and CLI work. No Makefile.

Hi @h_se.

Keep in mind that even though the program you created might look very simple, there is a lot of other code under the hood that also must be compiled.

That said, 20-30 minutes is exceptional. When people report exceptionally slow compilations, we often find that it was caused by security/antivirus software on the user's computer. As you noticed, the Arduino build system creates a large number of short duration processes during the compilation. Some antiviruses do "real-time"/"on access" scanning of processes. The process is blocked until the scan is completed. The added time for each scan is quite significant in relation to the duration of the process, so the total impact of the many scans is a great increase in the length of the compilation.

As an experiment, you can try :warning: TEMPORARILY :warning: disabling the security software/antivirus on your computer for a single compilation to see if the problem goes away:

  1. Disable the security software/antivirus software.
  2. Compile the project, just as you did before.
  3. Wait for the compilation to finish.
  4. Immediately enable the security software/antivirus software again.

If the problem doesn't occur when you tried a compilation while the security software was disabled, you will need to adjust the settings of your antivirus to put the appropriate file, folder, or process on the "allowlist" so it doesn't interfere with compilation.

:warning: Please be cautious about working with the security software disabled. This is only about temporarily disabling it for a quick test. If you don't feel comfortable doing that, fine. You can try going straight to configuring the security software so that it does not interfere with the Arduino software.

Do you experience compilation times of 20-30 minutes? That is nearly an order of magnitude more than I would expect even from compiling a fairly large program on any reasonably capable computer.

1 Like

There is no knowing what hardware the TO uses.