[Cython] Bug: llabs not defined in vs2008

2015-09-29 Thread Hogan, Christopher
Hello,

I was trying to compile numpy v1.9.2 with Visual Studio 2008 and Cython 0.23.1. 
 This worked fine with Cython 0.22.x, but in 0.23.1 there are some changes in 
Cython/Utility/TypeConversion.c that seem to cause this error:

mtrand.obj : error LNK2019: unresolved external symbol llabs referenced in 
function __pyx_pf_6mtrand_11RandomState_24 choice

llabs is not available in vs2008, but it ends up taking that "#elif" branch in 
TypeConversion.c and defining __Pyx_sst_abs to be llabs.  I was able to fix 
this by swapping the order of the "#elif defined (_MSC_VER) ..."  block with 
the "#elif defined (__STDC_VERSION__) ... " block.  That probably won't fix the 
problem in all cases though.

Thanks,

Chris Hogan
Scripting Tools Engineer
Scripting, Analyzers and Tools
Intel Corporation

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Bug: llabs not defined in vs2008

2015-09-30 Thread Hogan, Christopher

> So, what you are saying is that VS-2008 is not C99 standards compliant (what 
> a surprise) but claims to be?
> Are you passing any C compiler flags that requests C99 compliance?

We have to use the flag /Qstd=c99.  I guess it's more a Microsoft problem than 
anything.

> To me, your proposed change seems a reasonable thing to do. What cases are 
> you thinking of?

If someone is using any VS version > 2008, then _abs64 will be defined instead 
of llabs.  I'm not sure if one is preferable to the other though.  
   
> I applied your change for now, it's in the 0.23.x. maintenance branch:

Thank you.

Chris Hogan
Scripting Tools Engineer
Scripting, Analyzers and Tools
Intel Corporation




___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel