nvcc / cuda 3.1 - ghtr-default.h“已声明的静态”泛滥,但未定义警告 [英] nvcc/cuda 3.1 - ghtr-default.h flood of "declared static" but not defined warnings

查看:583
本文介绍了nvcc / cuda 3.1 - ghtr-default.h“已声明的静态”泛滥,但未定义警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当使用nvcc(使用cuda 3.1)编译项目时,我收到了来自gthr-default.h的大量警告:

When compiling a project with nvcc (using cuda 3.1), I'm getting a flood of warnings from gthr-default.h:


/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:118: warning: ‘int __gthrw_pthread_once(pthread_once_t*, void (*)())’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:119: warning: ‘void* __gthrw_pthread_getspecific(pthread_key_t) throw ()’ declared ‘static’ but never defined
/usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/bits/gthr-default.h:120: warning: ‘int __gthrw_pthread_setspecific(pthread_key_t, const void*) throw ()’ declared ‘static’ but never defined

我已经挖到了所有的地方,似乎没有找到一种方法来抑制这种噪音,短缺去除 - 墙,我不真的想做。这看起来熟悉任何人吗?

I've dug around all over and can't seem to find a way to suppress this noise, short of removing -Wall, which I don't really want to do. Does this look familiar to anyone?

我的CXXFLAGS是:

My CXXFLAGS are:

CXXFLAGS=-Isrc -I../cxxtest -I$(CUDA_INCLUDE_DIR) -Xcompiler -O2 -Xcompiler -Wall

我试过添加$ CUDA_INCLUDE_DIR)到-Xcompiler选项,但没有效果。我不想从设置中删除Wall ...有没有其他选项?

I've tried adding the $(CUDA_INCLUDE_DIR) to the -Xcompiler options as well but to no avail. I don't want to remove Wall from the settings... are there any other options?

推荐答案

尝试分离您的pthreads代码到一个不同的文件,这样你可以避免#including任何文件触发这些警告...

Try separating your pthreads code into a different file so that you can avoid #including whatever file is triggering those warnings...

这篇关于nvcc / cuda 3.1 - ghtr-default.h“已声明的静态”泛滥,但未定义警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