Skip to content

Build failure on 32-bit platforms #68

Description

@satta

Lambda (1.0.0) fails to build on 32-bit platforms (ARM, MIPS, PPC, ...) due to:

/«PKGBUILDDIR»/src/lambda.hpp:703:35: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /«PKGBUILDDIR»/src/lambda.cpp:22:
/usr/include/c++/6/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/6/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
In file included from /«PKGBUILDDIR»/src/lambda.cpp:34:0:
/«PKGBUILDDIR»/src/lambda.hpp:703:35: note: candidate expects 2 arguments, 1 provided
effectiveLength = std::min({
~~~~~~~~^~
length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
effectiveLength});
~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/ios:40,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from /«PKGBUILDDIR»/src/lambda.cpp:22:
/usr/include/c++/6/bits/stl_algobase.h:243:5: note: candidate: template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:243:5: note: template argument deduction/substitution failed:
In file included from /«PKGBUILDDIR»/src/lambda.cpp:34:0:
/«PKGBUILDDIR»/src/lambda.hpp:703:35: note: candidate expects 3 arguments, 1 provided
effectiveLength = std::min({
~~~~~~~~^~
length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
effectiveLength});
~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:62:0,
from /usr/include/seqan/basic/debug_test_system.h:152,
from /usr/include/seqan/basic/basic_debug.h:52,
from /usr/include/seqan/basic.h:49,
from /«PKGBUILDDIR»/src/lambda.cpp:24:
/usr/include/c++/6/bits/stl_algo.h:3447:5: note: candidate: template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)
min(initializer_list<_Tp> __l)
^~~
/usr/include/c++/6/bits/stl_algo.h:3447:5: note: template argument deduction/substitution failed:
In file included from /«PKGBUILDDIR»/src/lambda.cpp:34:0:
/«PKGBUILDDIR»/src/lambda.hpp:703:35: note: deduced conflicting types for parameter '_Tp' ('long long int' and 'long long unsigned int')
effectiveLength = std::min({
~~~~~~~~^~
length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
effectiveLength});
~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/algorithm:62:0,
from /usr/include/seqan/basic/debug_test_system.h:152,
from /usr/include/seqan/basic/basic_debug.h:52,
from /usr/include/seqan/basic.h:49,
from /«PKGBUILDDIR»/src/lambda.cpp:24:
/usr/include/c++/6/bits/stl_algo.h:3453:5: note: candidate: template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)
min(initializer_list<_Tp> __l, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algo.h:3453:5: note: template argument deduction/substitution failed:
In file included from /«PKGBUILDDIR»/src/lambda.cpp:34:0:
/«PKGBUILDDIR»/src/lambda.hpp:703:35: note: deduced conflicting types for parameter '_Tp' ('long long int' and 'long long unsigned int')
effectiveLength = std::min({
~~~~~~~~^~
length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
effectiveLength});

A full build log can be found here:
https://buildd.debian.org/status/fetch.php?pkg=lambda-align&arch=powerpc&ver=1.0.0-1&stamp=1475842854

I managed to fix the problem by casting all values in the initializer list to the same type:

(sid_powerpc-dchroot)satta@partch:~/lambda-align$ git diff
diff --git a/src/lambda.hpp b/src/lambda.hpp
index c83ca44..f80866a 100644
--- a/src/lambda.hpp+++ b/src/lambda.hpp@@ -701,8 +701,8 @@ seedLooksPromising(LocalDataHolder<TGlobalHolder, TScoreExtension> const & lH,
}
effectiveLength = std::min({
- length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,- length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,+ (uint64_t) (length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin),+ (uint64_t) (length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin),
effectiveLength});
// std::cout << effectiveQBegin << "\t" << effectiveSBegin << "\t"
// << effectiveLength << "\n";

Since this change may introduce semantic changes (e.g. in the case of negative values), I'd like to check with you if this is OK, otherwise I would be glad to learn of a better solution. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions