「gcc」の版間の差分

提供: C言語入門
移動: 案内検索
(gcc 4.9)
(gcc 4.9)
行10: 行10:
 
== gcc 4.9 ==
 
== gcc 4.9 ==
 
* 2014/04/22 にリリースされました。
 
* 2014/04/22 にリリースされました。
 +
* コンパイルのエラーなどをカラー表示する -fdiagnostics-color=auto  のオプションが追加されました。
 
* 並列プログラミングAPI [[OpenMP]] 4.0をサポートしました
 
* 並列プログラミングAPI [[OpenMP]] 4.0をサポートしました
 
** アクセラレータのサポートされました
 
** アクセラレータのサポートされました

2014年5月14日 (水) 00:45時点における版

gcc とは、GNUのC/C++コンパイラのパッケージ、もしくは、Cコンパイラのコマンドです。Windows, Linux, FreeBSDなど様々な環境で利用できます。Windowsでは、CygwinやMinGWなどをインストールして利用できます。

読み方

gcc
じーしーしー

概要

gccは、Cコンパイラのコマンド、もしくは、GNU Cコンパイラのパッケージです。

gcc 4.9

  • 2014/04/22 にリリースされました。
  • コンパイルのエラーなどをカラー表示する -fdiagnostics-color=auto のオプションが追加されました。
  • 並列プログラミングAPI OpenMP 4.0をサポートしました
    • アクセラレータのサポートされました
  • インテルが開発する並列処理の機能の Cilk Plus が部分的に実装されました。
    • 簡単なプログラミング・モデルで並列プログラムを記述できます。
    • 3つのキーワードで、並列プログラムが開発できます。
  • C++では、C++11, C++14のサポートしました。

インストール

FreeBSDの場合

gcc 4.9

$ sudo pkg install gcc49
To ensure binaries built with this toolchain find appropriate versions
of the necessary run-time libraries, you may want to link using
 
  -Wl,-rpath=/usr/local/lib/gcc49
 
For ports leveraging USE_GCC, USES=compiler, or USES=fortran this happens
transparently.

gcc 4.8

$ sudo pkg install gcc48

gcc 4.7

$ sudo pkg install gcc47

gcc 4.6

$ sudo pkg install gcc46

Windows環境

CygwinやMinGWでgccが提供されます。

MinGW では、gcc 4.8.1 が使用できます。

C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin\gcc.exe

にインスールされています。

C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingwbuilds.bat

を起動するとパスが通った状態で、コマンドプロントが利用できます。

C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/program\ files/mingw-builds/x64-4.8.1-posix-seh-rev5/ming
w64/bin/../libexec/gcc/x86_64-w64-mingw32/4.8.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../../src/gcc-4.8.1/configure --host=x86_64-w64-mingw32 --bu
ild=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --prefix=/mingw64 --with-sysr
oot=/tmp/x64-481-posix-seh-r5/mingw64 --enable-shared --enable-static --disable-
multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcx
x-time=yes --enable-threads=posix --enable-libgomp --enable-lto --enable-graphit
e --enable-checking=release --enable-fully-dynamic-string --enable-version-speci
fic-runtime-libs --disable-isl-version-check --disable-cloog-version-check --dis
able-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath
--disable-win32-registry --disable-nls --disable-werror --disable-symvers --with
-gnu-as --with-gnu-ld --with-arch=nocona --with-tune=core2 --with-libiconv --wit
h-system-zlib --with-gmp=/tmp/mingw-prereq/x86_64-w64-mingw32-static --with-mpfr
=/tmp/mingw-prereq/x86_64-w64-mingw32-static --with-mpc=/tmp/mingw-prereq/x86_64
-w64-mingw32-static --with-isl=/tmp/mingw-prereq/x86_64-w64-mingw32-static --wit
h-cloog=/tmp/mingw-prereq/x86_64-w64-mingw32-static --enable-cloog-backend=isl -
-with-pkgversion='rev5, Built by MinGW-W64 project' --with-bugurl=http://sourcef
orge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/tmp/x64-481-posix-seh-r5/libs/i
nclude -I/tmp/mingw-prereq/x64-zlib/include -I/tmp/mingw-prereq/x86_64-w64-mingw
32-static/include' CXXFLAGS='-O2 -pipe -I/tmp/x64-481-posix-seh-r5/libs/include
-I/tmp/mingw-prereq/x64-zlib/include -I/tmp/mingw-prereq/x86_64-w64-mingw32-stat
ic/include' CPPFLAGS= LDFLAGS='-pipe -L/tmp/x64-481-posix-seh-r5/libs/lib -L/tmp
/mingw-prereq/x64-zlib/lib -L/tmp/mingw-prereq/x86_64-w64-mingw32-static/lib -L/
tmp/x64-481-posix-seh-r5/mingw64/opt/lib '
Thread model: posix
gcc version 4.8.1 (rev5, Built by MinGW-W64 project)
 
C:\Program Files\mingw-builds\x64-4.8.1-posix-seh-rev5\mingw64\bin>g++ --version
 
g++ (rev5, Built by MinGW-W64 project) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

実行例

FreeBSDの場合

g++49 -std=c++11 -Wl,-rpath=/usr/local/lib/gcc49/

関連項目