surfa icon indicating copy to clipboard operation
surfa copied to clipboard

Build issue on macbook

Open RishikGupta28 opened this issue 1 year ago • 2 comments

 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

RishikGupta28 avatar Jul 28 '24 11:07 RishikGupta28

Having the same issue on macbook

sswartz avatar Jul 30 '24 15:07 sswartz

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

technav2245 avatar Aug 11 '24 23:08 technav2245

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 avatar Sep 20 '24 01:09 oulap

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.

oulap avatar Sep 20 '24 18:09 oulap

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 avatar Sep 20 '24 22:09 ahoopes

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

ahoopes avatar Sep 20 '24 22:09 ahoopes