Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem compiling on Ubuntu 15.04 64 bit #31

Open
stuaxo opened this issue Jul 27, 2015 · 2 comments
Open

Problem compiling on Ubuntu 15.04 64 bit #31

stuaxo opened this issue Jul 27, 2015 · 2 comments

Comments

@stuaxo
Copy link

stuaxo commented Jul 27, 2015

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
Copy link

rralf commented Nov 10, 2015

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants