Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make command may produce errors on Apple Silicon w/ Homebrew #5

Open
liamtoney opened this issue Dec 4, 2023 · 5 comments
Open

make command may produce errors on Apple Silicon w/ Homebrew #5

liamtoney opened this issue Dec 4, 2023 · 5 comments

Comments

@liamtoney
Copy link

I recently tried installing infraGA on a new MacBook with an Apple M2 Max processor. I'm using Homebrew to install the dependencies (FFTW only, turns out that OpenMPI is one of its dependencies). Previously, on my Intel MacBook, the make command for infraGA ran w/o errors. Here, though, I got the following:

src/geoac/geoac.eqset.2d.cpp:9:10: fatal error: 'fftw3.h' file not found
#include <fftw3.h>
         ^~~~~~~~~

I looked into this and on Apple Silicon Homebrew installs libraries and headers in /opt/homebrew/lib/ and /opt/homebrew/include/. Based on this SE article I modified the infraGA makefile CFLAGS to be

CFLAGS=  -Wno-write-strings -lfftw3 -L/opt/homebrew/lib/ -I/opt/homebrew/include/ 

and the make process ran without errors. Just a note to hopefully save future users time if they run into the same issue!

@davidfee5
Copy link

I had similar(?) issues installing with the Apple M1 Max chip on Sonoma. I installed fftw3 separately using homebrew and now get the error:

ld: warning: dylib (/opt/homebrew/lib//libfftw3.dylib) was built for newer macOS version (14.0) than being linked (11.3)

Any ideas?

@liamtoney
Copy link
Author

I installed fftw3 separately using homebrew

Did you run brew install fftw or something else?

@davidfee5
Copy link

Yes, I used brew install fftw.

@liamtoney
Copy link
Author

It sort of sounds like you've got multiple installs of FFTW somehow, but that differs from the error I got. Assuming you modified the makefile the way I suggested and you're still getting that error, I'm not sure I can help :( maybe try removing all possible installs of FFTW from your system?

@davidfee5
Copy link

I was able to resolve this by adding export MACOSX_DEPLOYMENT_TARGET=14.0. I had another problem with the setup and using pip to install importlib, but worked around that as well. Thanks @liamtoney!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants