paoloshasta / shasta

De novo assembly from Oxford Nanopore reads.
https://paoloshasta.github.io/shasta/
Other
66 stars 9 forks source link

src/*.hpp: fix build failures with gcc 13 #15

Closed emollier closed 12 months ago

emollier commented 12 months ago

As seen in Debian Bug#1042196, shasta is affected by multiple occurrences of uint*_t types not declared in the scope of their use when compiled with gcc 13, for instance:

In file included from /<<PKGBUILDDIR>>/src/AssembledSegment.hpp:5,
                 from /<<PKGBUILDDIR>>/src/AssembledSegment.cpp:2:
/<<PKGBUILDDIR>>/src/Base.hpp:35:18: error: ‘uint8_t’ was not declared in this scope
   35 |     static array<uint8_t, 256> table;
      |                  ^~~~~~~
/<<PKGBUILDDIR>>/src/Base.hpp:17:1: note: ‘uint8_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   16 | #include "string.hpp"
  +++ |+#include <cstdint>
   17 |

This patch implements a variant of the suggested fix, taking into account the existence of cstdint.hpp to check the cpu architecture (at the notable exception of src/dset64-gccAtomic.hpp, where this felt redundant).

paoloshasta commented 12 months ago

Thank you!

Is the gcc 13 build otherwise clean? I only try to keep Shasta building on the current Ubuntu LTS version (currently 22.04 with gcc 11), but it's great that you are porting to a newer gcc version.

emollier commented 12 months ago

Hi Paolo,

Today's upload to Debian sid has built through with gcc 13. You can get the build log from our buildd system1. From my point of view, the build is "clean". But if you meant also "clean" of warnings, I see a couple of them in the build log.

Have a nice day, :) -- Étienne Mollier @.***> Fingerprint: 8f91 b227 c7d6 f2b1 948c 8236 793c f67e 8f0d 11da Sent from /dev/pts/3, please excuse my verbosity. On air: Need - Circadian

paoloshasta commented 12 months ago

Good to know and we can live with the warnings for now. I will fix them or suppress them when I switch to gcc13, but that will be some time. With gcc11 I get no warnings.

Thank you again for your help.