ozcan / scipy-cluster

Automatically exported from code.google.com/p/scipy-cluster
Other
0 stars 1 forks source link

Issues/Fixes for building on Python 2.7 amd64 on Windows #41

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Building on Windows with Visual Studio 2008 for 64-bit I encountered the 
following portability problems with hcluster 0.20's C.

* Use of 'inline' keyword in distance.c/hierarchy.c - Python 2.7 requires 
building with VS2008, which only accepts 'inline' as a keyword if the file is 
named "*.cpp". Changing it to "__inline" in all cases fixed the problem. Not 
sure how to make it portable using distutils, I'd expect that's a common need. 
See http://msdn.microsoft.com/en-us/library/z8y1yy88(v=vs.90).aspx

* Some variable declarations aren't C89-friendly (which s what VS2008 adheres 
to :( ). Moving them to the start of the block in all cases doesn't hurt 
readability much and does make it portable enough:

    ...
    xi = inds[i];
    cnode *xnd = info->nodes + xi;
    xn = xnd->n;
    ...

->

    cnode *xnd;
    ...
    xi = inds[i];
    xnd = info->nodes + xi;
    xn = xnd->n;

After this, I was able to successfully build it.

Original issue reported on code.google.com by ppri...@gmail.com on 6 Jan 2014 at 9:42