Skip to content

Install error: missing include for uint32_t in current GCC versions#190

Description

@samburger

Hi maintainers,

I am trying to install krakenuniq in a container using the included Dockerfile.
During the build process, g++ fails with this error:

$ docker build . 
...
> [5/5] RUN ./install_krakenuniq.sh /usr/local/bin:
0.098 make -C ./src clean install
0.098 make: Entering directory '/app/src'
0.113 Compiling with multithreading support: yes
0.114 rm -rf classify classifyExact db_sort set_lcas db_shrink build_taxdb read_uid_mapping count_unique dump_taxdb query_taxdb grade_classification test_hll_on_db dump_db_kmers *.o *.dSYM *.gch
0.115 g++ -Wall -Wextra -Wfatal-errors -pipe -O2 -std=c++11 -fopenmp -I./gzstream -D NDEBUG   -c krakendb.cpp
0.432 g++ -Wall -Wextra -Wfatal-errors -pipe -O2 -std=c++11 -fopenmp -I./gzstream -D NDEBUG   -c quickfile.cpp
0.604 g++ -Wall -Wextra -Wfatal-errors -pipe -O2 -std=c++11 -fopenmp -I./gzstream -D NDEBUG   -c krakenutil.cpp
0.934 g++ -Wall -Wextra -Wfatal-errors -pipe -O2 -std=c++11 -fopenmp -I./gzstream -D NDEBUG   -c seqreader.cpp
1.378 g++ -Wall -Wextra -Wfatal-errors -pipe -O2 -std=c++11 -fopenmp -I./gzstream -D NDEBUG   -c uid_mapping.cpp
1.505 In file included from uid_mapping.cpp:22:
1.505 uid_mapping.hpp:42:21: error: 'uint32_t' was not declared in this scope
1.505    42 | typedef std::vector<uint32_t> TaxidSet;
1.505       |                     ^~~~~~~~
1.505 compilation terminated due to -Wfatal-errors.

This appears to be an issue caused by newer gcc versions being more strict with imports.
If I force an older (GCC 7) version, the app builds OK.

# Use Ubuntu 18.04 which comes with GCC 7.4
FROM ubuntu:18.04

# Install build dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    wget \
    zlib1g-dev \
    perl \
    libbz2-dev \
    && rm -rf /var/lib/apt/lists/*

RUN echo gcc --version

WORKDIR /app
COPY . . 
RUN ./install_krakenuniq.sh /usr/local/bin

CMD ["bash"]

I suggest the Dockerfile and documentation be updated to specify which gcc version should be used to build krakenuniq. Alternatively uid_mapping.hpp could be updated to include <cstdint>? Happy to send a PR if maintainers agree on a fix.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions