Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
warning: 'int _import_array()' defined but not used
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Neal Becker  
View profile  
 More options Mar 6 2012, 8:50 am
From: Neal Becker <ndbeck...@gmail.com>
Date: Tue, 06 Mar 2012 08:50:39 -0500
Local: Tues, Mar 6 2012 8:50 am
Subject: warning: 'int _import_array()' defined but not used
I tried a simple test:

--
import numpy as np
cimport numpy as np
import cython

@cython.boundscheck(False)
@cython.wraparound(False)
def allequal(np.ndarray[np.float64_t, ndim=1] a):
    cdef:
        np.float64_t a0
        Py_ssize_t i, n=a.size
    a0 = a[0]
    for i in range(n):
        if a[i] != a0:
            return False
    return True
--

On compiling I saw:

/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__multiarray_ap i.h:
At global scope:
/usr/lib64/python2.7/site-
packages/numpy/core/include/numpy/__multiarray_api.h:1532:1: warning: 'int
_import_array()' defined but not used [-Wunused-function]
/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:2 26:1:
warning: 'int _import_umath()' defined but not used [-Wunused-function]

Usually, failing to call import_array() is asking for a segfault.  What's going
on here?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lisandro Dalcin  
View profile  
 More options Mar 6 2012, 9:27 am
From: Lisandro Dalcin <dalc...@gmail.com>
Date: Tue, 6 Mar 2012 17:27:17 +0300
Local: Tues, Mar 6 2012 9:27 am
Subject: Re: [cython-users] warning: 'int _import_array()' defined but not used
On 6 March 2012 16:50, Neal Becker <ndbeck...@gmail.com> wrote:

Cython does not use any single bit of the NumPy C API, so there is no
need to call import_array(). Of course, if your code do use the NumPy
C API, you need to make the call yourself.

Perhaps Cython should special-case numpy.pxd and issue the call to
import_array() in the generated C code?

--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »