Pteros  2.0
Molecular modeling library for human beings!
Installation on Windows

Installing Pteros on Windows is rather tricky task.

This is not the fault of Pteros itself, but the general problem of using Open Source tools on Windows, which requires overcoming multiple platform-related issues and bugs. Currently only MinGW gcc compiler is tested on Windows. If you want to use MS Visual Studio or other compilers you'll need to sort the things out yourself.

The procedure below was tested on Windows XP 32bit with MinGW GCC compiler version 4.6, Boost 1.51, Python 2.7 and NumPy 1.6.2. There is no guarantee that it will work with other versions. My experience with Windows is rather limited, so any suggestions and additional testing are appreciated!

  1. Download latest MinGW from here: http://sourceforge.net/projects/mingw/files/. During installation check "C++ compiler". Install it to default location (C:\MinGw).
  2. Update your PATH variable by appending

    C:\MinGW\bin; C:\MinGW\mingw32\bin

    to it. For doing this right-click "My Computer" and go to "Advanced->Environment variables".

  3. Install Python. Download "official" Python for Windows from here and install it to default location (tested with wersion 2.7). Do not use ActivePython - linking with it doesn't work for some unclear reason.

  4. Install numpy from here. Make sure to download version 1.6.2 for Windows and for Python 2.7 (numpy-1.6.2-win32-superpack-python2.7.exe). Note that new numpy 1.7 didn't work for me but 1.6.2 does.

  5. Download latest Boost from here. Unzip it into separate folder (say, C:\install\boost_1_51).
  6. Open windows console and cd to this directory. Then execute

    bootstrap.bat mingw

    It should finish without errors.

  7. Find the file project-config.jam. Open it in the text editor and change the line

    using msvc ;

    to

    using gcc ;

    After that line add the following text:

    using python : 2.7 : "C:/Python27" : "C:/Python27/include" : "C:/Python27/libs" ;

    Change the version and the installation paths if needed to correspond your Python installation.

    After that execute

    b2 install --prefix=c:\install\boost --toolchain=mingw link=shared

    This will compile all boost libraries and install them into c:\install\boost. This can take a while, especially on slow machines. Just wait until compilation finishes.

  8. Download CMake for Windows from here http://www.cmake.org/cmake/resources/software.html (use "Win32 installer") and install it. During installation check option "Add CMake to the PATH".

  9. Install Git for Windows from here. During the installation check an option to add Git to your path (the second one).

  10. Create a dedicated directory for pteros (say, C:\install\pteros) and cd to it from the command prompt.

    Get Pteros source code from git repository:

    git clone git://pteros.git.sourceforge.net/gitroot/pteros/pteros

    You can also get the latest development branch (named "experimental"), which is the bleading-age of Pteros development but may contain some bugs and unstable features:

    git clone -b experimental git://pteros.git.sourceforge.net/gitroot/pteros/pteros

  11. Find the file CMakeLists.txt in your Pteros folder, open it in the text editor and find the lines

    # Path to Boost:
    SET(BOOST_ROOT "c:/install/boost")
    SET(BOOST_INCLUDEDIR "C:/install/boost/include/boost-1_53")
    link_directories("C:/install/boost/lib")

    Change the pathes to the directory where you installed Boost libraries. Please note that latest boost (1.52 and newer) places header files into funny subdirectories, which CMake can't understand, so you have to specify BOOST_INCLUDEDIR by hand.

    In the same file find the lines

    # Path to numpy:
    include_directories("C:/Python27/Lib/site-packages/numpy/core/include")
    link_directories("C:/Python27/Lib/site-packages/numpy/core/lib")

    and change the paths to location of numpy in your Python distribution. Again, CMake can't find them on Windows and requires specifying the paths manually.

  12. Create a build directory (for example C:\install\pteros_build) and cd to it. Now execute

    cmake -G "MinGW Makefiles" <path-to-pteros>

  13. Execute

    mingw32-make

    Ignore multiple warnings about "dllimport attributes", "different sizes" and "already defined attributes" - they are harmless.