pypest / pypestutils

python-wrapped PEST utilities #winning
The Unlicense
11 stars 6 forks source link

building on Mac M2 arch #16

Open mnfienen opened 10 months ago

mnfienen commented 10 months ago

@mwtoews - I hope there is a reasonably simple answer, but following the https://github.com/pypest/pypestutils/blob/main/BUILD.md instructions, I installed meson and ninja via pip and already have gfortran available at the commandline. When I run the build libs script, however, I get an error about not being able to find GNU compiler. Top of the error is like this:

image

and after all the #defines I see this

image

I'm on OS 13.6. Does this ring any bells?

mwtoews commented 10 months ago

Hi @mnfienen it sounds like you might have installed some macOS updates, take a look at https://github.com/orgs/Homebrew/discussions/3832

mnfienen commented 10 months ago

thanks @mwtoews I tried reinstalling XCode CLtools but still same error.....

mwtoews commented 10 months ago

Bummer! Is your set-up able to compile other gcc/gfortran projects with meson such as mf6, or is it only having difficulty with pestutils? Is it via homebrew's gcc? What version does gfortran --version show? @briochh might have ideas, as he has a macOS silicone laptop (I don't).

mnfienen commented 10 months ago

hmmmm..... no - I haven't compiled anything in a bit.

version is GNU Fortran (GCC) 12.1.0

I'll see if @briochh sees the bat signal :). Thanks!

briochh commented 10 months ago

I see it, but I may not be much help. I am sans computer for the next months. The only thing I remember is that I could only compile using a true python version (i.e. not conda python). Also I don't think i used meson, i think I was running cibuildwheel ...

briochh commented 8 months ago

@mnfienen, @mwtoews has put together some steps for building on Mac running arm. I have just work through on my M1 machine to upload arm wheels to pypi. You could see if it also works on M2? https://github.com/pypest/pypestutils/wiki/BuildingBdistForMacOSarm64

mnfienen commented 8 months ago

I'm actually still on M1 Max I figured out. But....I found that by mamba installing gfortran from conda-forge into the same env as meson and ninja everything just worked fine

mwtoews commented 8 months ago

Updates to BUILD.md are always welcome! Perhaps more conda-specific instructions should be there? (Currently it's primarily conda for Windows)

mnfienen commented 8 months ago

great idea - I'll PR some instructions

mnfienen commented 8 months ago

Actually, the conda instructions are already there, so if I had been better at #rtfm maybe would have been ok. I would only suggest maybe promoting the conda/mamba instructions to the top of the page?