File: Readme.txt

package info (click to toggle)
openbabel 2.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 37,188 kB
  • ctags: 47,193
  • sloc: cpp: 237,858; ansic: 85,555; cs: 22,219; java: 14,377; sh: 9,876; perl: 5,432; python: 4,319; pascal: 793; makefile: 683; xml: 97; ruby: 54
file content (50 lines) | stat: -rw-r--r-- 2,420 bytes parent folder | download
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
Notes on compiling a Python interface to OpenBabel
using Visual Studio Express in Windows.

Python is assumed to be installed. 
Add the following environment variables
(Settings/Control Panel/System/Advanced/Environment Variables)
with either User or System scope. The values are typical examples.
.
PYTHON_INCLUDE   C:\Python25\include
PYTHON_LIB       C:\Python25\libs\python25.lib    (used by SWIG)
PYTHON_LIB_PATH  C:\Python25\libs                 (used by Visual Studio)


Install SWIG. Actually all that is needed is swig.exe which is
downloaded together with the source files and documentation.
Add its folder name to one of the PATH environment variables.

The project OBPythonOBF does the following:
 - It runs SWIG on the interface file scripts/openbable-python.i
    producing openbabel-python_wrap.cpp and openbabel.py
 - openbabel-python_wrap.cpp is compiled and linked with OBConv.lib, OBDLL.lib,
    and some other OB libs, to produce the DLL _openbabel.pyd
 - all the python files are copied to the windows-vc2005 folder where the
    OB exe, dll and obf files are. 
 
There is only a release configuration.
The SWIG step is not currently automatically rerun when any of the
OpenBabel files changes. If they have, you need to Rebuild the
OBPythonOBF project, which will also rebuild several OpenBabel DLLs first.

A useful article on building C++ extensions for Python is at
http://www.geocities.com/foetsch/python/extending_python.htm

Original notes:
 To use OpenBabel with Python either 
  run Python with the windows-vc2005 folder as the current folder, or
  add the windows-vc2005 folder to the PYTHONPATH environment variable.

New notes:
 To create a binary installer for the Python extension, do as follows...
 In the OBPythonOBF folder, run
     python setup.py bdist_wininst
                     --install-script=openbabel_postinstall.py
                     --bitmap=logo.bmp
 To install, run the created "openbabel-python-1.0.win32.exe" in the dist subfolder.
 You can test by copying testpybel.py to a folder that doesn't contain "openbabel.py*",
 and running it (this ensures that it uses the globally installed Open Babel;
 you should also ensure that PYTHONPATH does not contain a folder with "openbabel.py*").
 You can uninstall using Add/Remove Programs. 
 There is a log of the installation in $PYTHONDIR/openbabel-python-wininst.log.