Unbelievable slow compilation of simple sketches

Hi guys,

I recently bought a Arduino Uno and started playing with it. Everything works fine apart the unbelievable amount of time needed to compile (verify) even the simplest of the sketches (e.g. around 2 mins for the blinking led).

I have done some research and I could not find any solution. Just to be clear, it is not that the IDE software is slow: openin, closing, selection ports etc… works fine. Uploading the sketch to the Arduino is fast. Just the compilation get stopped at half the bar for 1-2 mins. In tha time, the load of processing on the computer is very low, so it is just waiting for something, just I don’t know what…

I tried to: 1) re install java 2) remove blue-tooth stuff 3) disable the ports not used 4) disable firewall 5) replaced rxtxSerial.dll with a version that should solve some problems…

… but still compiling is super slow.

Do you have any suggestion what it could be? I am running a Windows XP machine not super new but should have all the power needed to compile 4 lines of code…

Tnx for the help
Eliaar

I tried to figure out better what is not working in the compilation. I found out two maybe helpeful info:

1) while the compilation is unexplainably frozen, in the background the process avr -gcc is launched and aborted at least 20 times in interval of 1-2 seconds one from the other.

2) even and empty sketch without loop() and setup() takes 2-3 mins do be "verified" before getting an error.

Does this information help anyone in giving me a hint of what is going on? I really hope someone can be so gentle to help me cause this problem is slowing down incredibly any work i can do with arduino..

Tnx Eliaar

Sorry, I only have experience with Vista Home SP2 (32-bit), have not tried an older Windws version. Or a newer version for that matter (Win7/64 bit for example).

I also have the same issue. I only received my Arduino Uno yesterday. On my work machine (Win XP), i've no issues, but at home on my laptop (Win 7), compilation of the blink demo takes minutes, and then uploads and runs successfully. I'd be very interested in any solutions people might be able to offer.

Have you tried turning off bluetooth stuff running in the background?

There are configuration options in windows to give priority to foreground/background processes. (somewhere deep down inside - no link) If your forground processes have priority I can imagine that gcc which is run in the background is also slow.

But still minutes is slow - I have a windows 7 laptop with 4 boinc processes in the background and it compiles most sketches in less minute.

If you open the task manager and you start compiling do you see any "strange" things...

This may not be related to anything you guys are doing, but I was just compiling a sketch with the
following routine in it, and which had worked 100% beforehand, but which hung up the compiler
indefinitely after I added the routine. IOW, compilation started on “Verify” and partially completed,
but then simply hung in the middle, with no error messages indicated.

void test3()
{
  int num = 9;
  int freq[] = { 
    50, 100, 200, 500, 1000, 2000, 3000, 4000, 5000 };
    
  Serial.print("\n);
  for( int i=0; i<num; i++) {
    Serial.print( freq[i], DEC);
    Serial.print(" ");
    playFreq(freq[i], 500);
  }
}

Moderator edit: CODE TAGS added

What I discovered was, a quote was left out of the statement just before the for() loop,
ie, s/b Serial.print("\n");

I am kind of surprised that the compiler didn’t signal this as a syntax error ???

It must have treated everything between the first and 3rd Serial.print() statements as a
string-literal.

Moral of the story is: you might need to re-check the syntax in your code, if compilation
takes forever to complete.

[ code] [ /code] stops your code going into italics!

robtillaart: There are configuration options in windows to give priority to foreground/background processes. (somewhere deep down inside - no link) If your forground processes have priority I can imagine that gcc which is run in the background is also slow.

On windows 7 type 'Control Panel\System and Security\System' into explorer click 'Advanced System Settings' then 'Advanced' tab You want performance settings.

On XP right click on my computer then click 'properties' and go to advanced tab, then settings button.

Make sure the IDE .exe file and particularly all the header files you are using is on a local drive. Also, make sure what ever hard drive it is running from is not bogged down doing a bunch of other things.

The background/foreground preferences should only make significantnt difference if you have a resource intensive process running in the foreground, AND another running in the background. For most people, this setting will nevemakeek noticeableldifferencece and should not be changed from the default.

eliaar: Hi guys,

I recently bought a Arduino Uno and started playing with it. Everything works fine apart the unbelievable amount of time needed to compile (verify) even the simplest of the sketches (e.g. around 2 mins for the blinking led).

I have done some research and I could not find any solution. Just to be clear, it is not that the IDE software is slow: openin, closing, selection ports etc.. works fine. Uploading the sketch to the Arduino is fast. Just the compilation get stopped at half the bar for 1-2 mins. In tha time, the load of processing on the computer is very low, so it is just waiting for something, just I don't know what..

I tried to: 1) re install java 2) remove blue-tooth stuff 3) disable the ports not used 4) disable firewall 5) replaced rxtxSerial.dll with a version that should solve some problems..

