-
Notifications
You must be signed in to change notification settings - Fork 137
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
Change GetUnique() return type from char to init8_t #1269
Conversation
`char` is unsigned on aarch64 Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@@ -63,8 +63,8 @@ class InOutMask { | |||
return unique[mask]; | |||
} | |||
|
|||
static constexpr char GetUnique(uint8_t mask) { | |||
constexpr char next[] = | |||
static constexpr int8_t GetUnique(uint8_t mask) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the change! However, I think we need to go the other way. Here is the full story:
- The return value is assumed to be
0 - 3
(representingA
,C
,G
,T
correspondingly) for input of0
,1
,2
,4
(converting single-bit mask to a nucleotide) -1
's represent the impossible values, but still they should be as initializers.
So, the return type should really be char
as it is used later on in GetUniqueOutgoing
/ GetUniqueIncoming
.
I would probably use 0xFF
instead of -1
. Does this work for you on aarch64-linux? To make things explicit we can even do something like:
{ UINT8_C(0xFF), 0, 1, UINT8_C(0xFF), 2, UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF),
3, UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF), UINT8_C(0xFF) };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! That works too!
Let me update the PR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it but I have the feeling that more changes are needed at the call sites of GetUniqueOutgoing
/ GetUniqueIncoming
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callsites should be fine. The contract is that one should never call GetUniqueOutgoing
/ GetUniqueIncoming
if they could return 0xFF
.
`char` type is unsigned on aarch64, so negative values cannot be used
@@ -63,10 +63,10 @@ class InOutMask { | |||
return unique[mask]; | |||
} | |||
|
|||
static constexpr char GetUnique(uint8_t mask) { | |||
static constexpr char GetUnique(uint8_t mask) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static constexpr char GetUnique(uint8_t mask) { | |
static constexpr char GetUnique(uint8_t mask) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(extra whitespace here)
Well, it seems it fails build non systems with unsigned char type. Let me think a bit about better solution. |
How about using 127 instead of 255 ?
AFAIU any other value than the meaningful ones (1, 2, 3 and 4) should be OK
?!
β¦On Fri, 5 Apr 2024 at 9:13, Anton Korobeynikov ***@***.***> wrote:
Well, it seems it fails build non systems with unsigned char type. Let me
think a bit about better solution.
β
Reply to this email directly, view it on GitHub
<#1269 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABYUQWWQ5YBFUGK2H53BWDY3Y6KJAVCNFSM6AAAAABFXDKZOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMZZGAZDGNJSHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Yes, but let me think a bit more. Maybe we'd solve the problem the other way :) |
I pushed a fix in d28746b Will you please check on aarch64/linux? |
Confirmed that it works fine on Linux ARM64! Thank you! Do you have any ETA when |
Well... as soon as we will finish the documentation revamp. And finalize the release CI |
Just in case, SPAdes 4.0 was released: https://github.com/ablab/spades/releases/tag/v4.0.0 |
Thanks! |
Thanks! You may want to enable NCBI SRA input there. Also, it would make sense to update URL links as cab.spbu.ru is not working anymore |
Sure! What exactly do you suggest to do ? |
https://ablab.github.io/spades/installation.html#enabling-ncbi-sra-input-file-support |
char
is unsigned on aarch64Related to: #1062 (comment)
With this change I was able to fully build SPAdes on Linux ARM64:
If it does not cause regression for the supported platforms I'd be thankful if it is merged!