dnbaker / dashing

Fast and accurate genomic distances using HyperLogLog
GNU General Public License v3.0
160 stars 11 forks source link

Can't build using gcc 5.4 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609 #21

Closed ZekunYin closed 5 years ago

ZekunYin commented 5 years ago

Hi Daniel, When I tried to build dashing on my server, I got these errors:

In file included from src/dashing.cpp:8:0:
bonsai/hll/mh.h: In member function ‘sketch::minhash::HyperMinHash<T, Hasher>& sketch::minhash::HyperMinHash<T, Hasher>::operator+=(const sketch::minhash::HyperMinHash<T, Hasher>&)’:
bonsai/hll/mh.h:985:32: error: ‘max_fn16’ is not a member of ‘sketch::hll::detail::SIMDHolder’
                     do {*ptr = SIMDHolder::op(*ptr, *optr++);} while(++ptr != eptr); break;
                                ^
bonsai/hll/mh.h:987:17: note: in expansion of macro ‘CASE_U’
                 CASE_U(U16, max_fn16)
                 ^
bonsai/hll/mh.h:985:32: error: ‘max_fn32’ is not a member of ‘sketch::hll::detail::SIMDHolder’
                     do {*ptr = SIMDHolder::op(*ptr, *optr++);} while(++ptr != eptr); break;
                                ^
bonsai/hll/mh.h:988:17: note: in expansion of macro ‘CASE_U’
                 CASE_U(U32, max_fn32)
                 ^
bonsai/hll/mh.h:985:32: error: ‘max_fn64’ is not a member of ‘sketch::hll::detail::SIMDHolder’
                     do {*ptr = SIMDHolder::op(*ptr, *optr++);} while(++ptr != eptr); break;
                                ^
bonsai/hll/mh.h:989:17: note: in expansion of macro ‘CASE_U’
                 CASE_U(U64, max_fn64)

I'm not sure whether it has anything to do with gcc5.4. But the README says it has been tested using this version of gcc.

dnbaker commented 5 years ago

Hi, and thanks for reporting the issue!

It seems that I neglected to implement a feature for AVX512-enabled systems. I've corrected this in this commit and propagated that change to Dashing's master branch.

Would you trying pulling from master and give that a shot?

If it fails to build, it may be failing to update the sketch submodule, which you could do manually by cd bonsai/hll && git checkout master && git pull origin master && cd ../...

Hope this helps,

Daniel

ZekunYin commented 5 years ago

Hi Daniel, Thanks for reply. I can successfully build dashing on another ubuntu 18.04 server with minor modification to bonsai/hll/bbmh.h in line 362. I changed __m512i lsum = _mm256_set1_epi64(0) to __m512i lsum = _mm512_set1_epi64(0). Due to that my ubuntu 16.04 server is temporary offline, I will try to build dashing using gcc5.4 again later. Your response really helps me a lot. Thanks again. Best, Zekun

dnbaker commented 5 years ago

Great find!

I've incorporated your change here in the sketch library, which version has been updated in the dashing main repository.

Thank you for your help, and don't hesitate to ask further.

Daniel

ZekunYin commented 5 years ago

Hi Daniel, My ubuntu 16.04 server is finally online. But there are still some problems using gcc5.4 to compile dashing especially when using AVX512 reduce intrinsics. I just looked through the x86intrin.h and found that reduce related intrinsics were not supported even AVX512F flag enabled. I think maybe gcc5.4 is no longer the minimal version required by dashing. Best, Zekun

dnbaker commented 5 years ago

Hi Zekun,

Can you provide the specific error? I haven't been able to reproduce it on my systems and I'd like to help, but the Skylake server I normally would test gcc5.4 on is under maintenance, though it should be available with AVX512F (unless perhaps you're KNCNI?) according to Intel's Intrinsics Guide.

ZekunYin commented 5 years ago

Hi Daniel, I'm sorry that I didn't provide the specific errors. Unfortunately the ubuntu 16.04 server was offline again since last night. I will provide more detail when I can get access to it. I'm really sorry to occupy you so such time to deal with it. And thanks again. Best, Zekun

dnbaker commented 5 years ago

Hi,

I've been able to test on a skylake machine with gcc5.4.0. There were indeed issues with gcc5.4.0 and newer intrinsics, but now I've been able to build it. Can you give it another try?

To save the hassle in the future, I've also starting making a binary release. You can find it in release/linux/dashing_s512.gz, which is a compressed executable that should run on your platform.

Thanks!

ZekunYin commented 5 years ago

Thanks a lot. I will try it soon.

Sent with GitHawk

ZekunYin commented 5 years ago

Now dashing works well on ubuntu 16.04 with gcc5.4.0. Thanks so much.

dnbaker commented 5 years ago

Fantastic! I’ll close this for now, but feel free to reopen if you have further issues.