Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22067

How to compile OpenMP C program in OSX with Clang [duplicate]

$
0
0

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'


Viewing all articles
Browse latest Browse all 22067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>