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

fatal error: 'omp.h' file not found #79

Open
cjwu382 opened this issue May 2, 2024 · 3 comments
Open

fatal error: 'omp.h' file not found #79

cjwu382 opened this issue May 2, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@cjwu382
Copy link

cjwu382 commented May 2, 2024

Hello,

I'm following along the Quickstart guide and am trying to run the breast3D example. After running mrun python 01_script_forward.py after following the setup instructions in my conda environment, I am encountering the following error:

gcc -march=native -O3 -g -fPIC -Wall -std=c99 -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -L/opt/homebrew/opt/libomp/lib /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/92880c20e74dc42603f8fec770e331f8f6b398cb.c -lm -o /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/92880c20e74dc42603f8fec770e331f8f6b398cb.dylib
/var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/92880c20e74dc42603f8fec770e331f8f6b398cb.c:9:10: fatal error: 'omp.h' file not found
#include "omp.h"
^~~~~~~
1 error generated.
FAILED compiler invocation: gcc -march=native -O3 -g -fPIC -Wall -std=c99 -Wno-unused-result -Wno-unused-variable -Wno-unused-but-set-variable -ffast-math -shared -L/opt/homebrew/opt/libomp/lib /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/92880c20e74dc42603f8fec770e331f8f6b398cb.c -lm -o /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/92880c20e74dc42603f8fec770e331f8f6b398cb.dylib

I've tried brew install libomp but this did not change the result. I am running on a MacBook Pro with an M3 chip.

I'd appreciate any tips, thanks!

@ccuetom ccuetom added the help wanted Extra attention is needed label May 3, 2024
@ccuetom
Copy link
Contributor

ccuetom commented May 3, 2024

could you try running this command instead? DEVITO_COMPILER=clang mrun python 01_script_forward.py

@cjwu382
Copy link
Author

cjwu382 commented May 3, 2024

Thanks so much for the reply. I tried the above and got this new error message:

clang -O3 -g -fPIC -Wall -std=c99 -Wno-unused-result -Wno-unused-variable -ffast-math -fdenormal-fp-math=ieee -march=native -shared -fopenmp /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/dc7df019512a5358be14bf326a272c25af391f6a.c -lm -o /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/dc7df019512a5358be14bf326a272c25af391f6a.dylib
clang: error: unsupported option '-fopenmp'
clang: error: unsupported option '-fopenmp'
FAILED compiler invocation: clang -O3 -g -fPIC -Wall -std=c99 -Wno-unused-result -Wno-unused-variable -ffast-math -fdenormal-fp-math=ieee -march=native -shared -fopenmp /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/dc7df019512a5358be14bf326a272c25af391f6a.c -lm -o /var/folders/f5/8wnxq98j4yg3kcwdnr6wxv1w0000gn/T/devito-jitcache-uid501/dc7df019512a5358be14bf326a272c25af391f6a.dylib

I tried installing brew llvm (according to this post: https://stackoverflow.com/questions/60005176/how-to-deal-with-clang-error-unsupported-option-fopenmp-on-travis) but still got the same error as above

@ccuetom
Copy link
Contributor

ccuetom commented May 6, 2024

Could you try running DEVITO_COMPILER=osx instead?

This is related to the Devito compilation stack, so you’re probably going to get more insights there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants