I followed the instructions here: Using x86 libraries and OpenMP on macOS arm64 architecture
I am trying to compile simple code:
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char* argv[])
{
#pragma omp parallel
{
printf("Hello World... from thread = %d\n",
omp_get_thread_num());
}
}
using:
/usr/local/opt/llvm/bin/clang++ -arch x86_64 main.cpp
but I am getting error:
In file included from main.cpp:1:
In file included from /usr/local/Cellar/llvm/13.0.0_2/lib/clang/13.0.0/include/omp.h:18:
/usr/local/opt/llvm/bin/../include/c++/v1/stdlib.h:93:15: fatal error: 'stdlib.h' file not found
#include_next <stdlib.h>
Can anyone help me with next steps? I suppose I should add stdlib somewhere, but I don't have idea how to do it.