SBC-Utrecht / PyTom

PyTom software for cryo-tomogram processing
GNU General Public License v2.0
33 stars 8 forks source link

use better way to find numpy include directory #66

Closed sroet closed 2 months ago

sroet commented 2 months ago

Should close #65 again

sroet commented 2 months ago

@jjv5, could you either try this branch or apply the diff manually and see if that fixes your issue?

sroet commented 2 months ago

yeah, the c-api changed to much in numpy 2.0 to generate a quick fix, making an issue for that and restricting to <2 for now

jjv5 commented 2 months ago

Building now - correctly found ndarray include files, compilation underway.

Will update when/if complete. On Aug 22, 2024 at 10:01 AM -0400, Sander Roet @.***>, wrote:

@jjv5, could you either try this branch or apply the diff manually and see if that fixes your issue? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

sroet commented 2 months ago

@jjv5 Make sure to also recreate the environment as it now requires numpy<2 (changing the c-API is more work than doable in any reasonable timeframe)

jjv5 commented 2 months ago

A few more issues:

First error hit during compile

/programs/x86_64-linux/pytom/1.1_jim_a9b/miniconda3/envs/pytom_env/lib/python3.12/site-packages/numpy/_core/include/numpy/ npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED _API NPY_1_7_API_VERSION" [-Wcpp]    17 | #warning "Using deprecated NumPy API, disable it with " \       |  ^~~ In file included from /programs/x86_64-linux/pytom/1.1_jim_a9b/miniconda3/envs/pytom_env/lib/python3.12/site-packages/nump y/_core/include/numpy/ndarrayobject.h:22: /programs/x86_64-linux/pytom/1.1_jim_a9b/miniconda3/envs/pytom_env/lib/python3.12/site-packages/numpy/_core/include/numpy/ __multiarray_api.h:1475:10: fatal error: numpy/_public_dtype_api_table.h: No such file or directory  1475 | #include "numpy/_public_dtype_api_table.h"       |          ^~~~~~~~~ compilation terminated.

error  and then

/programs/x86_64-linux/pytom/1.1_jim_a9b/miniconda3/envs/pytom_env/lib/python3.12/site-packages/numpy/_core/include/numpy/ npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED _API NPY_1_7_API_VERSION" [-Wcpp]    17 | #warning "Using deprecated NumPy API, disable it with " \       |  ^~~ frm_wrap.c: In function 'obj_to_array_no_conversion': frm_wrap.c:3260:39: error: 'PyArray_NOTYPE' undeclared (first use in this function); did you mean 'PyArray_DTYPE'?  3260 |   if (is_array(input) && (typecode == PyArray_NOTYPE ||       |                                       ^~~~~~       |                                       PyArray_DTYPE

and then many more like:

frm_wrap.c: In function '_wrap_frm': frm_wrap.c:3645:68: error: 'PyArray_DOUBLE' undeclared (first use in this function); did you mean 'PyArray_DTYPE'?  3645 |     array1 = obj_to_array_contiguous_allow_conversion(swig_obj[0], PyArray_DOUBLE, &is_new_object1);       |                                                                    ^~~~~~       |

Seems like these are all related to newer numpy

On Aug 22, 2024 at 10:17 AM -0400, @.***, wrote:

Building now - correctly found ndarray include files, compilation underway.

Will update when/if complete. On Aug 22, 2024 at 10:01 AM -0400, Sander Roet @.***>, wrote:

@jjv5, could you either try this branch or apply the diff manually and see if that fixes your issue? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

jjv5 commented 2 months ago

Rebuilt the conda env with the new numpy<2 restriction. Compilation succeeds. pytom and pytomGUI both run. I don't really know how to use them, but seem fully functional. This is on Rocky 9 machine.

Thanks for the quick fix.