.. but still compiling is super slow.

Do you have any suggestion what it could be? I am running a Windows XP machine not super new but should have all the power needed to compile 4 lines of code...

Tnx for the help Eliaar

any solution for this issue?. i am running a windows xp on old lantop y arduino uno ide 1.0.. processing last version. the check ports spend next to 2 minutes. after the program go well.

i am running a windows xp on old lantop y arduino uno ide 1.0..

It is also my old XP notebook that shows exactly the same behavior as yours. My 2-YO XP netbook works ok, so I just gave up using the Arduino IDEs on the older machine.

However, it occurs to me that you might go to the Microsoft website and load all of the OS patches [there must be a million of them by now], and see if that helps. Will probably only take a couple of hours!!!!

The Arduino IDE is the only dev tool out of a couple of dozen that I use that won't work on my older notebook, so I don't want to mess with it anymore.

I have installed windows xp and its very slow ,i try all ways to fix it but no hope

I have installed windows xp and its very slow ,i try all ways to fix it but no hope

If you're reinstalling WinXP from a CD disk or backup partition, you probably need to go the microsoft website and also get all the latest operating system patches, otherwise you still have the old OS installed. There are probably a million patches.

eliaar: ... 1) while the compilation is unexplainably frozen, in the background the process avr -gcc is launched and aborted at least 20 times in interval of 1-2 seconds one from the other. ...

Hmmm, I'm running XP and do not have such issues. Which version of the Arduino software is this?

Also, on XP if a process is starting and exiting over and over again, you will likely have many errors in your system event log. Try having a look at the log just after you do a sketch compile and up-load.

Start -> Settings -> Control Panel -> Administrative Tools -> Event viewer -> System

I was looking for a solution for this problem now in 2015.

I’m on a Windows 7 64bit and dowloaded the Arduino IDE 1.6.0 for Window zip file.

The compilation time was horribly slow (>1minute). And I’m talking about the basic blink example.

I’ve read about the rxtxSerial.dll replacement solution but apparently this version 1.6.0 does not ship with that dll file inside.

Solution: Downloaded the windows installer and everything is alright now. Compilation time, less than 10 secs

Hi Everybody

I have experienced same issue with "Arduino IDE 1.6.0 for Window zip" and problem solved when i put Arduino folder in the "Exeption List" of my "Avast free antivirus". After that compilation time changed to normal condition.

I was experiencing the same issue and I found this post. I looked at the responses and this was the answer to the problem.

rtadams89:
Make sure the IDE .exe file and particularly all the header files you are using is on a local drive. Also, make sure what ever hard drive it is running from is not bogged down doing a bunch of other things.

The background/foreground preferences should only make significantnt difference if you have a resource intensive process running in the foreground, AND another running in the background. For most people, this setting will nevemakeek noticeableldifferencece and should not be changed from the default.

On my one laptop, I didn’t have the libraries on the hard drive but just on a sample flash drive. When I put the libraries in the Arduino > libraries folder, it compiled normally. Thanks!

While it's taking forever to compile, check task manager process listing. What's using all the CPU time?

The IDE writes many files when compiling. Your antivirus may slow everything down because it has to check every single bit that gets written on the harddrive