#author("2024-09-02T05:24:01+00:00","default:sysosa","sysosa") #author("2024-10-29T13:14:10+00:00","default:sysosa","sysosa") 本家様 [[http://pymol.org/>+http://pymol.org/]] シュレーディンガー社様から販売されております. 一方でそのオープンソース版が存在していてここではそのオープンソース版を作ってみました. [[https://github.com/schrodinger/pymol-open-source>+https://github.com/schrodinger/pymol-open-source]] &size(10){有償版PyMOLはopen source版よりも機能が強化されてます}; &size(10){windowsOS向けopen source版は試してないです..}; ver3.0になったので改めて作ってみた. ***下準備 [#h332c459] #code(nonumber){{ (RockyLinux9) dnf groupinstall "Development Tools" -y dnf install epel-release -y dnf --enablerepo=devel install python3-numpy cmake netcdf-devel glm-devel python-devel glew-devel libpng-devel libxml2-devel freetype-devel python3-qt5 -y }} ***構築 [#lb3a3b5c] #code(nonumber){{ (RockyLinux9) mkdir -p /apps/src && cd /apps/src git clone https://github.com/schrodinger/pymol-open-source cd pymol-open-source/ pip install --prefix /apps/PyMOL . }} ***EnvironmentModules [#if7310ad] /apps/modulefiles/PyMOL #code(nonumber){{ #%Module1.0 set root /apps/PyMOL prepend-path PATH $root/bin prepend-path PYTHONPATH $root/lib64/python3.9/site-packages }} ***メモ [#pb70f2b6] 以上でrockylinux9向けには出来た. ver3.0から pthon3.9以上が必要となりました. rockylinux8のpythonは 3.6、python39もありますが、python3-qt5がpython3.6ベースなので無理. &size(10){「--glut」で逃げれるけど構築が複雑だった..}; なので condaで python3.9 以上の環境を作ってそこでpymolを作ってみました. ***conda環境内で作る(rockylinux8向け) [#b6b7fcfb] condaで仮想環境を作りpymolをコンパイルします。 #code(nonumber){{ (RockyLinux8の下拵え) dnf groupinstall "Development Tools" -y dnf install epel-release -y dnf install --enablerepo=devel,epel cmake netcdf-devel glew-devel libpng-devel libxml2-devel freetype-devel -y dnf install xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil -y dnf install https://dl.rockylinux.org/pub/rocky/9/devel/x86_64/os/Packages/g/glm-devel-0.9.9.8-3.el9.noarch.rpm }} pyenv/anacondaを用意します. &size(10){miniforgeでもいいけど}; #code(nonumber){{ git clone https://github.com/yyuu/pyenv.git /apps/pyenv export PYENV_ROOT=/apps/pyenv export PATH=$PYENV_ROOT/bin:$PATH pyenv install anaconda3-2024.06-1 source /apps/pyenv/versions/anaconda3-2024.06-1/etc/profile.d/conda.sh }} 既にpyenv/anaconda環境があるのなら下記のみを実施します #code(nonumber){{ source /apps/pyenv/versions/anaconda3-2024.06-1/etc/profile.d/conda.sh }} 次にpymol向けの仮想環境を作ります #code(nonumber){{ [root@rockylinux ~]# conda create -n pymol-open-source python numpy qt pyqt [root@rockylinux ~]# conda activate pymol-open-source (pymol-open-source) [root@rockylinux ~]# cd /apps/src (pymol-open-source) [root@rockylinux src]# git clone https://github.com/schrodinger/pymol-open-source (pymol-open-source) [root@rockylinux src]# cd pymol-open-source (pymol-open-source) [root@rockylinux pymol-open-source]# pip install --prefix=/apps/PyMOL . : Successfully installed pymol-3.1.0a0 : (pymol-open-source) [root@rockylinux pymol-open-source]# conda deactivate [root@rockylinux pymol-open-source]# }} EnvironmentModules は下記のようにします /apps/modulefiles/PyMOL #code(nonumber){{ #%Module1.0 prepend-path PATH /apps/PyMOL/bin prepend-path PYTHONPATH /apps/PyMOL/lib/python3.12/site-packages }} これで「module use /apps/modulefiles」「module load PyMOL」として「pymol」で起動します 起動画面はこんな感じ. versionは「3.1.0a0」 &ref(2024y08m23d_024425128.png,nolink,80%); ***condaなしでOS提供で作る [#z62bb429] #code(nonumber){{ dnf install epel-release -y dnf install xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil -y dnf install --enablerepo=epel,devel glew-devel netcdf-devel freetype-devel libxml2-devel libpng-devel cmake -y dnf remove glm-devel -y dnf install https://dl.rockylinux.org/pub/rocky/9/devel/x86_64/os/Packages/g/glm-devel-0.9.9.8-3.el9.noarch.rpm -y dnf --enablerepo=devel install python39-devel python39-numpy -y python3.9 -m pip install --upgrade pip pip3.9 install pyqt5 cd /apps/src git clone https://github.com/schrodinger/pymol-open-source cd pymol-open-source/ pip3.9 install --prefix=/apps/PyMOL . }} /apps/modulefiles/PyMOL #code(nonumber){{ #%Module1.0 prepend-path PATH /apps/PyMOL/bin prepend-path PYTHONPATH /apps/PyMOL/lib64/python3.9/site-packages }} ***centos7では? [#oeedb894] 基本rockylinux8のようにconda仮想環境でpymolを用意します #code(nonumber){{ (centos7なら) yum install centos-release-scl-rh epel-release yum install devtoolset-11 yum install --enablerepo=epel glew-devel netcdf-devel libpng-devel libxml2-devel freetype-devel cmake yum install xcb-util-wm xcb-util-image xcb-util-keysyms xcb-util-renderutil source scl_source enable devtoolset-11 git clone https://github.com/g-truc/glm cd glm git checkout 0.9.9.8 cp -r glm /usr/include alternatives --install /usr/bin/cmake cmake /usr/bin/cmake3 1 <-- 「cmake」が必要なのでcmake3をcmakeにしてみた }} OSパッケージ側はこれでokで、次にcondaになります #code(nonumber){{ [root@centos7 ~]# conda create -n pymol-open-source python numpy qt pyqt [root@centos7 ~]# conda activate pymol-open-source (pymol-open-source) [root@rockylinux ~]# cd /apps/src (pymol-open-source) [root@centos7 src]# git clone https://github.com/schrodinger/pymol-open-source (pymol-open-source) [root@centos7 src]# cd pymol-open-source (pymol-open-source) [root@centos7 pymol-open-source]# pip install . : Successfully installed pymol-3.1.0a0 : (pymol-open-source) [root@centos7 pymol-open-source]# conda deactivate [root@centos7 pymol-open-source]# }} EnvironmentModules は rockylinux8 と同じ *** ubuntuでは? [#ffc94e15] #code(nonumber){{ (ubuntu24.04) root@ubuntu24:~# grep PRETTY_NAME /etc/os-release PRETTY_NAME="Ubuntu 24.04.1 LTS" root@ubuntu24:~# apt install cmake git libnetcdf-dev libglm-dev libglew-dev libpng-dev libfreetype-dev python3-numpy python3-pyqt5.qtopengl python3-pip environment-modules root@ubuntu24:~# cd /apps/src root@ubuntu24:/apps/src# git clone https://github.com/schrodinger/pymol-open-source root@ubuntu24:/apps/src# cd pymol-open-source root@ubuntu24:/apps/src/pymol-open-source# pip install --prefix=/apps/PyMOL . root@ubuntu24:/apps/src/pymol-open-source# cd root@ubuntu24:~# vi /apps/modulefiles/PyMOL #%Module1.0 prepend-path PATH /apps/PyMOL/local/bin prepend-path PYTHONPATH /apps/PyMOL/local/lib/python3.12/dist-packages root@ubuntu24:~# }} &size(10){なぜか local が中間に入ってしまう...}; &color(red){みかんせい}; #code(nonumber){{ (ubuntu22.04) root@ubuntu22:~# grep PRETTY_NAME /etc/os-release PRETTY_NAME="Ubuntu 22.04.3 LTS" root@ubuntu22:~# apt install cmake git libnetcdf-dev libglm-dev libglew-dev libpng-dev libfreetype-dev python3-numpy python3-pyqt5.qtopengl python3-pip environment-modules libxml2-dev root@ubuntu22:~# cd /apps/src root@ubuntu22:/apps/src# git clone https://github.com/schrodinger/pymol-open-source root@ubuntu22:/apps/src# cd pymol-open-source root@ubuntu22:/apps/src/pymol-open-source# pip install --prefix=/apps/PyMOL . root@ubuntu22:/apps/src/pymol-open-source# cd root@ubuntu24:~# vi /apps/modulefiles/PyMOL #%Module1.0 prepend-path PATH /apps/PyMOL/local/bin prepend-path PYTHONPATH /apps/PyMOL/local/lib/python3.10/dist-packages root@ubuntu24:~# }}