在CentOS 6.3中编译ocl-icd2.1.3

时间:2014-07-07 03:23:07

标签: linux opencl centos6

我正在尝试在CentOs 6.3中编译ocl-icd2.1.3但是会出错。

ocl_icd_loader.c:40: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
ocl_icd_loader.c:41: error: unknown option after '#pragma GCC diagnostic' kind
ocl_icd_loader.c:44: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
In file included from ocl_icd_loader.h:31,
                 from ocl_icd_loader.c:48:
ocl_icd.h:32: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
ocl_icd.h:33: error: unknown option after '#pragma GCC diagnostic' kind
ocl_icd.h:41: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
In file included from ocl_icd_loader.c:50:
ocl_icd_debug.h:29: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
ocl_icd_debug.h:30: error: unknown option after '#pragma GCC diagnostic' kind
ocl_icd_debug.h:35: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
In file included from ocl_icd_loader.c:50:
ocl_icd_debug.h:69: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
ocl_icd_debug.h:72: error: expected [error|warning|ignored] after '#pragma GCC diagnostic'
make[2]: *** [libOpenCL_la-ocl_icd_loader.lo] Error 1
make[2]: se sale del directorio `/home/juliancho/Descargas/ocl-icd-2.1.3'
make[1]: *** [all-recursive] Error 1
make[1]: se sale del directorio `/home/juliancho/Descargas/ocl-icd-2.1.3'
make: *** [all] Error 2

请帮帮我。 非常感谢你。

2 个答案:

答案 0 :(得分:0)

您的来源包含一行

#pragma GCC diagnostic push

这种实用主义是在GCC 4.6中引入的。你的gcc版本太旧了,无法处理它。

你可以:

  • 升级你的gcc
  • 从makefile中删除-Wunknown-pragmas或等效文件
  • 从makefile中删除-Werror或等效文件
  • 从源
  • 中删除#pragma GCC diagnostic push#pragma GCC diagnostic pop

但只有第一种选择是可靠的。

答案 1 :(得分:0)

昨天升级gcc现在得到了这个:

Wmissing-prototypes "is valid for C / Obj but not for C + + [Enabled by default]