conda-forge / mayavi-feedstock

A conda-smithy repository for mayavi.
BSD 3-Clause "New" or "Revised" License
4 stars 18 forks source link

Pinning Numpy #5

Closed Cadair closed 2 months ago

Cadair commented 7 years ago

Since my comment on the original recipie PR I am wondering if mayavi actually uses the numpy ABI. This should be checked. It should also be noted that defaults no longer pins mayavi to numpy.

dfroger commented 7 years ago

tvtk/src/array_ext.pyx calls Numpy C-API, does it means it relies on numpy ABI?

Cadair commented 7 years ago

I would assume so, but I don't know for sure.

dfroger commented 7 years ago

From the doc http://conda-forge.github.io/docs/meta.html#building-against-numpy:

If you have a package which links against numpy you need to build and run against the same version of numpy.

mayavi does not seem to link against numpy:

$ ldd lib/python3.5/site-packages/tvtk/array_ext.cpython-35m-x86_64-linux-gnu.so
    linux-vdso.so.1 (0x00007fff0cae3000)
    libpython3.5m.so.1.0 => /home/dfroger/miniconda3/envs/mayavi/lib/python3.5/site-packages/tvtk/../../../libpython3.5m.so.1.0 (0x00007fc2ca06b000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fc2c9e4e000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc2c9aa3000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc2c989f000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007fc2c969c000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fc2c9494000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fc2c9193000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc2ca798000)
Cadair commented 7 years ago

That seems to imply not then!

dfroger commented 7 years ago

I'll look at array_ext.pyx in more details.

By the way, can I add you in the mayavi-feedstock maintainer list?

Cadair commented 7 years ago

sure.

patricksnape commented 7 years ago

@jakirkham Am I right in thinking that requiring the numpy headers is what is meant by 'linking'?

jakirkham commented 7 years ago

Well they seem to be running a function that they forward declared from NumPy earlier. So maybe they are linking to it. Would probably require more investigation to be sure, but it does seem likely.

ref: https://github.com/enthought/mayavi/blob/1bb13ab816b5e754a534209440a57ffa4aa4b7d8/tvtk/src/array_ext.pyx#L35-L37

dfroger commented 7 years ago

The import_array function do check for ABI backward incompatible change, so I would say that mayavi need to be recompile for every ABI incompatible change. Which numpy version are ABI incompatible?

array_ext.pyx defines functions that only manipulate the ndarray object, so the mayavi package do not need a functionality provided since a particular NPY_FEATURE_VERSION.

The numpy.ndarray is declared as a external extension type, and there is actually no need to link with numpy .so library (no function from a .so of numpy is needed for example).

import_arrray is a function making use of normal C/Python API to get numpy information at run time, but no numpy function is need at compile time.

larsoner commented 2 months ago

During the NumPy 2 migration the pin_compatible("numpy")s were removed so I think we can close this!