This is a read-only mirror of pymolwiki.org

Difference between revisions of "User:Tlinnet/Linux Install"

From PyMOL Wiki
Jump to navigation Jump to search
m (9 revisions)
 
(6 intermediate revisions by one other user not shown)
Line 68: Line 68:
 
<source lang="bash">
 
<source lang="bash">
 
#!/bin/bash -e
 
#!/bin/bash -e
pymoldir=$HOME/software/pymol
+
prefix=$PWD/pymol
modules=$pymoldir/modules
+
modules=$prefix/modules
 
svnpymol=svnpymol
 
svnpymol=svnpymol
 
svnfreemol=svnfreemol
 
svnfreemol=svnfreemol
pymolscriptrepo=Pymol-script-repo  
+
pymolscriptrepo=Pymol-script-repo
+
update=$prefix/updatepymol.sh
 +
 
 
###################################################
 
###################################################
[ -d $pymoldir ] || mkdir -p $pymoldir
+
mkdir -p $prefix
[ -d $HOME/bin ] || mkdir $HOME/bin
+
mkdir -p $HOME/bin
 
   
 
   
 
###### Checkout pymol svn
 
###### Checkout pymol svn
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol $pymoldir/$svnpymol
+
svn co svn://svn.code.sf.net/p/pymol/code/trunk/pymol $prefix/$svnpymol
 
###### Build and install pymol
 
###### Build and install pymol
cd $pymoldir/$svnpymol
+
cd $prefix/$svnpymol
python setup.py build install --home=$pymoldir --install-lib=$modules
+
python setup.py build install --home=$prefix --install-lib=$modules --install-scripts=$prefix
export PYTHONPATH=$modules:$PYTHONPATH
 
python setup2.py install
 
install pymol $pymoldir/
 
 
   
 
   
 
########## Setup freemol - for MPEG support ############
 
########## Setup freemol - for MPEG support ############
svn co svn://bioinformatics.org/svnroot/freemol/trunk $pymoldir/$svnfreemol
+
svn co svn://bioinformatics.org/svnroot/freemol/trunk $prefix/$svnfreemol
cd $pymoldir/$svnfreemol/src/mpeg_encode
+
cd $prefix/$svnfreemol/src/mpeg_encode
export FREEMOL=$pymoldir/$svnfreemol/freemol
+
export FREEMOL=$prefix/$svnfreemol/freemol
 
./configure
 
./configure
 
make
 
make
 
make install
 
make install
 
+
 
########## Install Pymol-script-repo ############
 
########## Install Pymol-script-repo ############
git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $pymoldir/$pymolscriptrepo
+
git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $prefix/$pymolscriptrepo
 
+
 
## Make a shortcut to an extended pymol execution
 
