Skip to content

Update StopWatch.hpp #286

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

daniel-dona
Copy link

When installing rdflib-hdt on Ubuntu 24.04 the HDT library build seems to fail with a missing header for the uint64_t datatype.

42.33       x86_64-linux-gnu-g++ -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O2 -Wall -fPIC -I/tmp/pip-build-env-q125cbg6/overlay/local/lib/python3.12/dist-packages/pybind11/include -I/tmp/pip-build-env-q125cbg6/overlay/local/lib/python3.12/dist-packages/pybind11/include -Iinclude/ -Ihdt-cpp-1.3.3/libhdt/include/ -Ihdt-cpp-1.3.3/libhdt/src/dictionary/ -Ihdt-cpp-1.3.3/libhdt/src/sparql/ -Ihdt-cpp-1.3.3/libcds/include/ -Ihdt-cpp-1.3.3/libcds/src/static/bitsequence -Ihdt-cpp-1.3.3/libcds/src/static/coders -Ihdt-cpp-1.3.3/libcds/src/static/mapper -Ihdt-cpp-1.3.3/libcds/src/static/permutation -Ihdt-cpp-1.3.3/libcds/src/static/sequence -Ihdt-cpp-1.3.3/libcds/src/utils -I/usr/include/python3.12 -c hdt-cpp-1.3.3/libhdt/src/util/StopWatch.cpp -o build/temp.linux-x86_64-cpython-312/hdt-cpp-1.3.3/libhdt/src/util/StopWatch.o -std=c++11
42.33       hdt-cpp-1.3.3/libhdt/src/util/StopWatch.cpp: In static member function ‘static std::string StopWatch::toHuman(long long unsigned int)’:
42.33       hdt-cpp-1.3.3/libhdt/src/util/StopWatch.cpp:166:5: error: ‘uint64_t’ was not declared in this scope
42.33         166 |     uint64_t tot_secs = time/1000000;
42.33             |     ^~~~~~~~
42.33       hdt-cpp-1.3.3/libhdt/src/util/StopWatch.cpp:36:1: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
42.33          35 | #include "StopWatch.hpp"
42.33         +++ |+#include <cstdint>
42.33          36 |
42.33       hdt-cpp-1.3.3/libhdt/src/util/StopWatch.cpp:168:30: error: ‘tot_secs’ was not declared in this scope
42.33         168 |         unsigned int hours = tot_secs/3600;
42.33             |                              ^~~~~~~~
42.33       error: command '/usr/bin/x86_64-linux-gnu-g++' failed with exit code 1
42.33       [end of output]
42.33   
42.33   note: This error originates from a subprocess, and is likely not a problem with pip.
42.33   ERROR: Failed building wheel for rdflib-hdt
42.33 Failed to build rdflib-hdt
42.33 ERROR: Could not build wheels for rdflib-hdt, which is required to install pyproject.toml-based projects

This error can be reproduced building the following docker container:

FROM ubuntu:24.04

RUN apt update; apt upgrade -y;
RUN apt install python3 python3-pip -y;

RUN python3 -m pip install rdflib-hdt --break-system-packages

This does not happen on Ubuntu 22.04 that ships with GCC 11, and it seems to be related to changes on GCC 13 (default on Ubuntu 24.04: https://packages.ubuntu.com/noble/gcc ).

From https://gcc.gnu.org/gcc-13/porting_to.html:

Some C++ Standard Library headers have been changed to no longer include other headers that were being used internally by the library. As such, C++ programs that used standard library components without including the right headers will no longer compile.

It could be fixed just including the missing #include <cstdint> header on StopWatch.hpp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant