我在尝试编译项目时遇到以下错误: (fortran,使用 gfortran)
undefined reference to `omp_get_max_threads_'
undefined reference to `omp_get_thread_num_'
问题是,我的 GCC 版本是 4.4.3,它应该支持 OpenMP。
最佳答案
使用gcc,您需要使用-fopenmp
进行编译和链接以启用OpenMP。其他编译器有不同的选项;对于 intel,它是 -openmp
,对于 pgi,它是 -mp
,等等。
关于gcc - 对 `omp_get_max_threads_' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9685377/