【发布时间】:2012-01-22 03:04:51
【问题描述】:
nvcc 抛出
/usr/include/boost/concept/detail/has_constraints.hpp:29: error: ‘&’ cannot appear in a constant-expression
/usr/include/boost/concept/detail/has_constraints.hpp:29: error: template argument 2 is invalid
has_constraints.hpp 中已经有一些可疑代码:
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580)
// Work around the following bogus error in Sun Studio 11, by
// turning off the has_constraints function entirely:
// Error: complex expression not allowed in dependent template
// argument expression
inline no has_constraints_(...);
#else
template <class Model>
inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
inline no has_constraints_(...);
#endif
问题:这是 nvcc boost 不兼容还是我的代码有问题?
【问题讨论】:
-
其实这可能是你要找的更多:forums.nvidia.com/index.php?showtopic=150025
-
nvcc: NVIDIA (R) Cuda 编译器驱动程序 版权所有 (c) 2005-2010 NVIDIA Corporation 构建于 Wed_Nov__3_16:16:57_PDT_2010 Cuda 编译工具,版本 3.2,V0.2.1221
-
g++ (Ubuntu 4.4.3-4ubuntu5) 4.4.3
-
我不断遇到同样的建议:forums.nvidia.com/index.php?showtopic=215470“boost 和 nvcc 存在一个已知的兼容性问题。解决方法是拆分源代码,以便您使用 nvcc 和使用主机编译器提升代码。”如果有更新的版本(有 gcc 版本)并且您有机会对其进行测试,我会尝试的。否则,也许坚持建议。