This question already has an answer here:
I am trying to compile the following code to calculate the distances of n d-dimensional points from a specific vantage point.
#include <stdlib.h>
#include <math.h>
#include <omp.h>
void calcDist(double *dist, double **points, double *vp, int n, int d) {
#pragma omp parallel for schedule(static)
for(int i = 0; i < n; i++){
dist[i] = 0;
for(int k = 0; k < d; k++){
dist[i] += pow(X[i][k]-vp[k],2);
}
dist[i] = sqrt(dist[i])
}
}
When I am trying to compile in MacOS Catalina with
clang -fopenmp -o dist.o -c dist.c
I get:
clang: error: unsupported option '-fopenmp'