「Intel C++」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
 
(アーカイブに変更)
タグ: 新規リダイレクト
 
(他の1人の利用者による、間の5版が非表示)
1行目: 1行目:
[[Category:開発]]
 
[[en:Intel C++]]
 
[[it:Intel C++]]
 
[[zh-CN:Intel C++]]
 
{{Related articles start}}
 
{{Related2|Arch Build System|ABS}}
 
{{Related2|Creating Packages|パッケージの作成}}
 
{{Related2|Makepkg|Makepkg}}
 
{{Related articles end}}
 
   
  +
#redirect [[ArchWiki:アーカイブ]]
Linux 版の Intel® C++ Composer XE (旧名 Intel® C++ Compiler Professional Edition) を Arch でインストールして使用する方法。
 
  +
[[Category:アーカイブ]]
 
== はじめに ==
 
 
{{Note|icc によってコンパイルされたパッケージは実行するのに '''intel-openmp''' パッケージに含まれるライブラリに依存します。'''intel-openmp''' は '''intel-compiler-base''' に依存しているため、ユーザーは両方のパッケージをインストールする必要があります。}}
 
 
== セットアップとインストール ==
 
 
{{AUR|intel-parallel-studio-xe}} は [[AUR|AUR]] から入手可能です。このパッケージをビルドするには、ライセンスファイルが必要で、個人利用や非商用目的に限り無料です。必要なライセンスファイルは[https://registrationcenter.intel.com/RegCenter/AutoGen.aspx?ProductID=1517&AccountID=&EmailID=&ProgramID=&RequestDt=&rm=NCOM&lang= 登録]時にメールで送られてくるので ''makepkg'' を実行する前に {{ic|$startdir}} にコピーしてください。現在の PKGBUILD は7個または8個のパッケージを作成します:
 
 
* '''intel-compiler-base''' - Intel C/C++ コンパイラと基本ライブラリ
 
* '''intel-fortran-compiler''' - Intel fortran コンパイラと基本ライブラリ (Parallel Studio XE のみ)
 
* '''intel-openmp''' - Intel OpenMP ライブラリ
 
* intel-idb - Intel C/C++ デバッガ
 
* intel-ipp - Intel Integrated Performance Primitives
 
* intel-mkl - Intel Math Kernel Library (Intel® MKL)
 
* intel-sourcechecker - Intel Source Checker
 
* intel-tbb - Intel Threading Building Blocks (TBB)
 
 
{{Note|最低でも '''intel-compiler-base''' と '''intel-openmp''' パッケージが必要となります。fortran のコンパイラも必要な場合は '''intel-fortran-compiler''' をインストールしてください。}}
 
 
== makepkg で icc を使う ==
 
 
{{Note|Not every package will successfully compile with icc without heavy modifications to the underlying source.}}
 
 
今のところ makepkg で icc を使用する公式ガイドは存在しません。このセクションではユーザーによって提案された様々な方法をまとめています。方法を提案するときは新しいサブセクションを作成してください。
 
 
=== 方法 1 (12/08/2012) ===
 
 
Modify {{ic|/etc/makepkg.conf}} inserting the following code ''under'' the existing line defining {{ic|CXXFLAGS}} to enable makepkg to use icc. No special switches are needed when calling makepkg to build.
 
 
{{bc|1=_CC=icc
 
if [ $_CC = "icc" ]; then
 
export CC="icc"
 
export CXX="icpc"
 
export CFLAGS="-march=native -O3 -no-prec-div -fno-alias -pipe"
 
export CXXFLAGS="${CFLAGS}"
 
export LDFLAGS="-Wl,-O1,--sort-common,--as-needed"
 
export AR="xiar"
 
export LD="xild"
 
fi}}
 
 
{{Note|
 
* To toggle between the native gcc and icc, simple comment or uncomment the newly created {{ic|_CC}} variable.
 
* In some case the compilation method described above fails and the compilation will be performed with ''gcc'', so you should test if yours application has been effectively compiled with ''icc''.}}
 
 
To test if your package has been really compiled with icc:
 
 
* Type the command {{ic|ldd [your_app] | grep intel}} If the application is linked to a shared object located in the directory {{ic|/opt/intel/lib/}} it's mind that has been complied with icc.
 
 
* Another method is to observe the build output and watch if it's using the ''icc'' or ''icpc'' command.
 
 
* The last method is to watch if the warnings are in ''icc'' style or not.
 
 
== icc の CFLAGS ==
 
 
In general, icc supports many of the same CFLAGS gcc supports and is also pretty tolerant to gcc flags it cannot use. In most cases it will happily ignore the flag warning the user and moving on. For an exhaustive list and explanation of available compiler flags, consult the icc manpage or better yet by invoking the compiler with the help flag:
 
icc --help
 
 
=== -xX ===
 
 
Use to generate specialized code to run exclusively on processors supporting it. If unsure which option to use, simply inspect the {{ic|flags}} section of {{ic|/proc/cpuinfo}}. In the example below, {{ic|SSE4.1}} would be the correct selection:
 
 
{{hc|$ grep -m 1 flags /proc/cpuinfo|
 
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush
 
dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs
 
bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr
 
pdcm sse4_1 lahf_lm dts tpr_shadow vnmi flexpriority
 
}}
 
 
* -xHost
 
* -xSSE2
 
* -xSSE3
 
* -xSSSE3
 
* -xSSE4.1
 
* -xSSE4.2
 
* -xAVX
 
* -xCORE-AVX-I
 
* -xSSSE3_ATOM
 
 
{{Tip|Use the '''-xHost''' flag if unsure what your specific processor supports.}}
 
 
=== -Ox ===
 
 
Same behavior as gcc. x is one of the following options:
 
* 0 - 最適化を無効化
 
* 1 - optimize for maximum speed, but disable some optimizations which increase code size for a small speed benefit
 
* 2 - optimize for maximum speed (DEFAULT)
 
* 3 - optimize for maximum speed and enable more aggressive optimizations that may not improve performance on some programs (recommended for math intensive looping programs)
 
 
=== -w ===
 
 
Similar to the gcc:
 
* -w - disable all warnings (recommended for the package compilation)
 
* -Wbrief - print brief one-line diagnostics
 
* -Wall - enable all warnings
 
* -Werror - force warnings to be reported as errors
 
 
== Intel C / C++ でソフトウェアをコンパイル ==
 
 
In the following table we report a list of packages from the officials repository that we have tried to compile with the intel C/C++ compiler. The compilation should be done by using the PKGBUILD from ABS.
 
 
{| class="wikitable sortable collapsible" border="1" border="1"
 
|-style="background: #ffdead;"
 
! アプリケーション || コンパイル || コメント
 
 
|-
 
| '''xvidcore''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''kdebase''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''conky 1.9.0''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''nginx 1.4.2''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''gzip 1.6''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''xz''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''lz4''' || style="background: GreenYellow" | OK || PKGBUILD を編集する必要があります
 
|-
 
| '''minetest''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''opus''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''zlib 1.2.8''' || style="background: yellow" | Not recommended || [[#方法 1 (12/08/2012)|方法1]]で動作、ただし tightvnc など一部のアプリでバグが発生します
 
|-
 
| '''Gimp 2.8 / 2.9 ''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''Pacman 4.0.3''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''x264''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''MySql''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''SqlLite''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''lame''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''xaos''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''gegl''' || style="background: Lime" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作
 
|-
 
| '''VLC''' || style="background: Tomato" | Unsuccessful || There's some problem with the compiler flags
 
|-
 
| '''bzip2''' || style="background: Tomato" | Unsuccessful || There's some problem with the compiler flags
 
|-
 
| '''mplayer''' || style="background: pink" | Out of date || Intel コンパイラを認識しません
 
|-
 
| '''optipng''' || style="background: GreenYellow" | OK || [[#方法 1 (12/08/2012)|方法1]]で動作、makepkg.conf で LD=xild をコメントアウトしてください
 
|-
 
| '''python-numpy''' || style="background: GreenYellow" | OK || PKGBUILD を編集する必要があります: {{AUR|python-numpy-mkl}}
 
|-
 
| '''python-scipy''' || style="background: GreenYellow" | OK || PKGBUILD を編集する必要があります: {{AUR|python-scipy-mkl}}
 
|-
 
| '''Qt''' || style="background: GreenYellow" | OK || We must add the option ''-platform linux-icc-64 (or 32)'' in the configure command
 
|-
 
| '''systemd''' || style="background: red" | Fail ||undefined reference to `server_dispatch_message'
 
|}
 
 
'''凡例:'''
 
{|
 
|-
 
| style="background: Lime" | OK || ICC でのコンパイルに問題はありません。
 
|-
 
| style="background: GreenYellow" | OK || コンパイルは上手く行きますが PKGBUILD の編集が必要です。
 
|-
 
| style="background: Tomato" | Unsuccessful || コンパイルは上手く行きますが、コンパイルエラーが多少存在します。
 
|-
 
| style="background: yellow" | Not recommended || コンパイルは上手く行きますが、推奨されません。
 
|-
 
| style="background: red" | Fail || ICC を使ってパッケージをコンパイルできません。
 
|-
 
| style="background: pink" | Out of date || 古い CFLAGS では上手くいきません。新しい[[#方法 1|方法1]]を使ってコンパイルしてみてください (結果をここに載せるのを忘れずに)。
 
|}
 

2024年4月11日 (木) 18:17時点における最新版