gmarcais / Jellyfish

A fast multi-threaded k-mer counter
Other
471 stars 136 forks source link

Cannot be built on i686, mips, and armhf. #52

Open rekado opened 8 years ago

rekado commented 8 years ago

Jellyfish cannot be built on any other architecture than x86_64. On at least three other platforms building fails because of embedded assembly instructions in ./include/jellyfish/rectangular_binary_matrix.hpp. Is there any way to make this work on ARM, i686, or mips64el? Or is x86_64 the only supported architecture?

Here are complete build logs for the three failing architectures:

ARM: http://hydra.gnu.org/build/908724/log/raw

i686: http://hydra.gnu.org/build/908727/log/raw

mips64el: http://hydra.gnu.org/build/908726/log/raw

gmarcais commented 8 years ago

Can you try with the following configure flags: --with-sse=no --with-int128=no. The code to run the matrix multiplication without x86_64 assembly (SSE really) is there.

If x86_64 was the primary target, I'd like Jellyfish to run on other processors. Do let me know if the above flags are enough to solve the problem.

rekado commented 8 years ago

My apologies for dropping the ball. I'll test this soon and report back. Thanks!

rekado commented 8 years ago

Unfortunately, passing "--with-sse=no" and "--with-int128=no" is not enough to make the build work on i686 and armhf (I haven't tested on mips64el yet).

I get errors like these:

unit_tests/test_mer_dna.cc: In instantiation of ‘void {anonymous}::MerDNA_GetBits_Test<gtest_TypeParam_>::TestBody() [with gtest_TypeParam_ = {anonymous}::VTC<jellyfish::mer_dna_ns::mer_base_static<long long unsigned int, 0>, 3>]’:
unit_tests/test_mer_dna.cc:529:1:   required from here
unit_tests/test_mer_dna.cc:464:96: error: no matching function for call to ‘min(long unsigned int, unsigned int)’
       std::min(this->GetParam().size() - start, 8 * sizeof(typename TypeParam::Type::base_type));
                                                                                                ^
unit_tests/test_mer_dna.cc:464:96: note: candidates are:
In file included from /gnu/store/q1x8zzwmr7jwl45hwncz2c4w4ad5pvwz-gcc-4.9.3/include/c++/bits/stl_tree.h:61:0,
                 from /gnu/store/q1x8zzwmr7jwl45hwncz2c4w4ad5pvwz-gcc-4.9.3/include/c++/map:60,
                 from unit_tests/test_mer_dna.cc:20:
/gnu/store/q1x8zzwmr7jwl45hwncz2c4w4ad5pvwz-gcc-4.9.3/include/c++/bits/stl_algobase.h:194:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)
     min(const _Tp& __a, const _Tp& __b)
     ^
/gnu/store/q1x8zzwmr7jwl45hwncz2c4w4ad5pvwz-gcc-4.9.3/include/c++/bits/stl_algobase.h:194:5: note:   template argument deduction/substitution failed:
unit_tests/test_mer_dna.cc:464:96: note:   deduced conflicting types for parameter ‘const _Tp’ (‘long unsigned int’ and ‘unsigned int’)
       std::min(this->GetParam().size() - start, 8 * sizeof(typename TypeParam::Type::base_type));
...

So far, jellyfish only builds on x86_64.

gmarcais commented 8 years ago

OK, you got an error, but it looks like a small little things in testing code.

Can you try this patch:

diff --git a/unit_tests/test_mer_dna.cc b/unit_tests/test_mer_dna.cc
index a6f27b8..9415219 100644
--- a/unit_tests/test_mer_dna.cc
+++ b/unit_tests/test_mer_dna.cc
@@ -461,7 +461,8 @@ TYPED_TEST(MerDNA, GetBits) {
   for(unsigned int i = 0; i < 20; ++i) {
     long int start   = random() % (this->GetParam().size() - 1);
     long int max_len =
-      std::min(this->GetParam().size() - start, 8 * sizeof(typename TypeParam::Type::base_type));
+      std::min((long int)(this->GetParam().size() - start),
+               (long int)(8 * sizeof(typename TypeParam::Type::base_type)));
     long int len     = (random() % (max_len - 1)) + 1;

     // Get bits by right-shifting
rekado commented 8 years ago

With this patch applied the build succeeds on i686 (haven't tried the other platforms yet), but 11 of the 13 tests fail.