目前,我在Snow Leopard的XCode 3.2.2上尝试OpenMP:
#include <omp.h> #include <iostream> #include <stdio.h> int main (int argc,char * const argv[]) { #pragma omp parallel printf("Hello from thread %d,nthreads %d\n",omp_get_thread_num(),omp_get_num_threads()); return 0; }
“_omp_get_thread_num”,referenced from: _main in main.o
“_omp_get_num_threads”,referenced from: _main in main.o
好的,没问题,我看看现有的框架,寻找关键字,如openmp或omp ……这里出现问题,链接库在哪里?或者我应该说,openMP的链接库的名称是什么?它是dylib,框架还是什么?或者我是否需要先从某个地方获取它?