Pages: [1] 2   Go Down
Author Topic: Stupid Question: What compiler is used?  (Read 945 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If I am using a Arduino Mega 2560 Rev. 3. Simply put, what compiler is in use? I read
Code:
http://www.arduino.cc/en/Main/Documentation
and
Code:
http://arduino.cc/en/Hacking/BuildProcess
and that provided some help. I saw through a few google searches the AVR-GCC compiler seems to be in use. Can I find out which one specifically? I also know that it is changed to be in correct C format with a basic main function, but how exactly is the .ino turned into .c with the Arduino core functions (Is this simply Arduino.h). Thanks.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not aware of any documentation describing exactly what mucking-about the Arduino IDE does with your sketch .INO file to generate the .cpp file. From observation, it inserts a #include for arduino.h, generates prototypes for the functions and variables defined in the file, and puts all the files it thinks are needed to build your sketch into a  temporary directory. I think the algorithm for doing the inserting may have evolved in recent versions since some people have said that it is now possible to pre-empt the auto-generated prototypes by inserting your own prototypes, but that doesn't work for 1.0.4 which I use.

If you use File/Preferences to display the Preferences window and select the 'Show verbose output during: compilation' option then when you verify the sketch it will print the name of the temporary directory where the files generated by the IDE are stored. These are the files actually passed to the compiler. By comparing these .cpp files with the original sketch .ino files and tabs you can get an idea of how the IDE has modified your code to generate the .cpp which is actually compiled.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6804
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Hacking/BuildProcess

avr-gcc 4.3.2, approximately, for the AVR
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The version number is very important. Shouldn't this be stored in some txt file or something inside my portable edition of Arduino 1.0.5?
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1477
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros
Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 56
Posts: 1847
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The version number is very important.
No!  Not for Arduino users.  Arduino addresses version control for users at the 1.01, 1.03, 1.05, exc. levels.  Tool versions are of no concern to the user of the GUI.

IF you want to be concerned about run-line compilation, then:
Code:
C:\>avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ../gcc-4.3.3/configure --enable-win32-registry=WinAVR-20100110
--with-gmp=/usr/local --with-mpfr=/usr/local --prefix=/c/WinAVR --target=avr --e
nable-languages=c,c++,objc --with-dwarf2 --enable-doc --disable-shared --disable
-libada --disable-libssp --disable-nls --with-pkgversion='WinAVR 20100110' --wit
h-bugurl='URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=br
owse'
Thread model: single
gcc version 4.3.3 (WinAVR 20100110)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For documentation purposes, I needed to know the version as I like to brake down the hardware and software setup to be replicated days, weeks, months, or years later. So for an arduino user after finishing a project, it is VERY important.

@KeithRB, maybe I am just an idiot, but I have no idea how to look at that link or use it to answer my question.
« Last Edit: July 30, 2013, 10:03:59 am by napkinsterror » Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1477
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

By printing out the values of those defines, you can tell exactly what version of GCC was used to compile your program.
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1857
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The version number is very important. Shouldn't this be stored in some txt file or something inside my portable edition of Arduino 1.0.5?
<grumble from a GCC maintainer>
I dunno, it the Arduino team thought it was important, perhaps they might consider going to newer versions of the compiler than a 5 year old compiler whose source tree at the Free Software Foundation is now frozen.  Yes, there are perhaps some new features that need to be dealt with (the underlying support for PROGMEM changed for instance), and perhaps there are some bugs that need to be fixed in the GCC or perhaps the changes need to be made in the Arduino libraries.

Right now, GCC 4.8.1 is the current released version, and 4.7.x is widely used.
</grumble from a GCC maintainer>
Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 56
Posts: 1847
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
For documentation purposes, I needed to know the version as I like to brake down the hardware and software setup to be replicated days, weeks, months, or years later. So for an arduino user after finishing a project, it is VERY important.

I once worked for a Fortune 10 company and they could not make what you are inferring work because a workstation simply needs to be cloned with the tools intact, that is, frozen in time.  However, this did not work because some license files expired.  Your best best is just to put the Arduino installation ZIP into the local/off-site backup with the source.  I agree that you need to document it, and while "months " later may be a reality, "years" later is somewhat unrealistic based upon my experience with Y2K projects.

Ray
Logged

IDF/SO
Offline Offline
Edison Member
*
Karma: 41
Posts: 2303
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
avr-gcc 4.3.2, approximately, for the AVR

Perhaps True for windows ,but not sure.
False for Linux ! And sure .

Debian :
old stable (Squeeze) : 4.3.5
Stable (Wheezy), Testing (Jessie) and Sid   : 4.7.2

If you need absolutly to know the exact version use Linux.
Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 56
Posts: 1847
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
If you need absolutly to know the exact version use Linux.

"Absolutely"... Oh, come on!  Or just drop down in Windows to the command prompt and find out from the utility as I showed earlier!

Ray
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 42
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

When your working with power utilities and systems, years is common. Half of the project is interfacing with a machine made in 1995(I am not sure they had repositories or version control back then from the looks of it haha) . I have put the arduino 1.0.5 zip stored in there, but since the board design is likely to be recreated and stripped of most of its... Arduinoness? and most people here just do everything in Eclipse or the like they would not want to touch the Arduino IDE. Thanks for the help! (It does seem to be 4.3.2 or 4.3.3)

Edit:
I found some good ol' text files inside the arduino directory -> hardware -> tools  -> avr
« Last Edit: July 30, 2013, 11:05:48 am by napkinsterror » Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 56
Posts: 1847
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
When your working with power utilities and systems, years is common. Half of the project is interfacing with a machine made in 1995(I am not sure they had repositories or version control back then from the looks of it haha) .

Fone_Company... ultimate insanity... BTDT... BeenThereDoneThat

With middleware and PC software, there is little hope of having a sane Backup and Recovery plan that would past scrutiny years down the road.  Just having the ZIP or tar-ball in archive does not mean that you can reconstruct perfectly... there are Windows USB drivers and such that may not be supported years down the road... which was my point about having entire machines in warehouses for DR until someone realized that much of the development software had license keys.

I know personally many of the DR folks in the Atlanta office... they have created safety nets and procedures at great cost to manage such scenarios.  They spend hundred of hours a year testing the procedures and fine-tuning them.  It makes me glad I'm retired.

All the above being said, if you noted my versions in the post, you will see that my system has been patched ahead of yours if you are running plain vanilla.  But worst, outside of the software versions that can be coaxed from executables, there are configuration files such as boards.txt and programmers.txt that can impact a successful build, so good documentation is going to have to document those flat files, too, since the time/date code is not to be overly trusted in a Windows world.

Ray
Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1477
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"I found some good ol' text files inside the arduino directory -> hardware -> tools  -> avr"

Of course, you have to trust that this gets updated with every change...
Logged

Pages: [1] 2   Go Up
Jump to: