How to include omp.h in OS X?

前端 未结 5 648
一个人的身影
一个人的身影 2020-11-30 11:04

I\'m new in C and have some problems compiling my code in OS X.

I code Java a lot both in Eclipse and use terminal to compile my code. However now I\'m learning open

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-30 11:28

    MacOS seems to have that library included but XCode can't find it if you simply use:

    #include 
    

    However, if you don't have the library installed,you can simply add it by installing it with HomeBrew:

    brew install libomp
    

    After doing this , simply replace library include code with this one:

    #include "/usr/local/opt/libomp/include/omp.h"
    

    or the path that terminal shows you after installing libomp with brew.

提交回复
热议问题