molecule
pDynamo

pDynamo Installation on Windows XP

These instructions were kindly provided by William E. Wheeler of Colorado Springs, Colorado. Any enquiries concerning them should be addressed to him.


This document gives the basic steps required to install and run pDynamo on Windows XP using MinGW or Cygwin. Personal preference leans towards the MinGW configuration since it runs faster for the longest running task, Example26, than the Cygwin setup with or without a virus scanner. See the benchmarks table for more information. In any case, be aware of some differences when it comes to setting the environment variables for pDynamo that will be described later.

You will need to download an archive that contains some extra files for the installation. This can be found at windows.zip. Unpack the archive and you will find a directory include and a file InstallUtilities.py.


MinGW installation:

  1. Download Minimalist GNU for Windows from MinGW. The version for this document was MinGW-5.1.6.
  2. The default directory of C:\MinGW and the default base tools selection were used for this installation.
  3. Make the following change to the C:\MinGW\lib\gcc\mingw32\3.4.5\specs file (approx. line 54).

    change -lmsvcrt to -lmsvcr71 so MinGW links with the msvcr71.dll

    Refer to documentation on the Pyrex On Windows web site for details.. Note: as per the 00readme.txt file in the pDynamo installation directory, a separate installation of Pyrex is not required to run pDynamo.

  4. Finally, add C:\MinGW\bin to the Windows path (standard environment variable).

Cygwin installation:

  1. Download setup.exe from Cygwin.
  2. For the purposes of this document, Cygwin will be installed in a D:\cygwin directory. During the installation process one of the steps needs a directory for downloads. I chose to use a D:\cygwin\downloads directory if only to keep everything in one location. There is a section where the user selects various programs, libraries, etc. for installation. From the Devel section I selected gcc, from Editors, I selected vi and from Python, the only thing I selected was python. I did not install numpy or Pyrex. Finally, in the Libs section, make sure the libpopt0 library is selected so Python can process command-line arguments. Let the installation run to completion. For convenience, I added an icon on the desktop. Double-click the icon to open Cygwin.
  3. Using the editor of your choice (vi in my case), add the following lines to the .bash_profile file located in the user's home directory:

    CYGWIN=nodosfilewarnings
    export CYGWIN


Python Installation:

  1. Download Python-2.6.5.exe from the Python.org web site Python.
  2. Install in the default C:\Python26 directory. The Python distributions from ActiveState do not work since they do not include the libpython26.a that is found in the C:\Python26\libs directory from the python.org distribution. The pDynamo installation will appear to be running just fine but will terminate quite unexpectedly. It is possible to create the libpython26.a from the libpython26.dll in the C:\Windows\system32 directory but that extra step was deemed too much trouble at this point. Also, the pDynamo installation fails immediately with Python-3.1.2 and I have not investigated this issue any further. (I have not tried an installation of pDynamo with Python 3 on a Linux machine).
  3. Configure the compiler option in Python:

    Create a file called C:\Python26\Lib\distutils\distutils.cfg with the following two lines:

    [build]
    compiler = mingw32

    Again, refer to the Pyrex On Windows link given above for details.

  4. Edit unixcompiler.py in the same directory and make the following change:

    Comment out line 285 where the CC variable is read and replace it with:

    ccompiler = "gcc"

    Setting an environment variable called CC that refers to the gcc executable did not work.

  5. Add C:\Python26 to the Windows path (standard environment variable).
  6. Open a DOS shell and type:

    python -version

    to test the Python installation.


Header file installation:

Several C header files are required for compilation. Copy the include directory from the windows.zip archive that you downloaded into the C:\MinGW directory. Windows will ask if you want to override the include directory, select Yes since that just adds the new subdirectories and a few files. These header files are actually from a Ubuntu distribution. Contrary to my expectations, when I tried to use the header files from Cygwin I encountered all sorts of ugly conflicts and errors. Using the files in this zip file is the simplest approach.


pDynamo-x.y installation:

  1. Download the pdynamo-x.y.tar file from the pDynamo web site pDynamo-x.y. I extracted the tar file directly to the D: drive so for the MinGW configuration pDynamo is located in D:\pdynamo-x.y. From within a Cygwin session, this directory will be located at /cygdrive/d/pdynamo-x.y.
  2. Copy the InstallUtilities.py file that you downloaded in the windows.zip archive to the D:\pdynamo-x.y\installation directory. There are some very minor changes to recognize the Windows or Cygwin platform. The variable for the shared object extension needed to be changed from .so to .pyd for MinGW or to .dll for Cygwin so the files would be copied to the pCore and pDynamo directories that are later put in the PYTHONPATH.
  3. For the MinGW configuration, open a DOS shell, change into the D:\pdynamo-x.y\installation directory and type:

    python Install.py

    to run the installation. If all goes well, after several minutes, the console will display an Installation terminated message. Close the DOS shell.

  4. For the Cygwin configuration, open a Cygwin session, change into the /cygdrive/d/pdynamo-x.y/installation directory and type:

    python Install.py

    to run the installation. If all goes well, after several minutes, the console will display an Installation terminated message.


Set the pDynamo environment variables for MinGW:

For this configuration refer to the 00readme.txt file located in the D:\pdynamo-x.y\installation directory. Set them just like any other Windows environment variable.


Set the pDynamo environment variables for Cygwin:

For this configuration refer to the 00readme.txt file located in the D:\pdynamo-x.y\installation directory but do so using the .bash_profile file located in the user's home directory. Also, remove or rename any Windows environment variables that might cause a conflict like a PYTHONPATH variable that is a DOS path. Cygwin will throw all sorts of errors.

For example, these are the environment variables that are set for this installation:

CYGWIN=nodosfilewarning
export CYGWIN

PDYNAMO_ROOT=/cygdrive/d/pdynamo-x.y
export PDYNAMO_ROOT

PBABEL_PDBDATA=$PDYNAMO_ROOT/pBabel-x.y/parameters
export PBABEL_PDBDATA

PDYNAMO_SCRATCH=$PDYNAMO_ROOT/scratch
export PDYNAMO_SCRATCH

PDYNAMO_STYLE=$PDYNAMO_ROOT/pCore-x.y/parameters/styles/defaultstyle.css
export PDYNAMO_STYLE

PMOLECULE_PARAMETERS=$PDYNAMO_ROOT/pMolecule-x.y/parameters
export PMOLECULE_PARAMETERS

PYTHONPATH=$PDYNAMO_ROOT/pBabel-x.y:$PDYNAMO_ROOT/pCore-x.y:$PDYNAMO_ROOT/pMolecule-x.y:$PDYNAMO_ROOT/pMoleculeScripts
export PYTHONPATH

Close the Cygwin session.


Test the MinGW installation:

  1. Open a DOS shell again to update the environment variables.
  2. Change into the D:\pdynamo-x.y\book\examples directory. Type:

    python Example0.py

    which should run by default since it just tests the Python installation. The real test is:

    python Example1.py


Test the Cygwin installation:

  1. Open a Cygwin session again to update the environment variables.
  2. Change into the /cygdrive/d/pdynamo-x.y/book/examples directory. Type:

    python Example0.py

    which should run by default since it just tests the Python installation. The real test is:

    python Example1.py


In either case, Example1.py uses the pDynamo files that are created during the installation process. If they did not link properly there will be an error message like:

ImportError: No module named Matrix

If there are problems, please feel free to email me and maybe I can help resolve the issue.

Valid XHTML 1.0 Strict
Last modification time (GMT): Mon Jul 19 14:05:38 2010
Copyright © 2007–2010 Martin J. Field