another HAVE_HYPOT issue?

18 views
Skip to first unread message

John Salvatier

unread,
Jan 6, 2011, 5:37:37 PM1/6/11
to cython...@googlegroups.com
Hello,

I am trying to compile some Cython code in Windows 7 that compiles and runs fine my Mac, and I am getting a HAVE_HYPOT related issue. GCC fails with:

I have cython-devel-b816b03ff502, numpy 1.5.1rc2, python 2.6.5, Windows 7 64 bit (but everything installed is 32 bit)

axis_funcs.c: In function '__Pyx_c_absf':
axis_funcs.c:3915:25: error: #if with no expression
axis_funcs.c: In function '__Pyx_c_abs':
axis_funcs.c:4035:25: error: #if with no expression
error: command 'gcc' failed with exit status 1

Line 3915 looks like : 

        static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
          #if HAVE_HYPOT
            return hypotf(z.real, z.imag);
          #else
            return sqrtf(z.real*z.real + z.imag*z.imag);
          #endif
        }

and 4035 is basically the same

I'm not totally sure what this means. Anyone have any ideas? 

Also, I tried to run the tests, but it looks like I ran into some problems with it trying to use the .NET compilers installed on my system instead of the MinGW comilers installed on my system (despite having mingw32\bin in my path). Is there something else I have to set properly in order to get them to run correctly?

John

Christopher Barker

unread,
Jan 6, 2011, 6:39:33 PM1/6/11
to cython...@googlegroups.com, John Salvatier
On 1/6/11 2:37 PM, John Salvatier wrote:
> axis_funcs.c:3915:25: error: #if with no expression

> Line 3915 looks like :


>
> static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
> #if HAVE_HYPOT
> return hypotf(z.real, z.imag);
> #else
> return sqrtf(z.real*z.real + z.imag*z.imag);
> #endif
> }
>
> and 4035 is basically the same
>
> I'm not totally sure what this means. Anyone have any ideas?

it probably means that HAVE_HYPOT is defined, but has no value. i.e. the
exact same error as mine, but perhaps generated differently by Cython.

I can't tell from that ugly dev version number how recent it is, but I'd
get the latest and give it a try -- it has been fixed for me in the dev
version I got this afternoon.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris....@noaa.gov

John Salvatier

unread,
Jan 6, 2011, 6:41:11 PM1/6/11
to cython...@googlegroups.com
I got this version no more than 2 hours ago.

Christopher Barker

unread,
Jan 6, 2011, 7:05:50 PM1/6/11
to cython...@googlegroups.com
On 1/6/11 3:41 PM, John Salvatier wrote:
> I got this version no more than 2 hours ago.

Darn.

Let's see what Lisandro says -- I'm out of my depth!

Christopher Barker

unread,
Jan 6, 2011, 7:11:35 PM1/6/11
to cython...@googlegroups.com
On 1/6/11 4:05 PM, Christopher Barker wrote:
> On 1/6/11 3:41 PM, John Salvatier wrote:
>> I got this version no more than 2 hours ago.

I just looked in Cython 0.14, and Cython-devel, which I jsut got from here:

http://hg.cython.org/

it actually looks two weeks old.

I greped it, and the only place I see "HAVE_HYPOT" is in:

Cython/Compiler/PyrexTypes.py, and it has been fixed there:

#if !defined(HAVE_HYPOT) || defined(_MSC_VER)


Are you sure you actually running the dev version when you compile your
pyx files?

Robert Bradshaw

unread,
Jan 6, 2011, 8:30:22 PM1/6/11
to cython...@googlegroups.com
On Thu, Jan 6, 2011 at 4:11 PM, Christopher Barker
<Chris....@noaa.gov> wrote:
> On 1/6/11 4:05 PM, Christopher Barker wrote:
>>
>> On 1/6/11 3:41 PM, John Salvatier wrote:
>>>
>>> I got this version no more than 2 hours ago.
>
> I just looked in Cython 0.14, and Cython-devel, which I jsut got from here:
>
> http://hg.cython.org/
>
> it actually looks two weeks old.
>
> I greped it, and the only place I see "HAVE_HYPOT" is in:
>
> Cython/Compiler/PyrexTypes.py, and it has been fixed there:
>
>          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
>
>
> Are you sure you actually running the dev version when you compile your pyx
> files?

We recently switched over to using git (hosted on github). I haven't
yet set up a cron job to update the hg repositories, but at the very
least I should change the link on the main page, which I'll do now.

- Robert

Christopher Barker

unread,
Jan 6, 2011, 8:40:16 PM1/6/11
to cython...@googlegroups.com
Robert Bradshaw wrote:
> We recently switched over to using git (hosted on github). I haven't
> yet set up a cron job to update the hg repositories,

that explains the two weeks -- but the issue was fixed then, so I think
the OP is still running an older one - unless it has re-surfaced.

> but at the very
> least I should change the link on the main page, which I'll do now.

yup -- I thought I remembered git, then saw that nifty Hg page.

Does github provide a simple one click download of the devel version as
a zip or tarball? That was very nice to find with the Hg page. I really
didn't want the whole repository, figure out how to install/use git on
Windows, etc.

Robert Bradshaw

unread,
Jan 6, 2011, 8:50:20 PM1/6/11
to cython...@googlegroups.com
On Thu, Jan 6, 2011 at 5:40 PM, Christopher Barker
<Chris....@noaa.gov> wrote:
> Robert Bradshaw wrote:
>>
>> We recently switched over to using git (hosted on github). I haven't
>> yet set up a cron job to update the hg repositories,
>
> that explains the two weeks -- but the issue was fixed then, so I think the
> OP is still running an older one - unless it has re-surfaced.

This should be fine at the tip:
https://github.com/cython/cython/blob/master/Cython/Compiler/PyrexTypes.py#L1386

>> but at the very
>> least I should change the link on the main page, which I'll do now.
>
> yup -- I thought I remembered git, then saw that nifty Hg page.
>
> Does github provide a simple one click download of the devel version as a
> zip or tarball? That was very nice to find with the Hg page. I really didn't
> want the whole repository, figure out how to install/use git on Windows,
> etc.

Looks like clicking on the "downloads" button at
https://github.com/cython/cython will give it to you.

- Robert

John Salvatier

unread,
Jan 7, 2011, 11:45:48 AM1/7/11
to cython...@googlegroups.com
The problem ended up being some remaining files in my build folder (a bit embarrassing). I deleted them and used the git branch and got my code to compile. 

As a side note, if Git is the correct repository, is there a reason the hg branch is still active and not otherwise marked as defunct? 

Thanks for your help!
John

Robert Bradshaw

unread,
Jan 7, 2011, 12:54:16 PM1/7/11
to cython...@googlegroups.com
On Fri, Jan 7, 2011 at 8:45 AM, John Salvatier
<jsal...@u.washington.edu> wrote:
> The problem ended up being some remaining files in my build folder (a
> bit embarrassing). I deleted them and used the git branch and got my code to
> compile.

Great.

> As a side note, if Git is the correct repository, is there a reason the hg
> branch is still active and not otherwise marked as defunct?

I've removed the link to it, but do intend to keep it up as a
read-only repository for a while at least.

- Robert

Reply all
Reply to author
Forward
0 new messages