#author("2023-09-19T13:44:48+00:00","default:sysosa","sysosa")
#author("2023-09-19T14:22:48+00:00","default:sysosa","sysosa")
&size(10){過去記事[[xray/Phenix200716]]};

本家様 [[https://www.phenix-online.org/>+https://www.phenix-online.org/]]
リリース状況 [[https://phenix-online.org/download/nightly_builds.cgi>+https://phenix-online.org/download/nightly_builds.cgi]]

最近だとcryoem系も対応されているみたい.

ここではphenixをCentOS8にインストールしてみた.

[[Phenix/cryoFIT]]

***入手 [#z47fcd22]
アプリケーションを入手するためにはユーザ登録が必要で、[[http://www.phenix-online.org/phenix_request/index.cgi>+http://www.phenix-online.org/phenix_request/index.cgi]]からその登録を行う
登録が完了すると登録したメールアドレスにログインユーザ名とパスワードが送られる。

それを使って、ダウンロードページ[[https://www.phenix-online.org/download/>+https://www.phenix-online.org/download/]]の
&color(orangered){Download};リンクボタンを押下して認証を進めます。

ダウンロード可能なファイルはLinux, macOS, windows毎に用意されている。


ここでは「&color(magenta){phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6.tar.gz};」を取得した

***展開 [#ked4eef3]

取得したファイルをまずは展開します
#code(nonumber){{
[root@centos8 ~]# cd /apps/src/
[root@centos8 src]# tar xzf phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6.tar.gz
[root@centos8 src]# cd phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6/

[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# 
}}
っで、普通ならinstallコマンドを実行すればそれで終わりなのだが、、、

#code(nonumber){{
[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# ./install --prefix=/apps
./install: line 15: /usr/bin/python: No such file or directory

[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]#
}}
と無碍なく終わる.
インストールスクリプトの中身を確認すると
#code(nonumber){{
[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# cat install
#!/bin/bash
if [ -z "$PYTHON_EXE" ]; then
  PYTHON_EXE='/usr/bin/python'
  if [ -f "/usr/bin/python2.7" ]; then
    PYTHON_EXE='/usr/bin/python2.7'
  elif [ -f "/usr/bin/python2.6" ]; then
    PYTHON_EXE='/usr/bin/python2.6'
  elif [ -f "/usr/bin/python2" ]; then
    PYTHON_EXE='/usr/bin/python2'
  elif [ -f "./conda_base/bin/python" ]; then
    PYTHON_EXE='./conda_base/bin/python'
  fi
fi
unset CONDA_PREFIX
$PYTHON_EXE ./bin/install.py $@

[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]#
}}
とある. 現状まだpython3には対応されていないご様子.
CentOS8のpython2.7環境は標準では用意されていないので、まずはそこから準備します

#code(nonumber){{
[root@centos8 ~]# dnf install python2
}}

その上でインストールを試みると
#code(nonumber){{
[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# ./install --prefix=/apps

    ==========================================================================
                          Phenix Installation

                          version: 1.18.2-3874
                     machine type: intel-linux-2.6-x86_64
                       OS version: 4.18.0-193.6.3.el8_2.x86_64
                      destination: /apps/phenix-1.18.2-3874
                  # of processors: 4
    =========================================================================

/usr/bin/env: ‘python’: No such file or directory
Traceback (most recent call last):
  File "./bin/install.py", line 244, in <module>
    installer(sys.argv[1:]).install()
  File "/apps/src/phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6/lib/libtbx/auto_build/install_distribution.py", line 200, in install
    self.install_from_binary()
  File "/apps/src/phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6/lib/libtbx/auto_build/install_distribution.py", line 335, in install_from_binary
    subprocess.check_call([unpack_cmd])
  File "/usr/lib64/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['./bin/conda-unpack']' returned non-zero exit status 127

[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]#
}}
と言われてしまう...

「&color(red){/usr/bin/env: ‘python’: No such file or directory};」

なので、python は python2 を示すように調整する。使うのは「alternatives」コマンド
#code(nonumber){{
[root@centos8 ~]# alternatives --config python

There are 3 programs which provide 'python'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/libexec/no-python
   2           /usr/bin/python3
   3           /usr/bin/python2

Enter to keep the current selection[+], or type selection number: 3     <--[3]と入力

[root@centos8 ~]#
[root@centos8 ~]# python -V
Python 2.7.17

[root@centos8 ~]#
}}
このように「python」と打てば python2 が対応するようになる. 

再びインストールを試みる
#code(nonumber){{
[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# rm -rf /apps/phenix-1.18.2-3874/  <-- 一度削除する
[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]# ./install --prefix=/apps
 :
 :
==========================================================================

                      PHENIX installation complete
                      ----------------------------

 You can begin using PHENIX now by setting your environment with the
 'source' command:

   csh users:
     source /apps/phenix-1.18.2-3874/phenix_env.csh

   bash users:
     source /apps/phenix-1.18.2-3874/phenix_env.sh

 To use PHENIX, go to a work directory and type:

   phenix

 You may wish to put the source statement in your .cshrc or .bashrc
 file.



**************************
* Installation complete! *
**************************

[root@centos8 phenix-installer-1.18.2-3874-intel-linux-2.6-x86_64-centos6]#
}}
っでうまく行ったみたい.


***ubuntu20.04の上にphenix [#l39f486d]
とある理由でsingularityの中で作ることになった
っで製作
#code(nonumber){{
illya@ubuntu:~$ singularity build --sandbox ubuntu20.04 docker://ubuntu:20.04
illya@ubuntu:~$
illya@ubuntu:~$ singularity shell --writable --fakeroot --bind /Public/:/mnt/ ./ubuntu20.04/
Singularity> id
uid=0(root) gid=0(root) groups=0(root)
Singularity> 
Singularity> pwd
/root
Singularity> apt update
Singularity> apt install xserver-xorg
Singularity> apt install locales
Singularity> apt install vim

Singularity> mkdir /apps

Singularity> cp /mnt/phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz .
Singularity> tar xf phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz
Singularity> cd phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6
Singularity> ./install --prefix=/apps

Singularity> vi /etc/locale.gen

 (en_GBの全てとen_US.UTF-8を有効にします)

Singularity> locale-gen
Generating locales (this might take a while)...
  en_GB.ISO-8859-1... done
  en_GB.ISO-8859-15... done
  en_GB.UTF-8... done
  en_US.UTF-8... done
Generation complete.
Singularity>
Singularity> exit
exit
illya@ubuntu:~$

illya@ubuntu:~$ cat ubuntu20.04/apps/phenix-1.20.1-4487/phenix_env.sh >> ubuntu20.04/environment

illya@ubuntu:~$ singularity build --fakeroot ubuntu20.04-phenix-1.20.1.sif ubuntu20.04/
}}
使う

