Le 27/11/2017 à 00:39, Alexis Murzeau a écrit :
> Hi,
>
> Le 26/11/2017 à 22:01, Fabian Klötzl a écrit :
>> Ho,
>>
>> On 26.11.2017 19:32, Walter Landry wrote:
>>> Andreas Tille wrote:
Unfortunately I've hit another issue:
...
classifier.h:428:54: error: the value of 'rank' is not usable in a
constant expression
while((uint8_t)_hitMap[i].rank < rank) {
^~~~
classifier.h:424:21: note: 'uint8_t rank' is not const
uint8_t rank = 0;
^~~~
>>>
>>> That is mysterious to me. Is that the first error?
>>>
>>
>> That reminds me of an error where the `<` was mistaken for the opening
>> angle brackets of a template. Flipping the order of the comparison or
>> adding some extra parentheses might help.
>
> Indeed, it seems gcc understand rank as std::rank, and maybe is trying
> to read _hitMap[i].std::rank ("using namespace std" is used,
> "rank" can also reference std::rank).
>
> Reversing the order works: "while(rank > _hitMap[i].rank)".
> Removing "using namespace std" is probably a better long-term solution
> for upstream.
>
> As a side note, I found the package to not build on 32 bits linux
> because the ASM instruction "popcntq" doesn't exists. To avoid that
> error, I used "export POPCNT_CAPABILITY=0" in debian/rules.
> But I'm not sure this program is designed to run with less than 2GB of
> memory anyway :) This flag is needed anyway if you want your package to
> build for non-amd64 architecture.
>
> I got a deb file after the following modifications:
> - Reversing the while condition (as said above)
> - Patching Makefile to take into account the DESTDIR variable, used by
> Debian packaging scripts to set the target directory where to install
> and uninstall files (that is, $(DESTDIR)$(prefix) instead of just $(prefix))
> - Add a dh_auto_install override to set "prefix" to /usr instead of
> default /usr/local
>
> And the generated .deb got several lintian warnings/errors:
> W: centrifuge: wrong-bug-number-in-closes l3:#xxx
> W: centrifuge: new-package-should-close-itp-bug
> W: centrifuge: script-with-language-extension
> usr/bin/centrifuge-BuildSharedSequence.pl
> W: centrifuge: script-with-language-extension
> usr/bin/centrifuge-RemoveEmptySequence.pl
> W: centrifuge: script-with-language-extension usr/bin/centrifuge-RemoveN.pl
> W: centrifuge: script-with-language-extension usr/bin/centrifuge-compress.pl
> W: centrifuge: script-with-language-extension usr/bin/centrifuge-sort-nt.pl
> W: centrifuge: binary-without-manpage usr/bin/centrifuge
> W: centrifuge: binary-without-manpage
> usr/bin/centrifuge-BuildSharedSequence.pl
> W: centrifuge: binary-without-manpage
> usr/bin/centrifuge-RemoveEmptySequence.pl
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-RemoveN.pl
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-build
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-build-bin
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-class
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-compress.pl
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-download
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-inspect
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-inspect-bin
> W: centrifuge: binary-without-manpage usr/bin/centrifuge-sort-nt.pl
> E: centrifuge: python-script-but-no-python-dep usr/bin/centrifuge-build
> E: centrifuge: python-script-but-no-python-dep usr/bin/centrifuge-inspect
> W: centrifuge: script-not-executable
> usr/share/centrifuge/doc/strip_markdown.pl
>
> So there is still some work to do after that ^^
>
>>
>> I will do some more investigation, tomorrow.
>>
>> Fabian
>>
>
I attached a dirty patch so you can see exactly what I have modified to
fix errors.
--
Alexis Murzeau
PGP: B7E6 0EBB 9293 7B06 BDBC 2787 E7BD 1904 F480 937F
diff --git a/debian/patches/0002-Fix-build-with-rank.patch
b/debian/patches/0002-Fix-build-with-rank.patch
new file mode 100644
index 000..6e29a9c
--- /dev/null
+++ b/debian/patches/0002-Fix-build-with-rank.patch
@@ -0,0 +1,21 @@
+From: Alexis Murzeau
+Date: Mon, 27 Nov 2017 00:04:21 +0100
+Subject: Fix build with rank
+
+---
+ classifier.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/classifier.h b/classifier.h
+index f61a7f0..13b110b 100644
+--- a/classifier.h
b/classifier.h
+@@ -425,7 +425,7 @@ public:
+ while(_hitMap.size() > (size_t)rp.khits) {
+ _hitTaxCount.clear();
+ for(size_t i = 0; i < _hitMap.size(); i++) {
+-while(_hitMap[i].rank < rank) {
++while(rank > _hitMap[i].rank) {
+ if(_hitMap[i].rank + 1 >= _hitMap[i].path.size()) {
+ _hitMap[i].rank =
std::numeric_limits::max();
+ break;
diff --git a/debian/patches/0003-Fix-m