Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing libff (via libsnark) results in awkward header structure #16

Closed
copumpkin opened this issue Feb 3, 2018 · 1 comment
Closed
Assignees

Comments

@copumpkin
Copy link

For example, libsnark depends on libff, and using a header from libsnark gives me the following error:

In file included from /nix/store/glnz76ald47lz78al77wq98my1qn6dmi-libsnark-pre9e6b19ff/include/libsnark/common/default_types/r1cs_ppzksnark_pp.hpp:16:
In file included from /nix/store/glnz76ald47lz78al77wq98my1qn6dmi-libsnark-pre9e6b19ff/include/libff/common/default_types/ec_pp.hpp:28:
In file included from /nix/store/glnz76ald47lz78al77wq98my1qn6dmi-libsnark-pre9e6b19ff/include/libff/algebra/curves/bn128/bn128_pp.hpp:10:
/nix/store/glnz76ald47lz78al77wq98my1qn6dmi-libsnark-pre9e6b19ff/include/libff/algebra/curves/bn128/bn128_g1.hpp:12:10: fatal error: 'depends/ate-pairing/include/bn.h' file not found
#include "depends/ate-pairing/include/bn.h"
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

As far as I can tell, this is because the "public" header bn128_g1.hpp includes a header from the depends folder, which doesn't get installed with any of the standard scripts, so downstream packages can't use it easily without messing with their include directories.

@howardwu
Copy link
Member

howardwu commented Feb 26, 2018

You will need to fetch the dependencies:

git submodule init && git submodule update

This is the same from libsnark. All content from the libsnark/depends folder are installed as part of the parent's compilation process. The parent's dependency CMakeLists.txt calls into all child dependencies and compiles the requisite libraries natively. See https://github.com/scipr-lab/libsnark/blob/master/depends/CMakeLists.txt

@howardwu howardwu self-assigned this Feb 26, 2018
mobileink added a commit to minatools/libff that referenced this issue Jul 20, 2020
# This is the 1st commit message:

bazel support, initial commit

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#2:

gitignore .bazelrc, bazel-*

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#3:

remove sha256 from rule_foreign_cc rule

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#4:

rename target ff to libff

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#5:

put curves/mnt/mnt4, 6 in separate packages

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#6:

bn128: drop "depends" from include prefix, for bazel compatibility

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#7:

fix refs to targets mnt4, mnt6, libff

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#8:

fix refs to @ate_pairing//:libgmp

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#9:

change @// to //

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#10:

delete obsolete mnt4, mnt6 targets from curves/mnt/BUILD.bazel

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#11:

add target scalar_multiplication:multiexp_profile

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#12:

list headers explicitly

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#13:

dead code elim

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#14:

dead code elim

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#15:

BUILD files: explicitate srcs/hdrs, DCE, buildifier reformat

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#16:

change @ate_pairing//:zm to @ate_pairing//ate-pairing

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#17:

switch obazl repos from local to git

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#18:

pin xbyak, ate-pairing repos to versions, to match upstream

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#19:

delete git submodules, not needed with Bazel

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#20:

add sha256 for xbyak, ate-pairing external repos

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#21:

remove xbyak dep - it's included in ate-pairing

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>

# This is the commit message scipr-lab#22:

restore depends dirs

Signed-off-by: Gregg Reynolds <601396+mobileink@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants