BioPP / bppsuite

Bio++ Program Suite
16 stars 13 forks source link

Install cannot convert ‘std::unique_ptr<bpp::Tree>::pointer’ {aka ‘bpp::Tree*’} to ‘const bpp::Tree&’ #21

Closed shuaiwang2 closed 3 months ago

shuaiwang2 commented 3 months ago

Hi , I run into some bugs when install it.

cmake -DCMAKE_INSTALL_PREFIX=bppsuite/ ./
make

cmake result

-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found /usr/bin/gzip compression program, using file extension .gz
-- bpp-core3 1.0.0 found:
--   static lib: not built/installed
--   shared lib: /usr/local/lib/libbpp-core3.so.1.0.0
--   includes: /usr/local/include
-- bpp-seq3 1.0.0 found:
--   static lib: not built/installed
--   shared lib: /usr/local/lib/libbpp-seq3.so.1.0.0
--   includes: /usr/local/include
-- bpp-phyl3 1.0.0 found:
--   static lib: not built/installed
--   shared lib: /usr/local/lib/libbpp-phyl3.so.1.0.0
--   includes: /usr/local/include
-- bpp-popgen3 1.0.0 found:
--   static lib: not built/installed
--   shared lib: /usr/local/lib/libbpp-popgen3.so.1.0.0
--   includes: /usr/local/include
-- Found /usr/bin/makeinfo: 'info' and 'html' target enabled (builds info/html doc)
-- Configuring done
-- Generating done
-- Build files have been written to: /media/shuaiwang/3d/FileS1-master/bio/bppsuite

bug when make

[ 75%] Building CXX object bppSuite/CMakeFiles/bpptreedraw.dir/bppTreeDraw.cpp.o
/media/s/3d/FileS1-master/bio/bppsuite/bppSuite/bppTreeDraw.cpp: In function ‘int main(int, char**)’:
/media/s/3d/FileS1-master/bio/bppsuite/bppSuite/bppTreeDraw.cpp:110:29: error: cannot convert ‘std::unique_ptr<bpp::Tree>::pointer’ {aka ‘bpp::Tree*’} to ‘const bpp::Tree&’
  110 |     td->setTree(tree.release());
      |                 ~~~~~~~~~~~~^~
      |                             |
      |                             std::unique_ptr<bpp::Tree>::pointer {aka bpp::Tree*}
/media/s/3d/FileS1-master/bio/bppsuite/bppSuite/bppTreeDraw.cpp:142:42: error: cannot convert ‘std::unique_ptr<bpp::TreeDrawing>::pointer’ {aka ‘bpp::TreeDrawing*’} to ‘std::shared_ptr<bpp::TreeDrawing>’
  142 |     controler->registerTreeDrawing(td.get());
      |                                    ~~~~~~^~
      |                                          |
      |                                          std::unique_ptr<bpp::TreeDrawing>::pointer {aka bpp::TreeDrawing*}
/usr/include/c++/11/bits/unique_ptr.h:962:30: error: no matching function for call to ‘bpp::BasicTreeDrawingDisplayControler::BasicTreeDrawingDisplayControler(bpp::TreeDrawingSettings*)’
  962 |     { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [bppSuite/CMakeFiles/bpptreedraw.dir/build.make:76: bppSuite/CMakeFiles/bpptreedraw.dir/bppTreeDraw.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:457: bppSuite/CMakeFiles/bpptreedraw.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Could you have some advice to solve it ?

jydu commented 3 months ago

Hi,

Thank you for reporting the issue. I committed a fix, it should work after updating the content of the bppsuite repository (git pull).

Best,

Julien.

shuaiwang2 commented 3 months ago

Thanks for your help,it has fixed