trustimaging / stride

A modelling and optimisation framework for medical ultrasound
https://www.stride.codes
GNU Affero General Public License v3.0
83 stars 15 forks source link

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

Open cjwu382 opened 2 months ago

cjwu382 commented 2 months ago

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 commented 2 months ago

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

cjwu382 commented 2 months ago

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 commented 2 months ago

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.