shinpei0208 / gdev

First-Class GPU Resource Management: Device Drivers, Runtimes, and CUDA Compilers for Nouveau.
http://www.pdsl.jp/
MIT License
350 stars 72 forks source link

Problem compiling on Ubuntu 15.04 64 bit #31

Open stuaxo opened 9 years ago

stuaxo commented 9 years ago

Had a bit of trouble compiling this:

/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp: In member function ‘bool analysis::ControlTree::_interact(const NodeVector&, const NodeVector&)’:
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:872:21: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
      boost::ref(this), _1, _2));
                     ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:878:21: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
      boost::ref(this), _1, _2));
                     ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:884:21: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
      boost::ref(this), _1, _2));
                     ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp: In member function ‘analysis::ControlTree::NodeVector analysis::ControlTree::_minimal_hammock_graph(const Edge&)’:
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:920:24: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
         boost::ref(this), _1, _2));
                        ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp: In member function ‘bool analysis::ControlTree::_forward_copy(analysis::ControlTree::Node*)’:
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:1135:24: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
         boost::ref(this), _1, _2));
                        ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:1142:24: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
         boost::ref(this), _1, _2));
                        ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:1149:24: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
         boost::ref(this), _1, _2));
                        ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
/home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:1162:24: error: invalid initialization of non-const reference of type ‘analysis::ControlTree*&’ from an rvalue of type ‘analysis::ControlTree*’
         boost::ref(this), _1, _2));
                        ^
In file included from /usr/include/boost/bind/bind.hpp:25:0,
                 from /usr/include/boost/bind.hpp:22,
                 from /home/stu/projects/external/gdev/cuda/runtime/ocelot/analysis/implementation/ControlTree.cpp:22:
/usr/include/boost/ref.hpp:64:63: note: in passing argument 1 of ‘const boost::reference_wrapper<T> boost::ref(T&) [with T = analysis::ControlTree*]’
 template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
                                                               ^
cuda/CMakeFiles/ucuda.dir/build.make:365: recipe for target 'cuda/CMakeFiles/ucuda.dir/runtime/ocelot/analysis/implementation/ControlTree.cpp.o' failed
make[2]: *** [cuda/CMakeFiles/ucuda.dir/runtime/ocelot/analysis/implementation/ControlTree.cpp.o] Error 1
CMakeFiles/Makefile2:112: recipe for target 'cuda/CMakeFiles/ucuda.dir/all' failed
make[1]: *** [cuda/CMakeFiles/ucuda.dir/all] Error 2
Makefile:117: recipe for target 'all' failed
make: *** [all] Error 2
rralf commented 9 years ago

Had the same issues here. Try either to build gdev against an older boost version (e.g. 1.47) or just remove the std::ref around (this). This used to work for me, but don't ask me if this is the correct way to go...

duttasankha commented 7 years ago

Changing from boost::ref(this) to boost::ref(*this) did the trick. I used boost 1.58.

YuehChuan commented 1 week ago

@duttasankha this works charm for me :) Boost Version: 1.65