Closed
Description
I am having problems building libff with clang on macOS Sierra. GMP, Boost and OpenSSL are previously compiled in my setup, so here is the output of cmake and make commands. It’s all related to non-type template argument deduction it seems.
bash-3.2$ PKG_CONFIG_PATH=${BSPROOTFS}/lib/pkgconfig cmake -DCMAKE_INSTALL_PREFIX=${BSPROOTFS} -DCURVE=ALT_BN128 -DMULTICORE=OFF -DBINARY_OUTPUT=ON -DMONTGOMERY_OUTPUT=ON -DUSE_PT_COMPRESSION=OFF -DWITH_PROCPS=OFF OPTFLAGS="-O2" .
-- The C compiler identification is AppleClang 8.0.0.8000042
-- The CXX compiler identification is AppleClang 8.0.0.8000042
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PkgConfig: /Users/loki/Desktop/devel/zcash-apple/tools/o/bin/pkg-config (found version "0.29.1")
-- Checking for module 'libcrypto'
-- Found libcrypto, version 1.1.0e
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- program_options
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/loki/Desktop/devel/zcash-apple/libsnark/libff
getting errors from operator<<
bash-3.2$ make
Scanning dependencies of target ff
[ 4%] Building CXX object src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_g1.cpp.o
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/algebra/curves/alt_bn128/alt_bn128_g1.cpp:411:9: fatal error: invalid operands to binary expression
('std::ostream' (aka 'basic_ostream<char>') and 'alt_bn128_Fq' (aka 'Fp_model<alt_bn128_q_limbs, alt_bn128_modulus_q>'))
out << copy.X << OUTPUT_SEPARATOR << copy.Y;
~~~ ^ ~~~~~~
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/fields/fp.tcc:779:15: note: candidate template ignored: substitution failure [with n = 4]:
deduced non-type template argument does not have the same type as the its corresponding template parameter ('bigint<alt_bn128_q_limbs>' vs
'const bigint<4L> &')
std::ostream& operator<<(std::ostream &out, const Fp_model<n, modulus> &p)
^
1 error generated.
make[2]: *** [src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_g1.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/ff.dir/all] Error 2
make: *** [all] Error 2
and operator>>
bash-3.2$ make
Scanning dependencies of target ff
[ 4%] Building CXX object src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_g1.cpp.o
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/algebra/curves/alt_bn128/alt_bn128_g1.cpp:426:19: fatal error: invalid operands to binary expression
('basic_istream<char, std::__1::char_traits<char> >' and 'alt_bn128_Fq' (aka 'Fp_model<alt_bn128_q_limbs, alt_bn128_modulus_q>'))
in >> is_zero >> tX >> tY;
~~~~~~~~~~~~~ ^ ~~
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/fields/fp.tcc:793:15: note: candidate template ignored: substitution failure [with n = 4]:
deduced non-type template argument does not have the same type as the its corresponding template parameter ('bigint<alt_bn128_q_limbs>' vs
'const bigint<4L> &')
std::istream& operator>>(std::istream &in, Fp_model<n, modulus> &p)
^
1 error generated.
make[2]: *** [src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_g1.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/ff.dir/all] Error 2
make: *** [all] Error 2
And lastly from operator*
bash-3.2$ make
Scanning dependencies of target ff
[ 4%] Building CXX object src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_g2.cpp.o
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/algebra/curves/alt_bn128/alt_bn128_g2.cpp:440:5: warning: variable 'is_zero' is uninitialized when
used here [-Wuninitialized]
is_zero -= '0';
^~~~~~~
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/algebra/curves/alt_bn128/alt_bn128_g2.cpp:435:17: note: initialize the variable 'is_zero' to silence
this warning
char is_zero;
^
= '\0'
1 warning generated.
[ 8%] Building CXX object src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_init.cpp.o
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/algebra/curves/alt_bn128/alt_bn128_init.cpp:136:49: fatal error: invalid operands to binary expression
('alt_bn128_Fq' (aka 'Fp_model<alt_bn128_q_limbs, alt_bn128_modulus_q>') and 'libff::Fp2_model<4, &libff::alt_bn128_modulus_q>')
alt_bn128_twist_coeff_b = alt_bn128_coeff_b * alt_bn128_twist.inverse();
~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/fields/fp.hpp:103:14: note: candidate function not viable: no known conversion from
'libff::Fp2_model<4, &libff::alt_bn128_modulus_q>' to 'const libff::Fp_model<4, &libff::alt_bn128_modulus_q>' for 1st argument
Fp_model operator*(const Fp_model& other) const;
^
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/fields/fp2.tcc:66:23: note: candidate template ignored: substitution failure [with n = 4]:
deduced non-type template argument does not have the same type as the its corresponding template parameter ('bigint<alt_bn128_q_limbs>' vs
'const bigint<4L> &')
Fp2_model<n, modulus> operator*(const Fp_model<n, modulus> &lhs, const Fp2_model<n, modulus> &rhs)
^
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/curves/alt_bn128/alt_bn128_g1.hpp:81:14: note: candidate template ignored: substitution
failure [with m = 4]: deduced non-type template argument does not have the same type as the its corresponding template parameter
('bigint<alt_bn128_q_limbs>' vs 'const bigint<4L> &')
alt_bn128_G1 operator*(const Fp_model<m,modulus_p> &lhs, const alt_bn128_G1 &rhs)
^
/Users/loki/Desktop/devel/zcash-apple/libsnark/libff/src/./algebra/curves/alt_bn128/alt_bn128_g2.hpp:85:14: note: candidate template ignored: substitution
failure [with m = 4]: deduced non-type template argument does not have the same type as the its corresponding template parameter
('bigint<alt_bn128_q_limbs>' vs 'const bigint<4L> &')
alt_bn128_G2 operator*(const Fp_model<m,modulus_p> &lhs, const alt_bn128_G2 &rhs)
^
1 error generated.
make[2]: *** [src/CMakeFiles/ff.dir/algebra/curves/alt_bn128/alt_bn128_init.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/ff.dir/all] Error 2
make: *** [all] Error 2
Metadata
Metadata
Assignees
Labels
No labels