apple clang -fopenmp not working

前端 未结 2 898
再見小時候
再見小時候 2021-01-04 13:04

I am trying to use openmp with Apple clang but can\'t make it work. I did download and compile the openmp library from llvm. My problem is that clang doesn\'t recognize the

2条回答
  •  我在风中等你
    2021-01-04 13:11

    There is a way to use OpenMP with just Apple Clang. I learnt it while hacking a formula in Homebrew. You need libomp from Homebrew (brew install libomp), and then a different command-line option.

    If you originally want to use clang -fopenmp test.c, with Apple Clang you need to use this alternative command:

    clang -Xpreprocessor -fopenmp test.c -lomp
    

提交回复
热议问题