MWATelescope / mwa_hyperbeam

MWA beam code
Mozilla Public License 2.0
6 stars 3 forks source link

installation in Mac #6

Closed devojyoti96 closed 6 months ago

devojyoti96 commented 10 months ago

hyperbeam is not installable on mac. pip install shows ERROR: Could not find a version that satisfies the requirement mwa-hyperbeam (from versions: none) ERROR: No matching distribution found for mwa-hyperbeam" Any suggestion for mac installation?

JLBLine commented 10 months ago

Hi @devojyoti96 , I think this can totally depend on what version of Python and what version of pip you are using, rather than being a Mac problem. This depends on how you installed Python, but you might be able to do something like pip install --upgrade pip and then mwa-hyperdrive will become available. Beware that it may install new versions of library dependencies and break existing installations however. I would instead recommend using Anaconda, creating a new virtual environment, and trying to install there. I have successfully installed mwa_hyperdrive using Python3.11 and upgrading pip as stated before. Instructions for Anaconda on Mac are here: https://docs.anaconda.com/free/anaconda/install/mac-os/

devojyoti96 commented 10 months ago

@JLBLine , I tried it. It seems the problem is due to cpu architechture. I saw from hyperbeam pypi page it works only on X86-64 architechture, but my mac has M2 processor, which uses arm architechture. I tried downloading .whl for mac and install and it shows that it is not supported on this platform. I then downloaded the source code and locally compile. It is working fine. Now if I use the locally created python wheel for arm64 in any other mac system with arm64 architechture, it is installing fine and also working. Is there any plan to include arm64 in pypi version as well?

cjordan commented 8 months ago

Hi @devojyoti96. I no longer maintain hyperbeam, but I strongly recommend you follow the instructions to build from source on the main README; personally, I think this is not very onerous and hopefully things "just work". I will add an issue for pre-compiled packages for M1/M2/M3 Macs, though.

d3v-null commented 6 months ago

Sorry for the wait, we've just pushed a fix to address. This works on my M2 mac:

pip install -U mwa_hyperbeam
python -c 'from mwa_hyperbeam import FEEBeam; print(FEEBeam().calc_jones_array([0],[0],167_000_000,[0]*16,[1]*16,True,None,False))'
[[-2.45930956e-04-1.39408348e-05j  9.46475886e-01+3.22774529e-01j
   9.46885461e-01+3.21571025e-01j -2.45380878e-04-1.78884782e-05j]]