&color(red){修正中};

解析用プログラムは
 /Appl
を起点として配下にOS毎のフォルダを設置。そのOSフォルダ名は コマンド(/bin/uname)の結果を利用する。
ほとんどIntel-Linuxで稼働させる場合には無用なのだろうが、MacOSXでとかSolaris(??)で仕事されたい
方もおられる。故、汎用性を持たせてのフォルダ形式としてみた
具体的には
 /Appl/Linux
 /Appl/Darwin
とかになるのだろう。

PATHとかの環境変数を決めるスクリプトは下記のように作成して、このファイルを各自の
.bashrcとか.cshrcとかに組み込ませる。事前に ''/etc/skel/.bashrc'' と ''/etc/skel/.cshrc'' に書いておくのもあり。
具体的には、各ユーザの.bashrcとか.cshrcの最終行に
 .bashrcなら
  source /Appl/Common/Linux.bash
 .cshrcなら
  source /Appl/Common/Linux.csh
を入れる。
//おおよそ下図のようなイメージ。
//&ref(2012y09m07d_072253728.png,nolink,noborder);

**シェル別読み込みファイル [#y6c86744]
ユーザが使用するシェルごとにファイルを用意します。
加え
■autoSHARP
autoSHARPの環境変数を定義するとccp4iからautoSHARPが実行できるが、autoSHARPはライセンスが必要で
どの計算機でも使える訳ではない。実行可能な計算機ならその環境ファイルを読み込めばいいようにした。



***Bash向け [#f09b5d04]
-/Appl/Common/bashrc
 #/bin/bash
 unset autologout
 set   nobeep
 #-----------------------------------------#
 [ -f /sbin/uname ] && system=`/sbin/uname`
 [ -f /bin/uname ]  && system=`/bin/uname`
 #-----------------------------------------#
 case "$system" in
   "Linux")
        [ -f /Appl/Common/Linux.sh ] && source /Appl/Common/Linux.sh
        ;;
   "Darwin")
        [ -f /Appl/Common/sh.Darwin] && source /Appl/Common/Darwin.sh
        ;;
    *) echo No match!!;;
 esac
 #-----------------------------------------#
 [ -f /bin/hostname ] && host=`/bin/hostname -s`
 #-----------------------------------------#
 case "$host" in
   "sharp")
        [ -f /opt/sharp/setup.sh ] && source /opt/sharp/setup.sh
        ;;
 esac
 unset system  host

***csh向け [#r01e7424]
-/Appl/Common/cshrc
 #!/bin/csh
 unset autologout
 #-----------------------------------------#
 if ( -f /bin/uname )     set system = `/bin/uname`
 if ( -f /usr/bin/uname ) set system = `/usr/bin/uname`
 #-----------------------------------------#
 switch ( $system )
        case 'Linux':
                if ( -f /Appl/Common/Linux.csh ) source /Appl/Common/Linux.csh
                breaksw
        case 'Darwin':
                if ( -f /Appl/Common/Darwin.csh ) source /Appl/Common/Darwin.csh
                breaksw
        default:
 endsw
 #-----------------------------------------#
 if ( -f /bin/hostname ) set host = `/bin/hostname -s`
 #-----------------------------------------#
 switch ( $host )
        case 'sharp':
                if ( -f /opt/sharp/setup.csh ) source /opt/sharp/setup.csh
                breaksw
        default:
 endsw
 unset system
 unset host 

**解析アプリ設定ファイル [#k8692593]
各OS各shellでの環境変数をまとめたファイルも用意する。


***Bash向け [#m4051a29]
/Appl/Common/Linux.sh
 #!/bin/sh
 #-----------------------------------------#
 #
 # ccp4
 source /Appl/Linux/ccp4-6.3.0/bin/ccp4.setup-sh
 #
 # coot
 export PATH=/Appl/Linux/coot/bin:$PATH
 #
 # phenix
 source /Appl/Linux/phenix/phenix-1.8-1069/phenix_env.sh
 #
 # cns [cns_solve_env.shは独自作成です]
 source /Appl/Linux/cns_solve_1.3/cns_solve_env.sh
 #
 # pymol、Uppsalaら
 export PATH=/Appl/Linux/bin:$PATH
 #
 # shelx
 export PATH=/Appl/Linux/shelx:$PATH

***csh向け [#af9e2c67]
/Appl/Common/Linux.csh
 #!/bin/sh
 #-----------------------------------------#
 #
 # ccp4
 source /Appl/Linux/ccp4-6.3.0/bin/ccp4.setup-csh
 #
 # coot
 setenv PATH /Appl/Linux/coot/bin:$PATH
 #
 # phenix
 source /Appl/Linux/phenix/phenix-1.8-1069/phenix_env
 #
 # cns
 source /Appl/Linux/cns_solve_1.3/cns_solve_env
 #
 # pymol、Uppsalaら
 setenv PATH /Appl/Linux/bin:$PATH
 #
 # shelx
 setenv PATH /Appl/Linux/shelx:$PATH

***マシンごとへの対応 [#f775de78]
/etc/profile.dを使う

1

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS