-
Notifications
You must be signed in to change notification settings - Fork 1
/
INSTALL
153 lines (129 loc) · 6.34 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
===============================
INSTALLATION
===============================
USING downloaded builds (shared object files)
===============================
TO make life easy, rename the top directory created after teh github download
dockeye_multi
and place in a subdirectory called
source
in your home directory.
FOR MacOS, Ubuntu Linux (and possibly other Linux Distros)
change to the src directory in the dockeye home directory
make soft links to the correct backend *.so and the correct front end *.py
On MacOs
--------------
PyMol version 2.2 using Python2.7
ln -sf src_c/dockeyeM_energy_MacOS_python27_64bit.so dockeyeM_energy.so
ln -sf src_c/dockeyeM_c_v1.5.py dockeyeM_c.py
PyMol versions 2.2 - 2.4 using Python3.X
ln -sf src_f/dockeyeM_energy.cpython-37m-darwin.so dockeyeM_energy.so
ln -sf src_f/dockeyeM_f_v1.4.py dockeyeM_c.py
(these might require you to have the xcode developer package installed for the correct gcc/gfortran runtime libraries)
On Ubuntu Linux 14.04
---------------------
PyMol versions using Python2.7 (32-bit)
ln -sf src_c/dockeyeM_energy_linux14_python27_32bit.so dockeyeM_energy.so
ln -sf src_c/dockeyeM_c_v1.5.py dockeyeM_c.py
On Ubuntu Linux 16.04:
---------------------
PyMol versions using Python2.7 (32-bit)
ln -sf src_c/dockeyeM_energy_linux16_python27_32bit.so dockeyeM_energy.so
ln -sf src_c/dockeyeM_c_v1.5.py dockeyeM_c.py
On Ubuntu Linux 14.04/16.04/18.04:
---------------------
PyMol versions 2.2 to 2.4 using Python3.7 (64-bit)
ln -sf src_f/dockeyeM_energy.cpython-37m-x86_64-linux-gnu.so dockeyeM_energy.so
ln -sf src_f/dockeyeM_f_v1.4.py dockeyeM_c.py
note some builds are 32bit because they work with older PyMol
versions (pre- and early schrodinger versions and ones compiled from source at sourceforge.net).
=======================================
Telling PyMol's python interpreter where to find the dockeye modules
=======================================
Since PyMol ships with its own Python interpreter and does not use your system's
Python, there seems to be no nice way to do this.
You can try setting the PYTHONPATH environment variable (csh syntax here):
setenv PYTHONPATH $HOME/source/dockeye_multi/src/
or if it is already set, adding the dockeye path. Sometimes this works (on linux)
but not on my MAC.
the sure way is to create a file called
dockeye.pth
with the full path name for the dockeye src directory inside it, and place this file
in the site-packages directory of PyMOl's python interpretor
for example on my Ubuntu workstation:
% echo '/home/sharp/source/dockeye_multi/src/' > dockeye.pth
% mv dockeye.pth /home/sharp/Downloads/PyMOL-2.4.1_198-Linux-x86_64-py37/pymol/lib/python3.7/site-packages/
===============================
COMPILING FROM SOURCE
(WARNING: assumes familiarity with makefiles, compiling and willingness
to tinker with library locations and other options if things don't work 1st time!)
===============================
you can compile from C code
in the directory src_c or Fortran code in the directory src_f
some useful commands in this regard
% file <filename>.so # type of file : 32 bit/64 bit, binary, ELF etc
% otool <filename>.so # lists all required libraries and whether the are found
(linux equiv cmd: ldd)
C code
===========
Change to the directory src_c
A single C source file dockeyeM_energy.c needs to be compiled
to generate the shared object file to be soft linked to dockeyeM_energy.so
in the parent src directory
compile using the gcc compiler, using the makefile.
The makefile has various rules for MacOS and ubuntu Linux which
should work with little modification
Since this object file will be imported as a module in Python
it needs the python2.7 include file: Python.h
(may be part of your standard python install, or you
may need to install the Python development package)
Then if necessary edit the compiler options in the makefile:
-I<directory_where_Python.h_lives>
-lpython2.7 # should not need to change this default (this is for PyMol builds that use the python2.7)
-L<directory_where_PyMol's_Python_dynamic/shared_library_lives>
use the python-config command with --includes --libs and --ldflags
to find out where things are on your OS.
PyMol comes with its own Python install. This is the Python
that will import the dockeye module dockeyeM_energy,
so the compile may need the same libraries as PyMol's Python,
NOT the system Python libraries, EVEN if they are version 2.7
On MacOS, this may mean putting the path to the libraries hidden inside the PyMol.app
directory, like:
-L/Applications/PyMOL.app/Contents/lib/ # on my mac
or:
-L/home/sharp/Downloads/pymol/ext/lib/ on ubuntu 16.02
More recent PyMol builds use python3.6 and later, so the the rules in the makefile
should be changed to use python3.X includes and library directories
for details on using dockeye_multi, read dockeye_workflow.pdf
and run the examples
FORTRAN code
===========
this is very much a work in progress: the reason for using FORTRAN
in the first place was that on Ubuntu Linux
I just could not get C code to produce an importable
module for Python3.X, which has replaced Python2.7 in PyMol distros,
however closely I followed the examples on the Python.org 3.X docs pages
however, a plus is that using f2py avoids writing all the interface
goop needed to turn a C/FORTRAN subroutine into a Python object!
change directory to src_f
examine the makefile, it may need editing for your system
and compile:
% make main
3/1/2022 Update
recently I have been unable to import the module within PyMol2.4, since
my numpy install has a later numpy API version than Pymol's:
0xe vs. 0xd
I decided against rolling my numpy version back to match Pymol's
in case that broke my other apps. The solution is to edit the makefile
so that it compiles using Pymol's python and f2py. e.g:
make a copy of /home/sharp/Downloads/PyMOL-2.4.1_198-Linux-x86_64-py37/pymol/bin/f2py
called say f2py_local
and edit f2py_local to use the PyMol distro's Python3
(the default is some random directory wherever PyMol is maintained)
then edit the makefile to point to f2py_local
F2PY = /home/sharp/Downloads/PyMOL-2.4.1_198-Linux-x86_64-py37/pymol/bin/f2py
you may find that the PyMol distro does not ship with the dev package of python
i.e. missing the python include files. No problem, hack on!
create a soft link in Pymol's python directory
to point to your python's include file:
ln -s /home/sharp/miniconda3/include /home/sharp/Downloads/PyMOL-2.4.1_198-Linux-x86_64-py37/pymol/include