herumi / mcl

a portable and fast pairing-based cryptography library
BSD 3-Clause "New" or "Revised" License
450 stars 151 forks source link

Current git version fails to compile #208

Closed guidovranken closed 1 week ago

guidovranken commented 1 week ago
git clone --depth 1 https://github.com/herumi/mcl.git
cd mcl/
make bint_header
mkdir build/
cd build/
cmake .. -DMCL_STATIC_LIB=on
make

Output:

make[2]: Circular msm_avx.o <- msm_avx.o dependency dropped.
[  6%] Generating msm_avx.o
/home/jhg/cf-bls/mcl/src/msm_avx.cpp: In instantiation of ‘void {anonymous}::toArray(Unit*, const mpz_class&) [with long unsigned int N = 8; int w = 52; Unit = long unsigned int; mpz_class = mcl::Vint]’:
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:158:12:   required from here
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:78:27: error: no matching function for call to ‘getArray(Unit [8], long unsigned int, const mpz_class&)’
   78 |         mcl::gmp::getArray(tmp, N, mx);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /home/jhg/cf-bls/mcl/include/mcl/op.hpp:9,
                 from /home/jhg/cf-bls/mcl/include/mcl/fp.hpp:30,
                 from /home/jhg/cf-bls/mcl/include/mcl/ec.hpp:10,
                 from /home/jhg/cf-bls/mcl/src/msm_avx.cpp:15:
/home/jhg/cf-bls/mcl/include/mcl/gmp_util.hpp:68:6: note: candidate: ‘template<class T> void mcl::gmp::getArray(bool*, T*, size_t, const mpz_class&)’
   68 | void getArray(bool *pb, T *buf, size_t maxSize, const mpz_class& x)
      |      ^~~~~~~~
/home/jhg/cf-bls/mcl/include/mcl/gmp_util.hpp:68:6: note:   template argument deduction/substitution failed:
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:78:27: note:   mismatched types ‘T*’ and ‘long unsigned int’
   78 |         mcl::gmp::getArray(tmp, N, mx);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
/home/jhg/cf-bls/mcl/src/msm_avx.cpp: In instantiation of ‘void {anonymous}::toArray(Unit*, const mpz_class&) [with long unsigned int N = 6; int w = 64; Unit = long unsigned int; mpz_class = mcl::Vint]’:
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:1495:16:   required from here
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:78:27: error: no matching function for call to ‘getArray(Unit [6], long unsigned int, const mpz_class&)’
/home/jhg/cf-bls/mcl/include/mcl/gmp_util.hpp:68:6: note: candidate: ‘template<class T> void mcl::gmp::getArray(bool*, T*, size_t, const mpz_class&)’
   68 | void getArray(bool *pb, T *buf, size_t maxSize, const mpz_class& x)
      |      ^~~~~~~~
/home/jhg/cf-bls/mcl/include/mcl/gmp_util.hpp:68:6: note:   template argument deduction/substitution failed:
/home/jhg/cf-bls/mcl/src/msm_avx.cpp:78:27: note:   mismatched types ‘T*’ and ‘long unsigned int’
   78 |         mcl::gmp::getArray(tmp, N, mx);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
make[2]: *** [CMakeFiles/msm_avx.o.dir/build.make:71: msm_avx.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:144: CMakeFiles/msm_avx.o.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
herumi commented 1 week ago

Thanks for reporting back. I fixed it and added that test to GitHub Actions.

guidovranken commented 1 week ago

Thank you!