Opened 11 years ago

Last modified 10 years ago

#6629 new Bugs

NVCC chokes on boost/mpl/map

Reported by: gshao@… Owned by: Aleksey Gurtovoy
Milestone: To Be Determined Component: mpl
Version: Boost 1.44.0 Severity: Problem
Keywords: CUDA Cc: gshao@…

Description

We're now receiving a bug report from our customers that they are hitting a problem compiling a code including boost with NVCC.

The bug report from our customer:


Unfortunately I’m now hitting a real problem with NVCC elsewhere in boost too. Once again, merely including the header is enough to trip up NVCC (but only on Windows):

boost_mpl_map.cu: #include <boost/mpl/map.hpp> int main( int argc, char argv ) { }

C:\>nvcc boost_mpl_map.cu -o boost_mpl_map.exe -Iboost/include/boost-1_44 boost_mpl_map.cu tmpxft_00000764_00000000-3_boost_mpl_map.cudafe1.gpu tmpxft_00000764_00000000-8_boost_mpl_map.cudafe2.gpu boost_mpl_map.cu tmpxft_00000764_00000000-3_boost_mpl_map.cudafe1.cpp tmpxft_00000764_00000000-14_boost_mpl_map.ii stuff/boost/include/boost-1_44\boost/mpl/aux_/order_impl.hpp(35) : error C2064: term does not evaluate to a function taking 2 arguments stuff/boost/include/boost-1_44\boost/mpl/aux_/order_impl.hpp(57) : see reference to class template instantiation 'boost::mpl::x_order_impl<Seq,Key>' being compiled

As with the previous issues, compiling as a .cpp (still using NVCC) is fine. This affects both CUDA 4.0 and CUDA 4.1, and I’m using VS2010 for CL. A workaround would be greatly appreciated if you can find one as I haven’t managed to come up with one yet!


This issue has been investigated by our developers and finally it was root caused as a boost issue. He downloaded boost 1.44.0, and found that boost is doing something special when CUDACC is defined.

boost_1_44_0$ grep -IR CUDACC * boost/config/select_compiler_config.hpp:#elif defined CUDACC

boost/concept/detail/has_constraints.hpp:#if BOOST_WORKAROUND(SUNPRO_CC, <= 0x580)
defined(CUDACC)

boost/type_traits.hpp:#if !defined(BORLANDC) && !defined(CUDACC)

Unfortunately, this special workaround in boost does not work properly.

If he just compile the example code supplied in the description with the Microsoft compiler, after renaming it to .cpp, with CUDACC defined, the compilation fails.

U:\> type main.cpp #include <boost/mpl/map.hpp> int main(int argc, char *argv[]) { return 0; }

U:\> cl -DCUDACC -Iboost_1_44_0 main.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved.

main.cpp boost_1_44_0\boost/mpl/aux_/order_impl.hpp(50) : error C2064: term does not evaluate to a function taking 2 arguments boost_1_44_0\boost/mpl/aux_/order_impl.hpp(57) : see reference to class template instantiation 'boost::mpl::x_order_impl<Seq,Key>' being compiled

So, this might be a bug in boost. If the boost implementers put this special treatment for nvcc due to a bug in nvcc, we are willing to work on the real bug, but this one is a bug in the special treatment code.

Best regards, Andrew Shao

Change History (3)

comment:1 by Andrew Shao <gshao@…>, 11 years ago

Hello,

Has this problem been investigated? Is there any update?

Regards, Andrew Shao

comment:2 by anonymous, 11 years ago

Hello there,

Is there any update about this issue? Thanks.

comment:3 by viboes, 10 years ago

Component: Nonempl
Owner: set to Aleksey Gurtovoy

Please set the component in the future if you want it to be analyzed.

Note: See TracTickets for help on using tickets.