C++ OpenMP omp获取时间g++;32位
为了测量程序某些部分的时间,我想使用OpenMP的C++ OpenMP omp获取时间g++;32位,c++,gcc,openmp,C++,Gcc,Openmp,为了测量程序某些部分的时间,我想使用OpenMP的omp\u get\u wtime()函数。我只能编译32位的项目(使用-m32gcc选项)。我得到了这些错误: libgomp.a(time.o): In function 'gomp_ialias_omp_get_wtick': undefined reference to 'clock_getres' libgomp.a(time.o): In function 'gomp_ialias_omp_get_wtime': undefi
omp\u get\u wtime()
函数。我只能编译32位的项目(使用-m32
gcc选项)。我得到了这些错误:
libgomp.a(time.o): In function 'gomp_ialias_omp_get_wtick':
undefined reference to 'clock_getres'
libgomp.a(time.o): In function 'gomp_ialias_omp_get_wtime':
undefined reference to 'clock_gettime'
虽然我在64位编译时没有任何错误(我做了一个简单的测试)
我使用-fopenmp
链接openmp
。我试图添加-gomp
,但没有改变任何东西
我运行的是2012 Cent OS版本(64位),并使用GCC4.4.7进行编译。更有趣的是,我不能用
apt
升级或安装任何东西,但我可以从缺少的库中编译源代码。较旧版本的glibc在librt
中定义clock\u getres
和clock\u gettime
,而不是libc
,所以您可能只需要链接-lrt