## Make a shortcut to an extended pymol execution
echo "#!/bin/bash" >> $pymoldir/pymolMPEG.sh
+
echo "#!/bin/bash" > $prefix/pymolMPEG.sh
echo "if [ ! -f $HOME/.local/share/applications/pymolsvn.desktop ];" >> $pymoldir/pymolMPEG.sh
+
echo "export FREEMOL=$prefix/$svnfreemol/freemol" >> $prefix/pymolMPEG.sh
echo "then" >> $pymoldir/pymolMPEG.sh
+
echo "export PYMOL_GIT_MOD=$prefix/$pymolscriptrepo/modules" >> $prefix/pymolMPEG.sh
echo "ln -s $pymoldir/pymolsvn.desktop $HOME/.local/share/applications/pymolsvn.desktop" >> $pymoldir/pymolMPEG.sh
+
echo "export PYTHONPATH=$prefix/$pymolscriptrepo/modules"':$PYTHONPATH' >> $prefix/pymolMPEG.sh
echo "fi" >> $pymoldir/pymolMPEG.sh
+
echo "export PYTHONPATH=$prefix/$pymolscriptrepo"':$PYTHONPATH' >> $prefix/pymolMPEG.sh
echo "export FREEMOL=$pymoldir/$svnfreemol/freemol" >> $pymoldir/pymolMPEG.sh
+
echo '#export PYTHONPATH=$PYTHONPATH:/sbinlab2/software/x64/lib64/python2.6/site-packages/PIL' >> $prefix/pymolMPEG.sh
echo "export PYMOL_GIT_MOD=$pymoldir/$pymolscriptrepo/modules" >> $pymoldir/pymolMPEG.sh
+
echo '#export PYTHONPATH=$PYTHONPATH:/sbinlab2/software/x64/lib64/python2.6/site-packages/lib-dynload' >> $prefix/pymolMPEG.sh
echo '#export PYTHONPATH=$PYTHONPATH:/path/to/shared/python/site-packages/PIL' >> $pymoldir/pymolMPEG.sh
+
echo '#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sbinlab2/software/x64/lib/pymollib' >> $prefix/pymolMPEG.sh
echo '#export PYTHONPATH=$PYTHONPATH:/path/to/shared/python/site-packages/lib-dynload' >> $pymoldir/pymolMPEG.sh
+
echo '#export LIBGL_ALWAYS_INDIRECT=no' >> $prefix/pymolMPEG.sh
echo "export PYTHONPATH=$pymoldir/$pymolscriptrepo/modules"':$PYTHONPATH' >> $pymoldir/pymolMPEG.sh
+
tail -n +2 $prefix/pymol >> $prefix/pymolMPEG.sh
echo "export PYTHONPATH=$pymoldir/$pymolscriptrepo"':$PYTHONPATH' >> $pymoldir/pymolMPEG.sh
+
chmod ugo+x $prefix/pymolMPEG.sh  
echo '#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/shared/lib/pymollib' >> $pymoldir/pymolMPEG.sh
 
echo '#export LIBGL_ALWAYS_INDIRECT=no' >> $pymoldir/pymolMPEG.sh
 
tail -n +2 $pymoldir/pymol >> $pymoldir/pymolMPEG.sh
 
chmod u+x $pymoldir/pymolMPEG.sh  
 
 
   
 
   
## Make a link, so we execute pymol with the freemol env exported
 
ln -s $pymoldir/pymolMPEG.sh $HOME/bin/pymol
 
 
## Make a pymolsvn.desktop
 
echo "#!/bin/env xdg-open" >> $pymoldir/pymolsvn.desktop
 
echo "[Desktop Entry]" >> $pymoldir/pymolsvn.desktop
 
echo "Version=1.5.x" >> $pymoldir/pymolsvn.desktop
 
echo "Name=PyMOL Molecular Graphics System - Open source" >> $pymoldir/pymolsvn.desktop
 
echo "GenericName=Molecular Modeller" >> $pymoldir/pymolsvn.desktop
 
echo "Comment=Model molecular structures and produce high-quality images of them" >> $pymoldir/pymolsvn.desktop
 
echo "Type=Application" >> $pymoldir/pymolsvn.desktop
 
echo "Exec=env $pymoldir/pymolMPEG.sh" >> $pymoldir/pymolsvn.desktop
 
echo "Icon=$pymoldir/$pymolscriptrepo/files_for_examples/pymol.xpm" >> $pymoldir/pymolsvn.desktop
 
echo "MimeType=chemical/x-pdb" >> $pymoldir/pymolsvn.desktop
 
echo "Categories=Education;Science;Chemistry;" >> $pymoldir/pymolsvn.desktop
 
echo "Terminal=false" >> $pymoldir/pymolsvn.desktop
 
 
 
## Make a startup files, which is always executed on startup.
 
## Make a startup files, which is always executed on startup.
 
t="'"
 
t="'"
echo "import sys,os" >> $modules/pymol/pymol_path/run_on_startup.py
+
echo "import sys,os" > $modules/pymol/pymol_path/run_on_startup.py
 
