Skip to content

Can not compile with clang 3.8.1 on Arch Linux  #54

Open
@ashnur

Description

@ashnur
→ CXX=clang make all CURVE=BN128 LOWMEM=1 DEBUG=1
clang -o src/gadgetlib2/examples/tutorial.o   src/gadgetlib2/examples/tutorial.cpp -c -MMD -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wno-comment -Wfatal-errors -O2 -march=native -mtune=native -DUSE_ASM -DMONTGOMERY_OUTPUT -DCURVE_BN128  -Idepinst/include -Isrc -DBN_SUPPORT_SNARK -DLOWMEM -fPIC -DDEBUG -ggdb3
In file included from src/gadgetlib2/examples/tutorial.cpp:17:
In file included from src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.hpp:33:
In file included from src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.tcc:18:
In file included from src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp:468:
src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.tcc:375:32: fatal error: invalid operands to binary expression
      ('const Fr<libsnark::bn128_pp>' (aka 'const libsnark::Fp_model<4, &libsnark::bn128_modulus_r>') and 'libsnark::bn128_G2')
    G2<ppT> alphaA_g2 = alphaA * G2<ppT>::one();
                        ~~~~~~ ^ ~~~~~~~~~~~~~~
src/zk_proof_systems/ppzksnark/r1cs_ppzksnark/examples/run_r1cs_ppzksnark.tcc:70:43: note: in instantiation of function template specialization
      'libsnark::r1cs_ppzksnark_generator<libsnark::bn128_pp>' requested here
    r1cs_ppzksnark_keypair<ppT> keypair = r1cs_ppzksnark_generator<ppT>(example.constraint_system);
                                          ^
src/gadgetlib2/examples/tutorial.cpp:496:32: note: in instantiation of function template specialization 'libsnark::run_r1cs_ppzksnark<libsnark::bn128_pp>'
      requested here
    const bool bit = libsnark::run_r1cs_ppzksnark<libsnark::default_ec_pp>(example, test_serialization);
                               ^
src/algebra/fields/fp.hpp:103:14: note: candidate function not viable: no known conversion from 'libsnark::bn128_G2' to 'const libsnark::Fp_model<4,
      &libsnark::bn128_modulus_r>' for 1st argument
    Fp_model operator*(const Fp_model& other) const;
             ^
src/algebra/curves/bn128/bn128_g1.hpp:74:10: note: candidate template ignored: could not match 'bigint' against 'Fp_model'
bn128_G1 operator*(const bigint<m> &lhs, const bn128_G1 &rhs)
         ^
src/algebra/curves/bn128/bn128_g1.hpp:80:10: 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<bn128_r_limbs>' vs 'const bigint<4L> &')
bn128_G1 operator*(const Fp_model<m,modulus_p> &lhs, const bn128_G1 &rhs)
         ^
src/algebra/curves/bn128/bn128_g2.hpp:75:10: note: candidate template ignored: could not match 'bigint' against 'Fp_model'
bn128_G2 operator*(const bigint<m> &lhs, const bn128_G2 &rhs)
         ^
src/algebra/curves/bn128/bn128_g2.hpp:81:10: 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<bn128_r_limbs>' vs 'const bigint<4L> &')
bn128_G2 operator*(const Fp_model<m, modulus_p> &lhs, const bn128_G2 &rhs)
         ^
src/relations/variable.tcc:69:21: note: candidate template ignored: could not match 'variable<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_term<FieldT> operator*(const integer_coeff_t int_coeff, const variable<FieldT> &var)
                    ^
src/relations/variable.tcc:75:21: note: candidate template ignored: could not match 'variable<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_term<FieldT> operator*(const FieldT &field_coeff, const variable<FieldT> &var)
                    ^
src/relations/variable.tcc:184:21: note: candidate template ignored: could not match 'linear_term<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_term<FieldT> operator*(const integer_coeff_t int_coeff, const linear_term<FieldT> &lt)
                    ^
src/relations/variable.tcc:190:21: note: candidate template ignored: could not match 'linear_term<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_term<FieldT> operator*(const FieldT &field_coeff, const linear_term<FieldT> &lt)
                    ^
src/relations/variable.tcc:449:28: note: candidate template ignored: could not match 'linear_combination<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_combination<FieldT> operator*(const integer_coeff_t int_coeff, const linear_combination<FieldT> &lc)
                           ^
src/relations/variable.tcc:455:28: note: candidate template ignored: could not match 'linear_combination<type-parameter-0-0>' against 'libsnark::bn128_G2'
linear_combination<FieldT> operator*(const FieldT &field_coeff, const linear_combination<FieldT> &lc)
                           ^
src/algebra/knowledge_commitment/knowledge_commitment.tcc:66:29: note: candidate template ignored: could not match 'bigint' against 'Fp_model'
knowledge_commitment<T1,T2> operator*(const bigint<m> &lhs, const knowledge_commitment<T1,T2> &rhs)
                            ^
src/algebra/knowledge_commitment/knowledge_commitment.tcc:73:29: note: candidate template ignored: could not match
      'knowledge_commitment<type-parameter-0-0, type-parameter-0-1>' against 'libsnark::bn128_G2'
knowledge_commitment<T1,T2> operator*(const Fp_model<m, modulus_p> &lhs, const knowledge_commitment<T1,T2> &rhs)
                            ^
1 error generated.
make: *** [Makefile:226: src/gadgetlib2/examples/tutorial.o] Error 1
→ clang++ --version
clang version 3.8.1 (tags/RELEASE_381/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Same command works with g++ without issues and compiles everything.

g++ (GCC) version: 6.1.1
system: Linux 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016 x86_64 GNU/Linux

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions