リスト/コンパイラ
提供: MacWiki
2019年3月10日 (日) 15:17時点における126.117.203.74 (トーク)による版
MacOSX用のコンパイラの情報。
High Performance Computing for Mac OS X (http://hpc.sourceforge.net/) も参考になります。
目次
C/C++コンパイラ
gcc
- OSX標準のコンパイラで Developer Tools に含まれています。
⇒ gcc を参照して下さい。
- 2019年現在,gccはLLVMベースのApple Clangに置き換えられました。
Intel C++ コンパイラー Mac OS 版
商用コンパイラ。Math Kernel Library, IPP なども付属。
- バグ
- C/C++ preprocessor does NOT work on CASE-SENSITIVE!! 問い合わせ中
$ icpc -v icpc version 14.0.3 (gcc version 4.8.1 compatibility)
$ cat test.C #include "test.H" #include "Test.H"
$ cat test.H #ifndef test_H #define test_H Here is in "test.H" #endif
$ cat Test.H #ifndef Test_H #define Test_H Here is in "Test.H" #endif
$ icpc -E test.C # 1 "test.C" # 1 "test.H" 1 Here is in "test.H" # 2 "test.C" 2
$ icc -E test.C # 1 "test.C" # 1 "test.H" 1 Here is in "test.H" # 2 "test.C" 2
$ icpc -E -Qlocation,cpp,/usr/bin/ test.C # 1 "test.C" # 1 "test.H" 1 Here is in "test.H" # 2 "test.C" 2
$ /usr/bin/cpp test.C # 1 "test.C" # 1 "<built-in>" 1 # 1 "<built-in>" 3 # 169 "<built-in>" 3 # 1 "<command line>" 1 # 1 "<built-in>" 2 # 1 "test.C" 2 # 1 "./test.H" 1 Here is in "test.H" # 2 "test.C" 2 # 1 "./Test.H" 1 Here is in "Test.H" # 3 "test.C" 2
PGI C++ コンパイラー Mac OS 版
Fortranコンパイラ
g77, gfortran (GNU F95)
gfortranは、Fink, Homebrew, EasyPackage, MacPorts, MacOSX WorkShop からも導入できます
- 下記の導入の際にはgfortranを必要とします。
- ただし gfortran のバージョン等によってはこれらを正常にビルドできないこともあるようです(例:https://github.com/mxcl/homebrew/issues/18997)
gfortranのバイナリ(インストーラー)も各種のところから入手できます。
- http://gcc.gnu.org/wiki/GFortranBinaries#MacOS
- gfortran-4.6.2 ほか
- http://cran.rstudio.com/bin/macosx/tools/
- gfortran-4.2.3
- http://r.research.att.com/tools/
- homebrew の install apple-gcc42 で、ここの gcc-4.2 と gfortran-4.2 をインストールするようです。
なお、g77デフォルトではUnit番号が99までしか使えません.これを解決するにはg77のソースを修正してコンパイルし直す必要があります.いまのところMacOSX 10.2ではうまく行きましたが10.3ではうまく行っていません.
- http://homepage.mac.com/ken_thra/Personal12.html
- http://www-jlc.kek.jp/~fujiik/macosx/10.2.X/memo/G77onX.html
- http://www-gpsg.mit.edu/~simon/gtgk/faq.htm
Absoft Pro Fortran
- 商用コンパイラ。
- http://www.hulinks.co.jp/software/pf/
- http://www.hulinks.co.jp/software/pf_mac/
- http://www.hulinks.co.jp/software/pf_mac/price.html
- http://www.watsonkun.com/software/xlf_mac/index.html
- http://www.absoft.com/Products/Compilers/Fortran/Macintosh/OSX/OSX.html
バージョン9.2で、Tigerで動作する64ビットコードを生成できるようになったそうです。
IBM XL Fortran
- 商用。
- http://www.hulinks.co.jp/software/xlf_mac/index.html
- http://www.absoft.com/Products/Compilers/Fortran/Macintosh/XLF/xlf.html
- Absoft にOEM供給されている?という話を聞きます。ProFortranとの違い(位置づけ/製品内容)がよくわかりません。
- .bash_profile に次の path 設定を追記しておく
PATH=$PATH:/opt/ibmcmp/xlf/8.1/bin export PATH
Intel Fortran コンパイラー Mac OS 版
- 商用コンパイラ。Math Kernel Library 付属。
- Intelからの直販もあり
- 製品情報
- 価格は $699
- トラブルシューティング
This process is attempting to exclude an item from Time Machine by path without administrator privileges. This is not supported.
というエラーメッセージが繰り返し出る場合は、ifort を一度 su 権限で使ってみると良い (例えば、--version オプションでバージョン記号を出力してみる)。
$ su ifort --version
NAG Fortran(Mac版)
- 商用。*英国The Numerical Algorithms Group Limitedで開発、国内では日本法人日本ニューメリカルアルゴリズムズグループ(株)が総代理店
- 特にセキュリティー脆弱性やバグの温床となる初期化に関する問題や、
移植性を損なう標準非準拠に関する情報を的確にユーザに示すプログラム診断が充実。 この機能はコンパイル時、実行時(-C)との可能であるが、その分速度が落ちるので、開発時のみ有効にしたほうがよい
- メイン開発者はFortranワーキンググループ(ISO/IEC JTC1/SC22/WG5)のメンバー。
Fortranワーキンググループ(ISO/IEC JTC1/SC22/WG5)公式サイト http://www.nag.co.uk/sc22wg5/
- Fortran 90/95にフル対応。Fortran 2003の主要機能(オブジェクト指向、C相互運用、IEEE算術のサポート、ストリーム入出力、非同期入出力など)にも対応。
- Windows、MAC、FreeBSD、Linux32、Linux64、Solaris、AIX、HP-UX、IRIX版などがあり多くの環境をサポート。
- ただしWindows版はFortran Builderに統合されている。
- NPMIN51NA - Apple Intel Mac OS X Licensing for NAG Fortran Compiler
- NPAMP51NA - Apple Power Mac OS X Licensing for NAG Fortran Compiler
- NPMI651NA - Apple Intel Mac OS X (64-bit) Licensing for Fortran Compiler