pytorch / cpuinfo

CPU INFOrmation library (x86/x86-64/ARM/ARM64, Linux/Windows/Android/macOS/iOS)
BSD 2-Clause "Simplified" License
992 stars 311 forks source link

Arm build breaks when enabling -Werror #90

Closed sirakiin closed 2 years ago

sirakiin commented 2 years ago

To reproduce (w/ bazel):

Update WORKSPACE.bazel with

android_sdk_repository(
    name = "androidsdk",
    path = PATH_TO_SDK,
)

android_ndk_repository(
    name = "androidndk",
    path = PATH_TO_NDK,
)

Update .bazelrc

build:android --crosstool_top=//external:android/crosstool
build:android_arm64 --config=android
build:android_arm64 --cpu=arm64-v8a

And build:

bazel build --copt=-Wall --config=android_arm64 cpuinfo

Error msg:

src/arm/linux/chipset.c:331:11: error: implicitly declaring library function 'tolower' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
                int d = tolower((unsigned char)*a) - tolower((unsigned char)*b);
                        ^
src/arm/linux/chipset.c:331:11: note: include the header <ctype.h> or explicitly provide a declaration for 'tolower'
1 error generated.
Target //:cpuinfo failed to build