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

Build failure on 32-bit platforms #68

Closed
satta opened this issue Oct 9, 2016 · 2 comments
Closed

Build failure on 32-bit platforms #68

satta opened this issue Oct 9, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@satta
Copy link
Contributor

satta commented Oct 9, 2016

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!

@h-2
Copy link
Member

h-2 commented Oct 10, 2016

Dear Sascha,

thanks for the report. Your proposed solution is the correct one, only that I prefer c++ static casts over the c-style casts. I have committed a fix: cdb7e75

@h-2 h-2 self-assigned this Oct 10, 2016
@h-2 h-2 added this to the 1.0.1 milestone Oct 10, 2016
@h-2 h-2 added the bug label Oct 10, 2016
@satta
Copy link
Contributor Author

satta commented Oct 10, 2016

Thanks for your prompt action!

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

No branches or pull requests

2 participants