在OSX上使用带有CUDA NVCC的Boost.Python时编译器错误

时间:2015-03-20 01:59:07

标签: python c++ boost cuda boost-python

我试图使用Boost.Python编写python扩展并使用CUDA加速。但是我只是通过编译包含Boost.Python库的文件来获得编译器错误:

// test.cu
#include <boost/python.hpp>

我用

编译它
nvcc test.cu -c -o test.o -ccbin /usr/bin/clang -DNVCC \
    -I/Developer/NVIDIA/CUDA-7.0/include -I/opt/local/include \
    -I/opt/local/Library/Frameworks/Python.framework/Headers

出现以下错误

/opt/local/include/boost/python/args.hpp:88:29: error: return type of out-of-line
      definition of 'boost::python::detail::keywords_base::operator,' differs
      from that in the declaration
keywords_base< nkeywords> ::operator,(const arg &k) const
                            ^
/opt/local/include/boost/python/args.hpp:52:35: note: previous declaration is
      here
inline keywords< nkeywords + 1UL> operator,(const arg & k) const;
                                  ^
/opt/local/include/boost/python/args.hpp:100:29: error: return type of
      out-of-line definition of 'boost::python::detail::keywords_base::operator,'
      differs from that in the declaration
keywords_base< nkeywords> ::operator,(const char *name) const
                            ^
/opt/local/include/boost/python/args.hpp:55:35: note: previous declaration is
      here
inline keywords< nkeywords + 1UL> operator,(const char * name) const;
                                  ^

我正在使用Boost.Python版本1.57和python版本2.7.9,两者都安装了MacPorts。我的CUDA工具包版本是7.0。

提前感谢您的帮助!

0 个答案:

没有答案