[SciPy-user] problem building svn scipy

Damian Eads eads@soe.ucsc....
Mon Apr 28 15:11:43 CDT 2008


Hi John,

Thanks for the fix. It is possible that an earlier version of gcc 3.4 
collapsed underscore prefixes on variable names.

I was not aware there was a Scipy style for C code--just an unwritten 
understanding that the C code be cleanly written. I have structured my 
code so that the implementation of an algorithm goes in a function in 
one C file (hierarchy.c), its Python-C wrapper goes in another C file 
(hierarchy_wrap.c), and argument checking and array allocation happens 
in a Python function (hierarchy.py). I have tried to keep my argument 
names consistent in each of these files. If an argument is called X in 
Python, its corresponding PyArrayObject is called _X in C, and the 
C-array buffer is called X. This consistency really helps development as 
well as avoiding bugs. If using postfix underscores makes the code 
portable on your compiler, then I will change the convention.

I will apply the patch and check in the fix.

Thanks again,

Damian



John Hunter wrote:
> On Fri, Apr 25, 2008 at 1:48 PM, Robert Kern <robert.kern@gmail.com> wrote:
> 
>>  It looks like something is #defining CS to be a number. Search through
>>  the headers for this.
> 
> I am not sure where the _CS symbol is getting defined on my system,
> but it appears that this is the case for many of the _ prefixed
> symbols in this file.  I was able to get the file to compile by
> replacing all the leading underscore prefixes for the python array
> object local declarations with _ postfix.  Don't know if this is
> acceptable style for scipy, but here is the patch
> 
> Thanks,
> JDH


More information about the SciPy-user mailing list