====== Finkによる環境構築 ====== 以下の作業は管理者権限を取得できるユーザ(sudoが実行できるユーザ)で実行する - finkインストールの前にXcodeがインストールされていることを確認する。Xcodeがインストールされていない場合はApp Storeからダウンロードしてインストールしでおく。 - [[http://sourceforge.net/projects/fink/|SourceForge]]から最新のfinkをダウンロードする。(2017/7/7時点で0.41.1) - 書庫ファイルを展開$ tar zxvf fink-0.29.10.tar - ''INSTALL.html''をよく読む。$ cd fink-0.29.10 $ open INSTALL.html - finkのインストール$ ./bootstrapもしくは$ ./bootstrap /sw ここで Under Mac OS X 10.12.2, Fink must be bootstrapped or updated with gcc 4.2, however, you currently have gcc (unknown version) selected. Make sure that your developer tools are current for your system and have not been locally modified.のようなメッセージが出る場合Xcodeのlicense agreementへの同意が必要。これは $ gcc Agreeing to the Xcode/iOS license requires admin privileges, please run “sudo xcodebuild -license” and then retry this command. $のように確認できる。そこで $sudo xcodebuild -license を実行しパスワード入力後スペースキーを連打、最後の質問に"agree"と答える。 - ここで Verifying that installed Xcode Command Line Tools version is supported... ERROR: I couldn't find the correct receipt for the Command Line Tools for your OS X version. Tools from a prior OS X version won't work properly. You can install them by running the command xcode-select --install in a terminal window, and then selecting Install in the dialog window that pops up, or download them from developer.apple.com. After they are installed, try the bootstrap operation again. - finkのインストール$ ./bootstrap /sw $ /sw/bin/pathsetup.sh - unstableパッケージを有効にする。$ sudo vi /sw/etc/fink.conf -Trees: local/main stable/main stable/crypto +Trees: local/main stable/main stable/crypto local/bootstrap unstable/main unstable/crypto 一旦terminalを閉じて、再度terminalを起動する。$ fink selfupdate $ fink update-all - gfortranのインストール$ fink install gcc43 - atlasのインストール$ fink install atlas - NetCDFのインストール$ fink install netcdf $ fink install netcdf-gfortran - FFTWのインストール$ fink install fftw ====== Fink on Leopard ====== OS X 10.5.xで、finkがちょっと混乱していたので再インストールした。 ====== Preparation ====== * [[http://www.finkproject.org/index.php|{{http://www.finkproject.org/img/mlogo.png|finkオフィシャルサイト}}]][[http://www.finkproject.org/index.php|finkオフィシャルサイト]]から最新版のfinkインストーラをダウンロードする。ドキュメント作成時のバージョンはFink 0.9.0。作業した機械はPowerMac11,2っていう機種IDの機器でこれはPowerPC G5プロセッサ機なので''Fink-0.9.0-PowerPC-Installer.dmg''をダウンロードした。 * めんどくさいので、$ sudo mv /sw /sw.oldとして古いfinkを消去。 ====== Install ====== インストール直後のバージョンを確認 $ fink --version Package manager version: 0.27..... Distribution version: 0.9.0.... 最新バージョン(0.28.x)にするため''fink selfupdate''をかける必要がある。また、ここでの目標の一つに''gfortran''と''g95''をインストールすることが挙げられるが、''g95''はソースコードレベルの配布しかされていないので配布の方法をrsyncかcvsに変更する必要がある。このドキュメント作成時に置いてはLeopard (OS X 10.5.x)のfink 0.28.xはrsyncで配布されていないので必然的に今回はcvsでソースをゲットしてインストールすることにするとして''fink selfupdate-cvs''をかけると、 $ fink selfupdate-cvs . . . $ fink --version Package manager version: 0.28.7 Distribution version: selfupdate-cvs (0.9.0), 10.5, powerpc 念のためもう一回 $ fink selfupdate-cvs . . . Reading Package Lists... Building Dependency Tree... Scanning package description files.......... Information about 4180 packages read in 1 seconds. No packages to install. The core packages have been updated. You should now update the other packages using commands like 'fink update-all'. $ fink update-all Information about 4180 packages read in 0 seconds. No packages to install. 軽く''wget''あたりで動作確認。 $ fink install wget Information about 4180 packages read in 1 seconds. The following package will be installed or updated: wget ... wget (1.10.2-15) を設定しています ... * Wget: (wget). The non-interactive network downloader. install-info(/sw/share/info/wget.info): creating new section `Network Applications' $ wget wget: URLがありません 使い方: wget [オプション]... [URL]... 詳しいオプションは `wget --help' を実行してください。 $ Fortranコンパイラを探す。 $ fink list | grep ortran ... f2c 20030428-1 Convert Fortran 77 source to C source fort77 1.18-17 Perl script to invoke f2c Fortran translator g77 3.4.3-14 GNU Fortran compiler g95 0.91-1002 Another GNU Fortran 95 compiler ... gfortran [virtual package] gfortran-shlibs [virtual package] ... Fortranではなくortranを探すあたりがバッドノウハウ。わざわざ正規表現を使うまでもない。 gfortranはGNU Compiler Collectionに含まれているので、gcc43をインストール。 $ fink install gcc43 これはとっても暇がかかるので、帰る前か会議に行く前にやるべし。 fink-0.28.0はhttp://downloads.sourceforge.net/fink/fink-0.28.0.tar.gzにある。 $ wget http://downloads.sourceforge.net/fink/fink-0.28.0.tar.gz $ tar -xvzf fink-0.28.0.tar.gz $ cd fink-0.28.0 $ ./bootstrap <--こいつは結構時間がかかる $ /sw2/bin/pathsetup.sh $ exit 一旦ターミナルを閉じて再起動後 $ fink selfupdate-rsync