# Which gcc version

**URL:** <https://www.ruby-forum.com/t/which-gcc-version/162227>\
**Category:** Ruby\
**Created:** [March 7, 2009, 1:45am UTC](https://www.ruby-forum.com/t/which-gcc-version/162227 "2009-03-07T01:45:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 7, 2009, 1:45am UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/1 "2009-03-07T01:45:03Z")

</div>

Is there a way to know which version of gcc was used with a certain ruby  
binary?  
Thanks!  
-=r

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 7, 2009, 2:22am UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/2 "2009-03-07T02:22:17Z")

</div>

On Mar 6, 2009, at 16:43, Roger P. wrote:

> Is there a way to know which version of gcc was used with a certain  
> ruby  
> binary?

no.

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 7, 2009, 1:30pm UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/3 "2009-03-07T13:30:53Z")

</div>

Eric H. wrote:

> On Mar 6, 2009, at 16:43, Roger P. wrote:
> 
> > Is there a way to know which version of gcc was used with a certain  
> > ruby binary?
> 
> no.

I’m curious: Why would someone want to know that?

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 9, 2009, 4:48pm UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/4 "2009-03-09T16:48:23Z")

</div>

Jeff S. wrote:

> Eric H. wrote:
> 
> > On Mar 6, 2009, at 16:43, Roger P. wrote:
> > 
> > > Is there a way to know which version of gcc was used with a certain  
> > > ruby binary?
> > 
> > no.
> 
> I’m curious: Why would someone want to know that?

I was looking for a way to include it in the output of the ruby  
benchmark suite so that the logs were more descriptive of which version  
of Ruby was being run 🙂

Currently I can glean this information from rbconfig:  
Ruby VM: ruby [ruby 1.8.6 (2008-07-17 patchlevel 279) [i386-mingw32];-g  
-O2]

The -O2 is quite useful [don’t want to compare versions that are  
compiled with different -O settings and call it fair]… The version of  
GCC would also be useful for the same reason.

-=r  
[1] [GitHub - acangiano/ruby-benchmark-suite: A set of Ruby benchmarks for testing Ruby implementations.](http://github.com/acangiano/ruby-benchmark-suite/tree/master)

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 9, 2009, 7:16pm UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/5 "2009-03-09T19:16:52Z")

</div>

On Mar 9, 2009, at 08:46, Roger P. wrote:

> I was looking for a way to include it in the output of the ruby  
> benchmark suite so that the logs were more descriptive of which  
> version  
> of Ruby was being run 🙂
> 
> Currently I can glean this information from rbconfig:  
> Ruby VM: ruby [ruby 1.8.6 (2008-07-17 patchlevel 279) [i386- mingw32];-g  
> -O2]

You only want the options passed to GCC? They’re in rbconfig.rb

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 9, 2009, 7:50pm UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/6 "2009-03-09T19:50:26Z")

</div>

Ryan D. wrote:

> On Mar 9, 2009, at 08:46 , Roger P. wrote:
> 
> > I was looking for a way to include it in the output of the ruby  
> > benchmark suite so that the logs were more descriptive of which  
> > version  
> > of Ruby was being run
> 
> why not build the ruby yourself as part of the benchmark suite? then  
> “gcc --version” is valid.

Good idea.

re: which options I want. I have the info in rbconfig [parameters] but  
I was wondering if ruby knew which version of the compiler was used for  
itself somehow 🙂

-=r

---

<div class="post-metadata">

**Author:** ![rogerdpack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/45deac/32.png) [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Post date:** [March 9, 2009, 7:23pm UTC](https://www.ruby-forum.com/t/which-gcc-version/162227/7 "2009-03-09T19:23:55Z")

</div>

On Mar 9, 2009, at 08:46 , Roger P. wrote:

> I was looking for a way to include it in the output of the ruby  
> benchmark suite so that the logs were more descriptive of which  
> version  
> of Ruby was being run

why not build the ruby yourself as part of the benchmark suite? then  
“gcc --version” is valid.
