g++

Home page Models Systems Tools IT staff References

Installing g++ Using g++

The GNU compiler front end. g++ supports a large number of programming languages. We use it for C++. There are versions for Linux, Mac and Windows. Here is the g++ main web page.

Installing g++

Linux Install Mac Install Windows Install

g++ is often already installed on a Unix system, such as Linux or Mac. If not, or if a more recent version is needed, follow the instructions below for your operating system.

g++ 4.4 or later is required for using the -march=native g++ argument. This compiles to the specific machine architecture where the compile is being performed. This may improve performance. DO NOT use code compiled with -march=native on a different machine.

Linux Install

In a terminal window type g++ --version to determine whether or not g++ is installed, and if so which version. If not installed or a more recent version is needed, then install the Ubuntu build-essential package, which includes g++ and a number of other packages often used for program development, by using the following command:

Mac Install

On the Mac g++ is part of Apple's Xcode software development environment. Installing or upgrading g++ is done by installing or upgrading Xcode. See the Xcode page for more information on installing or upgrading Xcode.

Windows Install

On Windows install the minggw package, which includes g++. On Windows g++ is used for command line builds. Visual Studio can also be used to build model code. It has the advantage of a complete integrated development environment, with a debugger that has very good support for C++.

Using g++