Skip to content
agrif edited this page Jul 26, 2011 · 12 revisions

Build Instructions

These instructions are for building the C extension for Overviewer. Also note that Windows binary kits are available in the 'Downloads' section. These kits already contain the compiled extension. There are also precompiled binary packages for Debian systems. See Installation for more information.

Windows

First, you'll need a compiler. You can either use Visual Studio, or cygwin/mingw.

Building with Visual Studio

You can get a free copy of Visual Studio Express here: http://www.microsoft.com/express/Windows/

You will want the C++ version (Microsoft® Visual C++® 2010 Express)

  1. Get the latest source code from github

  2. From the Start menu, navigate to the 'Microsoft Visual Studio 2010 Express' and open the 'Visual Studio Command Prompt (2010)' shortcut.

  3. cd to the folder containing the Overviewer source code

  4. Copy Imaging.h and ImPlatform.h from your PIL installation into the current working directory

  5. First try a build:

    c:\python26\python setup.py build

If you encounter the following errors: error: Unable to find vcvarsall.bat then try the following:

set DISTUTILS_USE_SDK=1
set MSSdk=1
c:\python26\python setup.py build

If the build was successful, there should be a c_overviewer.pyd file in your current working directory.

Building with mingw

  1. Open a MinGW shell

  2. cd to the Overviewer directory

  3. Copy Imaging.h and ImPlatform.h from your PIL installation into the current working directory

  4. Build:

    python setup.py build --compiler=mingw32

Linux

You will need the gcc compiler and a working build environment. On Ubuntu and Debian, this can be done by installing build-essential.

You will need the following packages (at least):

  • python-imaging (for PIL)
  • python2.6-dev
  • python-numpy

Then to build: python2.6 setup.py build

OSX

  1. Download the source code for PIL from http://www.pythonware.com/products/pil/

  2. Compile the PIL code (python ./setup.py build)

  3. Install PIL (sudo python ./setup.py install)

  4. Find the path to libImaging in the PIL source tree

  5. Build minecraft overviewer with the path from step 3 as the value for C_INCLUDE_PATH:

    C_INCLUDE_PATH="path from step 3" python ./setup.py build

The following script (copied into your MCO source directory) should handle everything for you:

#!/bin/bash

# start with a clean place to work
python ./setup.py clean

# get PIL
if [ ! -d "`pwd`/Imaging-1.1.7/libImaging" ]; then
    /usr/bin/curl -o imaging.tgz http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
    tar xzf imaging.tgz
    rm imaging.tgz
fi

# build MCO
C_INCLUDE_PATH="`pwd`/Imaging-1.1.7/libImaging" python ./setup.py build

Clone this wiki locally