V
V
Vladislav Molchanov2017-03-19 15:06:09
C++ / C#
Vladislav Molchanov, 2017-03-19 15:06:09

How to use openmp in xcode?

I am learning the openmp library. I am using the Xcode environment. Wrote the first simple program

#include <iostream>
#include <omp.h>

int main() {
#pragma omp parallel
    std::cout << "hello, world" << std::endl;

    return 0;
}

An error occurred while compiling: "omp.h" file not found. After reading the Internet, I found out that it seems like the default Apple LLVM compiler does not support working with openmp.
Tried running the program from terminal using g++
$ g++-6 -fopenmp main.cpp
$ ./a.out
hello, worldhello, worldhello, worldhello, world




$

As you can see everything works.
I wanted to change the compiler in XCode, but there is nothing in the list except for Apple LLVM
3a154f4ff807499e8a60461a21557af0.png
Question: how can I use the openmp library in XCode?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Mikhailuts, 2018-05-19
@JBMurloc

Move to an adequate development environment.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question