codam-coding-college/MLX42

[BUG] Error messages while compiling

42mgr opened this issue · 4 comments

42mgr commented

Error messages while compiling

Steps to reproduce the behavior:

  1. Running cmake -DBUILD_TESTS=ON -B build && cmake --build build --parallel
  2. Error at [ 68%] Linking C static library libmlx42.a

Error messages:

/MLX42/build/_deps/googletest-src/googletest/include/gtest/gtest-printers.h:532:9: error: implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision [-Wimplicit-int-float-conversion]
    if (static_cast<int32_t>(val * mulfor6 + 0.5) / mulfor6 == val) return 6;
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~
/MLX42/build/_deps/googletest-src/googletest/include/gtest/gtest-printers.h:551:17: error: in instantiation of function template specialization 'testing::internal::AppropriateResolution<float>' requested here
  os->precision(AppropriateResolution(f));
                ^
/MLX42/build/_deps/googletest-src/googletest/include/gtest/gtest-printers.h:544:9: error: implicit conversion from 'int32_t' (aka 'int') to 'float' may lose precision [-Wimplicit-int-float-conversion]
    if (static_cast<int32_t>(val / divfor6 + 0.5) * divfor6 == val) return 6;
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~

The errors stop the built process. I deactivated -Wall -Werror -Wextra and it built. The unit tests 'ctest --output-on-failure --test-dir build' were passed.

OS: Ubuntu 22.04.1 LTS

Thnx for reporting the issue. I don't have time to look today at the error with gtest, but tomorrow I can take a look if it's not already fixed at that point.

Hello @42mgr, im unable to reproduce the error. Do you run cmake directly in the mlx42 directory?
Can you provide the full output of cmake (remove the build directory before)

42mgr commented

I was on campus of 42 Berlin and now it seemed to have build without any issue.

Thanks for letting us know, good luck with your project 🤞