环境:
mac OSX
gcc 版本: 4.9
gcc -v :
gcc version 4.9.2 20141029 (prerelease) (GCC)
如果gcc版本是4.2,直接编译含omp.h的文件时,会报错(No such file or directory)
安装4.9的具体步骤如下:
http://stackoverflow.com/questions/20340117/omp-h-library-isnt-found-in-the-gcc-version-4-2-1-in-mavericks
如果报错说,fatal error: stdio.h: No such file or directory
#include “stdio.h”
再执行xcode-select –install 即可解决路径依赖的问题
测试代码如下:
#include <stdio.h>
#include "omp.h"
int main () {
int nth