#code(nonumber){{
illya@ubuntu:~$ singularity exec ./ubuntu20.04-phenix-1.20.1.sif phenix
}}


***rockylinux9.2のSingularityでphenix [#w8726ec0]
#code(nonumber){{
[illya@slurm ~]$ singularity build --sandbox  phenix docker://rockylinux:9.2
[illya@slurm ~]$ vi phenix.def
BootStrap: docker
From: rockylinux:9.2

[illya@slurm ~]$ singularity shell --writable --fakeroot -B /Public:/mnt phenix
Singularity> id
uid=0(root) gid=0(root) groups=0(root)
Singularity> dnf install libXxf86vm langpacks-en
Singularity> cd /usr/local
Singularity> tar xf /mnt/em/phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz
Singularity> cd ./phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6/
Singularity> ./install --prefix=../
Singularity> cd ..
Singularity> rm -rf phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6
Singularity> exit
%post
  dnf install libXxf86vm langpacks-en -y
  cd /usr/local
  curl -O http://c/em/phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz  <-- 内部に建てたemリポジトリ
  tar xf phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz
  cd ./phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6/
  ./install --prefix=../
  cd ..
  rm -rf phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6
  rm -rf phenix-installer-1.20.1-4487-intel-linux-2.6-x86_64-centos6.tar.gz

[illya@slurm ~]$ singularity shell  phenix
Singularity> export LC_ALL=C
%environment
  export PHENIX=/usr/local/phenix-1.20.1-4487
  export PHENIX_VERSION=1.20.1-4487
  export PATH=/usr/local/phenix-1.20.1-4487/build/bin:$PATH

[illya@slurm ~]$
[illya@slurm ~]$ singularity build --fakeroot phenix.sif phenix.def
[illya@slurm ~]$
[illya@slurm ~]$ singularity exec ./phenix.sif phenix
}}
1

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