fatal error: 'omp.h' file not found on mac

I'm attempting to run the following using a macbook pro 32 bit Sequoia 15.6.1 with Xcode 16:
But I keep getting the error:
>> build_mex
Building with 'Xcode Clang++'.
Error using mex
In file included from
/Users/user/Desktop/Novelis_project/Data/TextureReduction/calcGSH.cpp:16:
/Users/user/Desktop/Novelis_project/Data/TextureReduction/GSHFun.h:2:10:
fatal error: 'omp.h' file not found
2 | #include <omp.h>
| ^~~~~~~
1 error generated.
Error in build_mex (line 3)
mex COMPFLAGS="$COMPFLAGS /openmp" calcGSH.cpp GSHFun.cpp GSHLibrarySmol.cpp -lmwblas

1 Comment

Torsten
Torsten on 11 Sep 2025
Edited: Torsten on 11 Sep 2025
Check
if it helps.
Maybe you only have to include the path where OpenMP is located on your computer as compiler flag:
-L/usr/local/opt/libomp/lib -I/usr/local/opt/libomp/include
Or is it installed somewhere else on your mac ?

Sign in to comment.

Answers (0)

Categories

Products

Release

R2022a

Tags

Asked:

Guy
on 11 Sep 2025

Edited:

on 11 Sep 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!