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

Issue with compiling ate-pairing dependency #104

Open
AHaliq opened this issue Jul 21, 2021 · 4 comments
Open

Issue with compiling ate-pairing dependency #104

AHaliq opened this issue Jul 21, 2021 · 4 comments

Comments

@AHaliq
Copy link

AHaliq commented Jul 21, 2021

My machine:

ProductName:	Mac OS X
ProductVersion:	10.14.6
BuildVersion:	18G9027

I'm compiling libff with emscripten targetting webassembly and I'm getting the following error upon running make

zm2.cpp:3644:22: fatal error: use of undeclared identifier 'Xbyak'
                static std::vector<Xbyak::uint8> buf;

Inspecting zm2.cpp, we can see this only happens if MIE_USE_X64ASM is set to false

you can view my full project here to reproduce the issue: https://github.com/AHaliq/WebAssemblyReact
emscripten call starts at scripts/cryptoutils.sh line 49
cryptoutils adds libff at deps/cryptoutils/src/CMakeLists.txt line 14

@AHaliq
Copy link
Author

AHaliq commented Aug 10, 2021

I've made some progress investigating this issue,

in zm2.cpp line 8, Xbyak is only included if MIE_USE_X64ASM is set
in zm.h line 68, MIE_USE_X64ASM is unset when __x86_64__ is unset

In emscripten's faq site it says

Emscripten automatically unsets the following #define values, as these are commonly set in projects to enable platform dependent code (inline assembly):
#undef __i386__
#undef __x86_64__

in zm.h since there is a case for without __x86_64__ does that mean there is an alternative ways to build the project or is that case unhandled and cannot build the project?

@malturki
Copy link

malturki commented Feb 1, 2022

I'm having the same problem. My machine:

macOS Monterey -- version 12.1 (21C52)
Apple M1 Max

@AHaliq Have you managed to figure out a solution to this? Are you using an Apple Silicon machine?

@AHaliq
Copy link
Author

AHaliq commented Feb 1, 2022

@malturki libff uses ate-pairing and xbyak which contains inline assembly thus cant be compiled by emscripten. You should look for alternatives or fork this project and use other dependencies such as mcl

I havent tried it myself. The project i was working on has been handed over to someone else.

@malturki
Copy link

malturki commented Feb 1, 2022

Thanks @AHaliq for the prompt response. I will probably look into alternatives.

It would have been helpful to have a list of supported (or unsupported) architectures given up front in the README.

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