Skip to content

Getting Started on Windows x64

dcoetzee edited this page Jul 4, 2012 · 12 revisions
  • Visual Studio 2008
    • Asp does not currently support Visual Studio 2010. There are some unresolved issues with the setup as described below.
  • Python (x64), be sure to download the 64-bit installer
  • CodePy, official branch has problems with Windows environments, please use this branch instead.
    • git clone https://github.com/BryanCatanzaro/catanzaro.codepy
  • Pytools and its dependencies. The best way to get this is to install easy_install, then from the directory where easy_install.exe is located do: easy_install pytools
  • Numpy, unofficial Windows binaries for Numpy 64-bit
  • boost.python, required by CodePy. There are no official pre-compiled Windows 64-bit binaries, so we need to build from source.
    • Extract Boost into a directory on which you have write permissions. Use bootstrap to create the build tool b2.
    • Compile from source: b2 --toolset=msvc-9.0 address-model=64 --build-type=complete stage

In order to connect Boost.Python and CodePy, you need to specify some things in C:\Users\[Username]\.aksetup-defaults.py. On my installation of Windows, I have:

BOOST_INC_DIR = ['C:\\boost_1_48_0']
BOOST_LIB_DIR = ['C:\\boost_1_48_0\\stage\\lib']
BOOST_COMPILER = 'msvc'
BOOST_PYTHON_LIBNAME = ['boost_python-vc90-mt-1_48']
BOOST_THREAD_LIBNAME = ['boost_thread-vc90-mt-1_48']
CXXFLAGS = ['/EHsc']
LDFLAGS = ['/FORCE']

Make sure BOOST_LIB_DIR above is also in your path. Run tests in catanzaro.codepy\tests.

Get asp: git clone git://github.com/shoaibkamil/asp.git

Asp and its tests require several dependencies, which can be installed with: easy_install unittest2 mock pyyaml mako

You can run Asp tests under tests. The root of catanzaro.codepy must be in your PYTHONPATH as must the root of the Asp tree (unless it has already been installed with setup.py).

More tests are available under the array_doubler sample specializer (specializers\array_doubler\tests). The array_doubler root must also be in the PYTHONPATH to run these.

Stencil specializer

Get with: git clone git://github.com/shoaibkamil/stencil_specializer.git

The stencil specializer requires some changes to work under Windows. This line in stencil_kernel.py:

mod.backends["c++"].toolchain.cflags += ["-fopenmp", "-O3", "-msse3", "-Wno-unknown-pragmas"]

must be changed to remove all flags listed inside the [], as the Visual C++ compiler does not support these flags.

Tests are available under tests. The root of the catanzaro.codepy, Asp, and stencil specializer trees must all be in PYTHONPATH. A few tests may take a very long time to run under Windows, on the order of many minutes, due to performance limitations in MSVC++ loop unrolling optimizations. This can be avoided by adding "/O1" between the brackets above, which disables the subset of optimizations that increase code size.

Clone this wiki locally