potatosalad / erlang-libdecaf

ed448goldilocks (libdecaf) NIF with timeslice reductions for Erlang and Elixir.
MIT License
29 stars 16 forks source link

problem compiling on macos #10

Closed xshadowlegendx closed 2 years ago

xshadowlegendx commented 4 years ago

versions: macOS: 10.15.7 elixir: 1.11.1 apple clang: 12.0.0 libdecaf: 1.0.0

# mix compile
...

src/p448/arch_x86_64/f_impl.c:18:27: error: expression does not compute the number of elements in this array; element type is 'uint64_t' (aka 'unsigned long long'), not 'uint64xn_t' (aka 'uint64x2_t') [-Werror,-Wsizeof-array-div]
    for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
                       ~~ ^
src/p448/arch_x86_64/f_impl.c:14:14: note: array 'aa' declared here
    uint64_t aa[4] VECTOR_ALIGNED, bb[4] VECTOR_ALIGNED, bbb[4] VECTOR_ALIGNED;
             ^
src/p448/arch_x86_64/f_impl.c:18:27: note: place parentheses around the 'sizeof(uint64xn_t)' expression to silence this warning
    for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
                          ^
src/p448/arch_x86_64/f_impl.c:193:27: error: expression does not compute the number of elements in this array; element type is 'uint64_t' (aka 'unsigned long long'), not 'uint64xn_t' (aka 'uint64x2_t') [-Werror,-Wsizeof-array-div]
    for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
                       ~~ ^
src/p448/arch_x86_64/f_impl.c:189:14: note: array 'aa' declared here
    uint64_t aa[4] VECTOR_ALIGNED;
             ^
src/p448/arch_x86_64/f_impl.c:193:27: note: place parentheses around the 'sizeof(uint64xn_t)' expression to silence this warning
    for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
                          ^
2 errors generated.
make[1]: *** [Makefile:248: build/obj/p448/f_impl.o] Error 1
make[1]: Leaving directory '<root-dir>/deps/libdecaf/c_deps/ed448goldilocks'
make: *** [Makefile:208: <root-dir>/deps/libdecaf/c_deps/ed448goldilocks/build/lib/libdecaf.so.1] Error 2
make: Leaving directory '<root-dir>/deps/libdecaf/c_src'

I deploy the app via docker so in production it compiles without any problem but it cause inconvenience in local development on my current macOS

potatosalad commented 2 years ago

This should be fixed as part of libdecaf version 2.0.0.