kingsfordgroup / armatus

BSD 2-Clause "Simplified" License
25 stars 10 forks source link

Error on install #3

Closed latkins closed 8 years ago

latkins commented 8 years ago

I am attempting to install armatus, but get the following error:

[ 33%] Building CXX object src/CMakeFiles/armatus.dir/ArmatusUtil.cpp.o
cd /home/lpa24/dev/util/armatus/src && /usr/bin/clang++    -O3 -g -std=c++11 -Wall -I/home/lpa24/boost/include -I/home/lpa24/dev/util/armatus/include    -o CMakeFiles/armatus.dir/ArmatusUtil.cpp.o -c /home/lpa24/dev/util/armatus/src/ArmatusUtil.cpp
/home/lpa24/dev/util/armatus/src/ArmatusUtil.cpp:31:19: error: call to 'make_shared' is ambiguous
    prop.matrix = make_shared<SparseMatrix>();
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr.h:626:5: note: candidate function [with _Tp = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<unsigned long, long>,
      boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, _Args = <>]
    make_shared(_Args&&... __args)
    ^
/home/lpa24/boost/include/boost/smart_ptr/make_shared_object.hpp:246:87: note: candidate function [with T = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<double,
      std::allocator<double> > >, Args = <>]
template< class T, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Args && ... args )
                                                                                      ^
/home/lpa24/dev/util/armatus/src/ArmatusUtil.cpp:117:19: error: call to 'make_shared' is ambiguous
    prop.matrix = make_shared<SparseMatrix>(n,n,M);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.2.1/../../../../include/c++/5.2.1/bits/shared_ptr.h:626:5: note: candidate function [with _Tp = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<unsigned long, long>,
      boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >, _Args = <int &, int &, int &>]
    make_shared(_Args&&... __args)
    ^
/home/lpa24/boost/include/boost/smart_ptr/make_shared_object.hpp:246:87: note: candidate function [with T = boost::numeric::ublas::matrix<double, boost::numeric::ublas::basic_row_major<unsigned long, long>, boost::numeric::ublas::unbounded_array<double,
      std::allocator<double> > >, Args = <int &, int &, int &>]
template< class T, class... Args > typename boost::detail::sp_if_not_array< T >::type make_shared( Args && ... args )
                                                                                      ^
2 errors generated.
src/CMakeFiles/armatus.dir/build.make:89: recipe for target 'src/CMakeFiles/armatus.dir/ArmatusUtil.cpp.o' failed
make[2]: *** [src/CMakeFiles/armatus.dir/ArmatusUtil.cpp.o] Error 1
make[2]: Leaving directory '/home/lpa24/dev/util/armatus'
CMakeFiles/Makefile2:88: recipe for target 'src/CMakeFiles/armatus.dir/all' failed
make[1]: *** [src/CMakeFiles/armatus.dir/all] Error 2
make[1]: Leaving directory '/home/lpa24/dev/util/armatus'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2

What have I done wrong?

rob-p commented 8 years ago

Hi @latkins,

From what I can tell given the CMake output --- it seems that you're using a compiler that is likely stricter (and newer) than the one we used when developing. The error looks like it is due to an ambiguity in the call to make_shared. My guess is that there is more than one make_shared definition available at this point in the source code (perhaps std::make_shared and boost::make_shared?). The solution is most likely to prefix these occurrences of make_shared with std::. Could you tell me what compiler and version you're using? I'm a bit confused by the output here because it looks like clang++ is being called, but the error is coming from what looks to be a gnu (i.e. gcc) file.

--Rob

latkins commented 8 years ago

I've since discovered that there are binaries, so this isn't an issue any more! Thanks.