SuSE linux 10.1とFedora core 3にIRAFをインストールしたときのメモ。
大部分は川端善仁氏の「IRAFのインストールのすすめ」を参考。
()内はFedora coreの場合。
IRAF本体
- IRAFのルートディレクトリを作る
rootで、
# mkdir /iraf
# mkdir /iraf/iraf
- irafユーザーを作る
そのままrootで、
# useradd -d /iraf/iraf/local -s /bin/csh iraf
などでirafユーザーを作る。
(ログインディレクトリは/iraf/iraf/local, ログインシェルはCシェル)
- /irafディレクトリの属性変更
# chown iraf /iraf
# chgrp users /iraf
# chown iraf /iraf/iraf
# chgrp users /iraf/iraf
rootをいったん抜ける。
- 必要ファイルのダウンロード
irafでログインし直し、http://iraf.noao.edu/iraf/ftp/iraf/v212/PCIX/ から
as.pcix.gen.gz
ib.suse.x86.gz (ib.lnux.x86.gz)
nb.suse.x86.gz (nb.lnux.x86.gz)
を適当な場所にダウンロードする。
- ディレクトリの作成
# mkdir /iraf/irafbin
# mkdir /iraf/irafbin/bin.suse (bin.redhat)
# mkdir /iraf/irafbin/noao.bin.suse (noao.bin.redhat)
- ファイルの展開
/iraf/iraf/ で
# cat (ファイルのあるPATH)/as.pcix.gen.gz | zcat | tar xpf -
/iraf/irafbin/bin.suse/ で
# cat (ファイルのあるPATH)/ib.suse.x86.gz | zcat | tar xpf -
/iraf/irafbin/noao.bin.suse/ で
# cat (ファイルのあるPATH)/nb.suse.x86.gz | zcat | tar xpf -
- インストール
新しくできているはずの /iraf/iraf/unix/hlib/ に移って
# source irafuser.csh
(もしくは実行権限をつけて
# ./irafuser.csh)
# ./install -n
Configure IRAF Networking on this machine? だけは no と答える。
ルートに移って
# ./install
こちらもConfigure IRAF Networking on this machine? だけは no と答える。
- 起動
一度ログアウトし直して、
#cl
で起動すればOK。
x11iraf
xgtermを使うために必要な環境を整える。
- ダウンロード
http://iraf.noao.edu/iraf/ftp/iraf/x11iraf/ から
x11iraf-v1.3.1-bin.suse.tar.gz (x11iraf-v1.3.1-bin.redhat.tar.gz)
をダウンロードして、/usr/local/src/ に保存。
- ファイルの展開、インストール
rootになって、/usr/local/src/ で
# cat x11iraf-v1.3.1-bin.suse.tar.gz | zcat | tar xf -
# ./install
- 起動
自分のアカウントでログインし直して、
# xgterm &
で起動すればOK。
Fedora coreではこれが通らないので、
http://iraf.noao.edu/new_stuff/xgterm_fedora.html からバイナリをとってきて、
上でインストールしてできたバイナリと置き換える。
Linuxが新しいと起動しようとしたときに、
xgterm: error while loading shared libraries: libncurses.so.4: cannot open shared object file: No such file or directory
と言われる。
この場合はシンボリックリンクで対応。libncurses.so.5の場所へ行き、
# cd /lib
# ln -s libncurses.so.5 libncurses.so.4
とすれば起動するようになる。
ds9
- ダウンロード
http://hea-www.harvard.edu/RD/ds9/ から
ds9.linux.4.0b10.tar.gz
をダウンロードして、/usr/local/src/ に保存。
- ファイルの展開
rootになって、/usr/local/src/ で
# tar xvzf ds9.linux.4.0b10.tar.gz
とするとds9という実行ファイルができるので、これをパスの通っているところに置く。
使いたい人の実行権限をつけて、その人が
# ds9
として起動すればOK。
以上で準備は終了。
使いたい人が使いたいディレクトリで
# mkiraf
とすれば、login.clができる。
STSDAS
- ダウンロード
ftp://ftp.stsci.edu./pub/software/stsdas/stsdas_v3.7/binaries/ から、
以下の4つをダウンロードする。
tables37.bin.redhat.tar.gz
tables37.tar.gz
stsdas37.bin.redhat.tar.gz
stsdas37.tar.gz.part
- 準備1
/iraf/iraf/unix/hlib/ にある、extern.pkgを以下のように編集する。
---------------------------------
#reset tables = /iraf/extern/tables/
#task tables.pkg = tables$tables.cl
reset tables = /usr/local/tables/
task tables.pkg = tables$tables.cl
reset stsdas = /usr/local/stsdas/
task stsdas.pkg = stsdas$stsdas.cl
task apropos = stsdas$apropos.cl
reset helpdb = "lib$helpdb.mip\
,noao$lib/helpdb.mip\
,tables$lib/helpdb.mip\
,stsdas$lib/helpdb.mip\
"
---------------------------------
- 準備2
rootになって、ディレクトリを準備
# cd /usr/local
# mkdir tables
# mkdir stsdas
# chown iraf tables
# chown iraf stsdas
# chgrp users tables
# chgrp users stsdas
- ファイルの展開
iraf ユーザーになって(# su iraf)、それぞれ以下のディレクトリで展開する。
# cd /usr/local/tables/
# tar xvzf tables37.tar.gz
# cd /usr/local/tables/bin.suse/
(# cd /usr/local/tables/bin.redhat/)
# tar xvzf tables37.bin.redhat.tar.gz
SuSEに入れるときでもバイナリはRedhatのものでよい。
# cd /usr/local/stsdas/
# tar xvzf stsdas37.tar.gz
# cd bin.suse/
(# cd bin.redhat/)
# tar xvzf stsdas37.bin.redhat.tar.gz
- Python関連のコンパイル
# cd /usr/local/stsdas
# python python/compileall.py ./python
# python python/compileall.py ./python/*
いくつかエラーが出るが気にしなくてよい。
- ヘルプの構築
irafユーザーのホームディレクトリでIRAFを起動後、
cl> softools
cl> mkhelpdb helpdir=tables$lib/root.hd helpdb=tables$lib/helpdb.mip
cl> mkhelpdb helpdir=stsdas$lib/root.hd helpdb=stsdas$lib/helpdb.mip
L.A.Cosmic
http://www.astro.yale.edu/dokkum/lacosmic/
http://www.astro.wisc.edu/~cigan/reducing/lacos/lacos.html
を参照。
基本的に、ダウンロードしてどこかにおいておけばOK。
使うときは、login.clとかに、
task lacos_spec=/(PATH)/lacos_spec.cl
task lacos_im=/(PATH)/lacos_im.cl
を書いておく。
Color
http://iraf.noao.edu/scripts/extern/color.pl
http://iraf.noao.edu/iraf/ftp/iraf/extern/color.readme
を参照。
# su iraf
# cd /iraf/iraf/unix/hlib
exterm.pkgを編集。
---------------------------------
reset color = /usr/local/color/
task color.pkg = color$color.cl
reset helpdb = "lib$helpdb.mip\
,noao$lib/helpdb.mip\
,tables$lib/helpdb.mip\
,stsdas$lib/helpdb.mip\
,color$lib/helpdb.mip\
"
---------------------------------
# su
# cd /usr/local/
# mkdir color
上記サイトから、
color.tar.Z
color-bin.redhat.tar.gz
をの二つをダウンロード。
/usr/local/color/で展開。
# tar xzf color.tar.Z
# tar xvzf color-bin.redhat.tar.gz
# mv bin.redhat bin.suse
IRAFを起動して、
cl> color
とすれば各種タスクが使える。
Enhanced CL (ECL)
補完機能と履歴機能を使えるようにする。
インストールは
http://iraf.noao.edu/iraf/web/new_stuff/ecl_beta.html
にある通り。
ftp://iraf.noao.edu/pub/ecl_install_redhat.csh
をダウンロードしてきて適当な場所におき、実行権限をつけてrootで実行。
# su
# chmod 744 ecl_install_redhat.csh
# ./ecl_install_redhat.csh
インストールは問題なく終了するが、ここで普通のユーザに戻り、
# ecl
または
# cl -ecl
と実行すると、以下のようなエラーメッセージが出た。
/iraf/iraf/bin.suse/ecl.e: error while loading shared libraries: libtermcap.so.2:
cannot open shared object file: No such file or directory
google先生に尋ねたところ、/libにlibtermcap.so.2がないから、
ダウンロードするか、シンボリックリンクを作成することで解決している場合が多い。
しかし、/libを見てみると普通にlibtermcap.so.2が存在しており、
一応yastでtermcapを最新版にアップデートしても結果は変わらず。
もう少し調べてみると、使っているマシンが64bitであることが原因っぽい。
ので、termcapをアップデートしたときに見つけた、
termcap-32bit
をインストールしたところ、解決。めでたし。
(追記)
SuSE 10.3ではtermcap-32bitが見付けられなかったので、
先ほどリンクを作成したlibncurses.so.4で代用したらうまくいった。
# cd /lib
# ln -s libncurses.so.4 libtermcap.so
# ln -s libtermcap.so libtermcap.so.2