Subject: [Boost-bugs] [Boost C++ Libraries] #6629: NVCC chokes on boost/mpl/map
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-02-29 01:44:02
#6629: NVCC chokes on boost/mpl/map
------------------------------+---------------------------------------------
Reporter: gshao@⦠| Type: Bugs
Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.44.0
Severity: Problem | Keywords: CUDA
------------------------------+---------------------------------------------
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 -D__CUDACC__ -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
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6629> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC