chaoszhang / ASTER

Accurate Species Tree EstimatoR series: a family of optimation algorithms for species tree inference implemented in C++ (including ASTRAL-Pro & Weighted ASTRAL)
GNU Affero General Public License v3.0
85 stars 9 forks source link

ASTER installation error on Linux #21

Closed barrettlab closed 3 months ago

barrettlab commented 3 months ago

Hello,

Thanks for such an awesome suite of software! I'm interested in waster-site in particular but am having some issues installing the linux distribution both on my server and our HPC. Perhaps I'm doing something wrong! I don't think the gcc/g++ version is the issue.


(base) cbarrett@myco:/usr/local/src/ASTER-Linux$ g++ --version
g++ (Anaconda gcc) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(base) cbarrett@myco:/usr/local/src/ASTER-Linux$ gcc --version
gcc (Anaconda gcc) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Here is the error message:


git clone https://github.com/chaoszhang/ASTER.git

cd ASTER

make                          # failed, see below
make waster-site       # also failed with similar messaging

# Output:

[cfb0001@trcis001 ASTER]$ ls
example  exe  LICENSE  make.bat  makefile  misc  README.md  src  tutorial
[cfb0001@trcis001 ASTER]$ make
g++ -v 2>&1 | tail -n 1
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
echo 'If installation failed, please ensure g++ version >= 7.5.0'
If installation failed, please ensure g++ version >= 7.5.0
mkdir -p bin
g++ -std=gnu++11 -march=native -Ofast -pthread src/astral.cpp -o bin/astral4 || g++ -std=c++17 -O2 -pthread src/astral.cpp -o bin/astral4
cp bin/astral4 bin/astral
g++ -std=gnu++11 -march=native -Ofast -pthread src/astral-pro.cpp -o bin/astral-pro3 || g++ -std=c++17 -O2 -pthread src/astral-pro.cpp -o bin/astral-pro3
cp bin/astral-pro3 bin/astral-pro
g++ -std=gnu++11 -march=native -Ofast -pthread src/astral-hybrid.cpp -o bin/wastral || g++ -std=c++17 -O2 -pthread src/astral-hybrid.cpp -o bin/wastral
cp bin/wastral bin/astral-hybrid
g++ -std=gnu++11 -march=native -Ofast -pthread src/caster-site.cpp -o bin/caster-site || g++ -std=gnu++17 -O2 -pthread src/caster-site.cpp -o bin/caster-site
In file included from src/caster-site.cpp:39:0:
src/sequence.hpp: In member function ‘void TripartitionInitializer::Gene::updateCnt(int, int, int, const TripartitionInitializer::Sequence&)’:
src/sequence.hpp:294:50: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
    int indStart = (i == 0) ? 0 : species2indRange[i - 1];
                                                  ^
src/sequence.hpp:295:33: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
    int indEnd = species2indRange[i];
                                 ^
src/sequence.hpp:299:22: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
     int iInd = indBin[indIt];
                      ^
src/sequence.hpp:302:13: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<TripartitionInitializer::Gene::Kernal []>’ and ‘int’)
       kernal[iSite].update(y, x, seq, ind2seq[iInd] + iSite);
             ^
src/sequence.hpp:302:46: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const long unsigned int []>’ and ‘int’)
       kernal[iSite].update(y, x, seq, ind2seq[iInd] + iSite);
                                              ^
src/sequence.hpp:308:39: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
        int iKernal = indSiteRep2kernal[(iInd * nSite + iSite) * nRep + iRep];
                                       ^
src/sequence.hpp:309:33: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<TripartitionInitializer::Gene::Kernal []>’ and ‘int’)
        if (iKernal != -1) kernal[iKernal].update(y, x, seq, ind2seq[iInd] + iSite);
                                 ^
src/sequence.hpp:309:68: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const long unsigned int []>’ and ‘int’)
        if (iKernal != -1) kernal[iKernal].update(y, x, seq, ind2seq[iInd] + iSite);
                                                                    ^
src/sequence.hpp: In member function ‘score_t TripartitionInitializer::Gene::scoreCnt()’:
src/sequence.hpp:321:20: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<TripartitionInitializer::Gene::Kernal []>’ and ‘int’)
     score += kernal[iKernal].score(pi);
                    ^
src/sequence.hpp: In member function ‘void TripartitionInitializer::Gene::clearCntScore()’:
src/sequence.hpp:330:11: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<TripartitionInitializer::Gene::Kernal []>’ and ‘int’)
     kernal[iKernal].reset();
           ^
src/sequence.hpp: In constructor ‘Quadrupartition::Gene::Gene(TripartitionInitializer::Gene&, int, int)’:
src/sequence.hpp:462:49: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<int []>’ and ‘int’)
    for (int i = 0; i < ufb_fold; i++) ufb_offset[i] = rand() % ufb_size;
                                                 ^
src/sequence.hpp: In member function ‘void Quadrupartition::Gene::updateCnt(int, int, int, const TripartitionInitializer::Sequence&)’:
src/sequence.hpp:468:50: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
    int indStart = (i == 0) ? 0 : species2indRange[i - 1];
                                                  ^
src/sequence.hpp:469:33: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
    int indEnd = species2indRange[i];
                                 ^
src/sequence.hpp:473:22: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
     int iInd = indBin[indIt];
                      ^
src/sequence.hpp:476:13: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
       kernal[iSite].update(y, x, seq, ind2seq[iInd] + iSite);
             ^
src/sequence.hpp:476:46: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const long unsigned int []>’ and ‘int’)
       kernal[iSite].update(y, x, seq, ind2seq[iInd] + iSite);
                                              ^
src/sequence.hpp:482:39: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const int []>’ and ‘int’)
        int iKernal = indSiteRep2kernal[(iInd * nSite + iSite) * nRep + iRep];
                                       ^
src/sequence.hpp:483:33: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
        if (iKernal != -1) kernal[iKernal].update(y, x, seq, ind2seq[iInd] + iSite);
                                 ^
src/sequence.hpp:483:68: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<const long unsigned int []>’ and ‘int’)
        if (iKernal != -1) kernal[iKernal].update(y, x, seq, ind2seq[iInd] + iSite);
                                                                    ^
src/sequence.hpp: In member function ‘std::array<double, 3ul> Quadrupartition::Gene::scoreCnt()’:
src/sequence.hpp:495:36: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
     array<score_t, 3> temp = kernal[iKernal].score(pi);
                                    ^
src/sequence.hpp: In member function ‘void Quadrupartition::Gene::blCnt(std::array<double, 2ul>&, int, int)’:
src/sequence.hpp:505:45: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
     array<unsigned, 2> cnt = blCntPos(kernal[iKernal].cnt[i], kernal[iKernal].cnt[j]);
                                             ^
src/sequence.hpp:505:69: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
     array<unsigned, 2> cnt = blCntPos(kernal[iKernal].cnt[i], kernal[iKernal].cnt[j]);
                                                                     ^
src/sequence.hpp: In member function ‘void Quadrupartition::Gene::annotate(CustomizedAnnotation&)’:
src/sequence.hpp:531:25: error: no match for ‘operator[]’ (operand types are ‘std::shared_ptr<int []>’ and ‘int’)
     int pos = ufb_offset[t];
                         ^
src/sequence.hpp: In member function ‘void Quadrupartition::Gene::clearCntScore()’:
src/sequence.hpp:563:11: error: no match for ‘operator[]’ (operand types are ‘const std::shared_ptr<Quadrupartition::Gene::Kernal []>’ and ‘int’)
     kernal[iKernal].reset();
           ^
In file included from src/caster-site.cpp:41:0:
src/sequtils.hpp: In member function ‘std::vector<std::vector<int> > DistanceMatrix::cluster(std::mt19937&, double, bool)’:
src/sequtils.hpp:577:57: error: converting to ‘std::vector<std::tuple<double, int, int> >::value_type {aka std::tuple<double, int, int>}’ from initializer list would use explicit constructor ‘constexpr std::tuple< <template-parameter-1-1> >::tuple(_UElements&& ...) [with _UElements = {double, int&, int&}; <template-parameter-2-2> = void; _Elements = {double, int, int}]’
                 order.push_back({(double) d[i][j], i, j});
                                                         ^
In file included from /usr/include/c++/4.8.2/bits/shared_ptr.h:52:0,
                 from /usr/include/c++/4.8.2/memory:82,
                 from /usr/include/c++/4.8.2/thread:40,
                 from src/caster-site.cpp:18:
/usr/include/c++/4.8.2/bits/shared_ptr_base.h: In instantiation of ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Tp1*) [with _Tp1 = int; _Tp = const int []; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’:
/usr/include/c++/4.8.2/bits/shared_ptr.h:113:32:   required from ‘std::shared_ptr<_Tp>::shared_ptr(_Tp1*) [with _Tp1 = int; _Tp = const int []]’
src/sequence.hpp:290:102:   required from here
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:739:39: error: cannot convert ‘int*’ to ‘const int (*)[]’ in initialization
         : _M_ptr(__p), _M_refcount(__p)
                                       ^
/usr/include/c++/4.8.2/bits/shared_ptr_base.h: In instantiation of ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Tp1*) [with _Tp1 = long unsigned int; _Tp = const long unsigned int []; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’:
/usr/include/c++/4.8.2/bits/shared_ptr.h:113:32:   required from ‘std::shared_ptr<_Tp>::shared_ptr(_Tp1*) [with _Tp1 = long unsigned int; _Tp = const long unsigned int []]’
src/sequence.hpp:290:102:   required from here
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:739:39: error: cannot convert ‘long unsigned int*’ to ‘const long unsigned int (*)[]’ in initialization
/usr/include/c++/4.8.2/bits/shared_ptr_base.h: In instantiation of ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Tp1*) [with _Tp1 = TripartitionInitializer::Gene::Kernal; _Tp = TripartitionInitializer::Gene::Kernal []; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’:
/usr/include/c++/4.8.2/bits/shared_ptr.h:113:32:   required from ‘std::shared_ptr<_Tp>::shared_ptr(_Tp1*) [with _Tp1 = TripartitionInitializer::Gene::Kernal; _Tp = TripartitionInitializer::Gene::Kernal []]’
src/sequence.hpp:290:102:   required from here
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:739:39: error: cannot convert ‘TripartitionInitializer::Gene::Kernal*’ to ‘TripartitionInitializer::Gene::Kernal (*)[]’ in initialization
/usr/include/c++/4.8.2/bits/shared_ptr_base.h: In instantiation of ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Tp1*) [with _Tp1 = Quadrupartition::Gene::Kernal; _Tp = Quadrupartition::Gene::Kernal []; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’:
/usr/include/c++/4.8.2/bits/shared_ptr.h:113:32:   required from ‘std::shared_ptr<_Tp>::shared_ptr(_Tp1*) [with _Tp1 = Quadrupartition::Gene::Kernal; _Tp = Quadrupartition::Gene::Kernal []]’
src/sequence.hpp:461:94:   required from here
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:739:39: error: cannot convert ‘Quadrupartition::Gene::Kernal*’ to ‘Quadrupartition::Gene::Kernal (*)[]’ in initialization
/usr/include/c++/4.8.2/bits/shared_ptr_base.h: In instantiation of ‘std::__shared_ptr<_Tp, _Lp>::__shared_ptr(_Tp1*) [with _Tp1 = int; _Tp = int []; __gnu_cxx::_Lock_policy _Lp = (__gnu_cxx::_Lock_policy)2u]’:
/usr/include/c++/4.8.2/bits/shared_ptr.h:113:32:   required from ‘std::shared_ptr<_Tp>::shared_ptr(_Tp1*) [with _Tp1 = int; _Tp = int []]’
src/sequence.hpp:461:94:   required from here
/usr/include/c++/4.8.2/bits/shared_ptr_base.h:739:39: error: cannot convert ‘int*’ to ‘int (*)[]’ in initialization
g++: error: unrecognized command line option ‘-std=gnu++17’
make: *** [caster-site] Error 1

Any help would be much appreciated!

Cheers, Craig

chaoszhang commented 3 months ago

Weiredly the g++ command alias to a wrong version of gcc. You may need to manually change g++ in the makefile to your latest g++. (Maybe you just need to activate your Anaconda environment?)

[cfb0001@trcis001 ASTER]$ make g++ -v 2>&1 | tail -n 1 gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) echo 'If installation failed, please ensure g++ version >= 7.5.0' If installation failed, please ensure g++ version >= 7.5.0