[Numpy-discussion] npy_log2 undefined on Linux

Matthew Brett matthew.brett at gmail.com
Fri Oct 24 21:04:47 EDT 2014


Hi,

We (dipy developers) have a hit a new problem trying to use the
``npy_log`` C function in our code.

Specifically, on Linux, but not on Mac or Windows, we are getting
errors of form:

ImportError: /path/to/extension/distances.cpython-34m.so: undefined
symbol: npy_log2

when compiling something like:

<eg_log.pyx>
import numpy as np
cimport numpy as cnp

cdef extern from "numpy/npy_math.h" nogil:
    double npy_log(double x)


def use_log(double val):
    return npy_log(val)
</eg_log.pyx>

See : https://github.com/matthew-brett/mincy/tree/npy_log_example for
a self-contained example that replicates the failure with ``make``.

I guess this means that the code referred to by ``npy_log`` is not on
the ordinary runtime path on Linux?

What should I do next to debug?

Thanks a lot,

Matthew



More information about the NumPy-Discussion mailing list