freesurfer / surfa

Python utilities for medical image and surface-based analysis
26 stars 9 forks source link

Build issue on macbook #36

Closed RishikGupta28 closed 1 month ago

RishikGupta28 commented 3 months ago
 1 warning and 2 errors generated.
  error: command '/usr/bin/clang' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for surfa Failed to build surfa ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (surfa)

i am getting this error,

Screenshot 2024-07-28 at 4 50 16 PM

I tried to install surfa by using pip, still not able to find a solution

sswartz commented 3 months ago

Having the same issue on macbook

technav2245 commented 2 months ago

@jnolan14 @ahoopes @mu40 same issue - how can we install on macos without hitting wheel error?

oulap commented 1 month ago

I had a similar issue when installing using pip on linux. The reason was that for some reason the wheel does not restrict the numpy version to be <2.0.

If I download the tar.gz file from pip and edit the toml and setup files to have numpy < 2.0 the wheel installs fine.

Haven't tried building from source.

oulap commented 1 month ago

Building after cloning the github repo seems to work after adding the "<2.0" after numpy in the setup.py file.

Creating the source build with that change also fixes the pip installation issue.

ahoopes commented 1 month ago

Thanks @oulap for addressing this... and sorry to everyone for being slow. I haven't had much bandwidth to work on surfa recently

This fix will work, as long as your env also maintains numpy < 2.0. Otherwise, these errors will be thrown:

ValueError: numpy.dtype size changed, may indicate binary incompatibility. ...

or

A module that was compiled using NumPy 1.x cannot be run in NumPy 2.1.1 ...

I will include the version requirement for now, but it's only a temporary solution.

A long term solution is to address the real problem - that including C bindings is not maintainable. Especially with such limited developer time. The bindings are really only required for image grid resampling. The best move is to just replace this with scipy interpolation. It will be slower, but it's probably a necessary simplification.

If this is something anyone wants to tackle - please go for it! It will be a while before I have the time

ahoopes commented 1 month ago

Okay I added the numpy requirement b0e364a and pushed a new version to pypi (v0.6.1)