echo "import pymol.plugins" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "import pymol.plugins" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.preferences = {'instantsave': False, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.preferences = {'instantsave': False, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.autoload = {'apbs_tools': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.autoload = {'apbs_tools': False}" >> $modules/pymol/pymol_path/run_on_startup.py
echo "pymol.plugins.set_startup_path( [$t$pymoldir/$pymolscriptrepo/plugins$t,$t$modules/pmg_tk/startup$t] )" >> $modules/pymol/pymol_path/run_on_startup.py
+
echo "pymol.plugins.set_startup_path( [$t$prefix/$pymolscriptrepo/plugins$t,$t$modules/pmg_tk/startup$t] )" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.preferences = {'instantsave': True, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 
echo "pymol.plugins.preferences = {'instantsave': True, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
 +
 +
## Make a update script
 +
cat > "$update" <<EOF
 +
#!/bin/bash -e
 +
prefix=$prefix
 +
modules=$modules
 +
svnpymol=svnpymol
 +
svnfreemol=svnfreemol
 +
pymolscriptrepo=Pymol-script-repo
 +
 +
###### Checkout pymol svn
 +
svn co svn://svn.code.sf.net/p/pymol/code/trunk/pymol \$prefix/\$svnpymol
 +
###### Build and install pymol
 +
cd \$prefix/\$svnpymol
 +
python setup.py build install --home=\$prefix --install-lib=\$modules --install-scripts=\$prefix
 +
 +
########## Setup freemol - for MPEG support ############
 +
svn co svn://bioinformatics.org/svnroot/freemol/trunk \$prefix/\$svnfreemol
 +
cd \$prefix/$svnfreemol/src/mpeg_encode
 +
export FREEMOL=\$prefix/\$svnfreemol/freemol
 +
./configure
 +
make
 +
make install
 +
 +
########## Update Pymol-script-repo ############
 +
cd \$prefix/\$pymolscriptrepo
 +
git pull origin master
 +
cd \$prefix
 +
EOF
 +
chmod +x $update
 
</source>
 
</source>
 
 
=== Change MPEG settings ===
 
=== Change MPEG settings ===
 
Change settings in
 
Change settings in

Latest revision as of 01:20, 28 March 2014

These are customized installation scripts. For more general instructions, see Linux Install.

Ubuntu/Mint 12 compile and install with MPEG support

First install dependencies.

sudo apt-get install subversion git
sudo apt-get install python-imaging python-pygame apbs
sudo apt-get install build-essential python-dev python-pmw libglew-dev freeglut3-dev libpng-dev libfreetype6-dev
bash installpymol.sh

Red Hat Enterprise Linux RHEL 6 compile and install with MPEG support for x86_64 bit

Install the EPEL repository: The .rpm will be download from here
http://fedoraproject.org/wiki/EPEL
And the CentOS repository for additional .rpm are located here
http://mirror.centos.org/centos/6/os/x86_64/Packages/

bash
cd && wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm
sudo rpm -i epel-release-6-5.noarch.rpm
rm epel-release-6-5.noarch.rpm</pre>

Then add Centos repository

rpm --import http://mirror.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6
sudo gedit /etc/yum.repos.d/centos.repo

Write these lines.

[centos]
name=Centos for RHEL/ CentOS $releasever - $basearch
baseurl=http://mirror.centos.org/centos/6/os/x86_64
enabled=1

Then check configuration. Do NOT UPGRADE PACKAGES from CentOS. It will replace RHEL packages.
If you do upgrade packages, you will now see Centos login and such, but not much is problematic.

sudo yum repolist all
sudo yum install subversion git
sudo yum install python-imaging pygame apbs
sudo yum install gcc-c++ python-devel python-pmw glew-devel freeglut-devel libpng-devel freetype-devel

Then disable centos repository. Set enabled=0

sudo gedit /etc/yum.repos.d/centos.repo

Now install pymol

bash installpymol.sh

Make sure, that you will have ~/bin as part of your path

gedit ~/.cshrc

Make sure this lines is in the file. Only if you use tcsh shell.

setenv PATH ${PATH}:{$HOME}/bin

Install script

Make a text file "installpymol.sh" and make it executable

chmod u+x installpymol.sh

Put this in the file, modify the first line

#!/bin/bash -e
prefix=$PWD/pymol
modules=$prefix/modules
svnpymol=svnpymol
svnfreemol=svnfreemol
pymolscriptrepo=Pymol-script-repo
update=$prefix/updatepymol.sh

###################################################
mkdir -p $prefix
mkdir -p $HOME/bin
 
###### Checkout pymol svn
svn co svn://svn.code.sf.net/p/pymol/code/trunk/pymol $prefix/$svnpymol
###### Build and install pymol
cd $prefix/$svnpymol
python setup.py build install --home=$prefix --install-lib=$modules --install-scripts=$prefix
 
########## Setup freemol - for MPEG support ############
svn co svn://bioinformatics.org/svnroot/freemol/trunk $prefix/$svnfreemol
cd $prefix/$svnfreemol/src/mpeg_encode
export FREEMOL=$prefix/$svnfreemol/freemol
./configure
make
make install
 
########## Install Pymol-script-repo ############
git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git $prefix/$pymolscriptrepo
 
## Make a shortcut to an extended pymol execution
echo "#!/bin/bash" > $prefix/pymolMPEG.sh
echo "export FREEMOL=$prefix/$svnfreemol/freemol" >> $prefix/pymolMPEG.sh
echo "export PYMOL_GIT_MOD=$prefix/$pymolscriptrepo/modules" >> $prefix/pymolMPEG.sh
echo "export PYTHONPATH=$prefix/$pymolscriptrepo/modules"':$PYTHONPATH' >> $prefix/pymolMPEG.sh
echo "export PYTHONPATH=$prefix/$pymolscriptrepo"':$PYTHONPATH' >> $prefix/pymolMPEG.sh
echo '#export PYTHONPATH=$PYTHONPATH:/sbinlab2/software/x64/lib64/python2.6/site-packages/PIL' >> $prefix/pymolMPEG.sh
echo '#export PYTHONPATH=$PYTHONPATH:/sbinlab2/software/x64/lib64/python2.6/site-packages/lib-dynload' >> $prefix/pymolMPEG.sh
echo '#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sbinlab2/software/x64/lib/pymollib' >> $prefix/pymolMPEG.sh
echo '#export LIBGL_ALWAYS_INDIRECT=no' >> $prefix/pymolMPEG.sh
tail -n +2 $prefix/pymol >> $prefix/pymolMPEG.sh
chmod ugo+x $prefix/pymolMPEG.sh 
 
## Make a startup files, which is always executed on startup.
t="'"
echo "import sys,os" > $modules/pymol/pymol_path/run_on_startup.py
echo "import pymol.plugins" >> $modules/pymol/pymol_path/run_on_startup.py
echo "pymol.plugins.preferences = {'instantsave': False, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py
echo "pymol.plugins.autoload = {'apbs_tools': False}" >> $modules/pymol/pymol_path/run_on_startup.py
echo "pymol.plugins.set_startup_path( [$t$prefix/$pymolscriptrepo/plugins$t,$t$modules/pmg_tk/startup$t] )" >> $modules/pymol/pymol_path/run_on_startup.py
echo "pymol.plugins.preferences = {'instantsave': True, 'verbose': False}" >> $modules/pymol/pymol_path/run_on_startup.py

## Make a update script
cat > "$update" <<EOF
#!/bin/bash -e
prefix=$prefix
modules=$modules
svnpymol=svnpymol
svnfreemol=svnfreemol
pymolscriptrepo=Pymol-script-repo

###### Checkout pymol svn
svn co svn://svn.code.sf.net/p/pymol/code/trunk/pymol \$prefix/\$svnpymol
###### Build and install pymol
cd \$prefix/\$svnpymol
python setup.py build install --home=\$prefix --install-lib=\$modules --install-scripts=\$prefix

########## Setup freemol - for MPEG support ############
svn co svn://bioinformatics.org/svnroot/freemol/trunk \$prefix/\$svnfreemol
cd \$prefix/$svnfreemol/src/mpeg_encode
export FREEMOL=\$prefix/\$svnfreemol/freemol
./configure
make
make install

########## Update Pymol-script-repo ############
cd \$prefix/\$pymolscriptrepo
git pull origin master
cd \$prefix
EOF
chmod +x $update

Change MPEG settings

Change settings in

$HOME/Software/pymol/svnfreemol/freemol/libpy/freemol/mpeg_encode.py

For example, change in line 205:
FRAME_RATE 24
(Note, only legal values is allowed: 23.976, 24, 25, 29.97, 30, 50 ,59.94, 60)

Then restart PyMOL.