2011-11-01 51 views
0

編譯項目時使用nvcc(使用cuda 3.1),我得到了來自gthr-default.h的大量警告: nvcc/cuda 3.1 - ghtr-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 

我已經挖遍了所有,似乎無法找到一種方法來抑制這種噪音,短缺刪除-Wall,我真的不想做。這對任何人都很熟悉嗎?

我CXXFLAGS是:

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

我試着加入$(CUDA_INCLUDE_DIR)到-Xcompiler選項,以及,但無濟於事。我不想從設置中刪除Wall ...還有其他選項嗎?

回答

1

嘗試分離的並行線程代碼到不同的文件,這樣就可以避免任何#包括文件被觸發這些警告...

+0

不幸的是,我沒有任何並行線程的代碼 - 或者至少,沒有特別#包括在內。任何正在進行的線程都是nvcc在後臺執行某些操作的結果... – trycatch

+0

代碼中的某些內容正在拉動gthr-default.h。嘗試發佈您的代碼。或者只是嘗試更新的CUDA版本,例如4.0。 – Tom