[C++-sig] What version of compiler is it using?

David Abrahams dave at boost-consulting.com
Wed Apr 16 21:09:07 CEST 2003


chuzo okuda <okuda1 at llnl.gov> writes:

> Hello,
> From executing bjam, and getting output to the terminal, it is not clear
> which version of g++/gcc compiler I am getting to compile sources. There
> is newer g++ installed in our computer center: 
>
> pengra0(828) which g++-3.2.1
> /usr/local/bin/g++-3.2.1
>
> pengra0(829) ../../../tools/build/jam_src/bin.linuxx86/bjam -sTOOLS=gcc
> -sBUILD=debug -sJAMBASE= -sBOOST_ROOT= -sBOOST_BUILD_PATH=
> -sGXX=g++-3.2.1 -sGCC=gcc-3.2.1
>
> The output to my terminal does not give me info that g++-3.2.1 is used
> as follow:
>
> gcc-C++-action
> ../../../libs/test/build/bin/libunit_test_framework.a/gcc/debug/runtime-link-dynamic/unit_test_result.o
>
> So, could you please tell me how to find out whether g++-3.2.1 was used
> or just g++ (which uses version 2.9.6)?

Invoke bjam with -d+2 as the first option and you can see the exact
command-lines it uses to invoke the compiler.  Invoke with
"-sBUILD=debug <cxxflags>-v" and it will pass -v on the g++
command-line, which makes g++ report its version.

> Also, please tell me if the command line above is the correct way to use
> g++-3.2.1 compiler?
>
> g++-3.2.1 compiler is symbolically linked to
> /usr/local/tools/gnu/gcc/3.2.1_redhat_7a_ia32/bin/g++, so I can simply
> do:
>
> 1) setenv GCC_ROOT_DIRECTORY
> /usr/local/tools/gnu/gcc/3.2.1_redhat_7a_ia32
> 2) ../../../tools/build/jam_src/bin.linuxx86/bjam -sTOOLS=gcc
> -sBUILD=debug -sJAMBASE= -sBOOST_ROOT= -sBOOST_BUILD_PATH=
>
> without using -sGXX=g++-3.2.1 ?

Yes.  In fact, that's the best way to do it.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com





More information about the Cplusplus-sig mailing list