-
Couldn't load subscription status.
- Fork 340
Description
Expected Behavior
DiskANN should compile successfully without modification on a standard Linux environment.
Actual Behavior
Build fails when compiling ann_exception.cpp because uint32_t is not declared in include/ann_exception.h.
Example Code
git clone https://github.com/microsoft/DiskANN.git
cd DiskANN
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
Dataset Description
Not applicable here
Error
In file included from src/ann_exception.cpp:4:
include/ann_exception.h:22:65: error: ‘uint32_t’ has not been declared
22 | const std::string &fileName, uint32_t lineNum);
| ^~~~~~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [src/CMakeFiles/diskann.dir/build.make:93: src/CMakeFiles/diskann.dir/ann_exception.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:314: src/CMakeFiles/diskann.dir/all] Error 2
make: *** [Makefile:146: all] Error 2Your Environment
*Operating system: Ubuntu 22.04 (Pop!_OS derivative)
- Compiler: g++ 11.4
- CMake: 3.22
- DiskANN version: commit 1f08328
##Suggested Fix
Add the missing include at the top of include/ann_exception.h:
#include <string>
#include <cstdint> // add this lineOptionally update the function signature to use std::uint32_t for portability.
Additional Details
The root cause is that include/ann_exception.h uses uint32_t but does not include or <stdint.h>