Open JustinDrake opened 6 years ago
I doubt Mac works without some significant configuration. Do you have access to an Ubuntu VM? I know that at least with libsnark it was not possible on Mac but straightforward on Linux.
It will probably take changes similar to what was needed for my port of libsnark to Mac, mostly memory model related stuff
It seems the issue is with open-MP over CLang, and maybe the following thread solves the problem: https://stackoverflow.com/questions/39979836/using-openmp-with-c11-on-mac-os](StackOverflow). I've just pushed a version with flags.mk
file, where you could change the line CC=g++
to CC=/usr/local/bin/g++-6
(if using the solution from that thread, or something similar).
Will be happy to hear if that works (unfortunately, I don't currently have a mac to test that).
I got a repo that I use to build standalone GNU tools for macOS (mainly for Zcash compilation): https://github.com/kozyilmaz/tools
and here are the precompiled binaries. You can use it by adding the installation path to $PATH https://github.com/kozyilmaz/tools/releases
This is an alternative for brew in any case, only a small patch is needed to make it compile (see below, it is a diff please remove .txt at the end of file name) libstark-macos.patch.txt
I can create a PR if you guys interested (except flags.mk change of course)
Does the solution @kozyilmaz suggests work for all of you? Does it require any package installation on Mac (standard? nonstandard?), or just applying the diff is sufficient?
I was able to get things compiling and running with clang (Apple LLVM version 9.1.0 (clang-902.0.39.2)
) using libomp
from brew (as described in https://github.com/elibensasson/libSTARK/issues/2#issuecomment-370237565).
The patch from @kozyilmaz https://github.com/elibensasson/libSTARK/issues/2#issuecomment-370252608 was also needed, and it looks like prover.cpp
gained an additional sysinfo()
call which I had to ifdef out like the others.
Full diff: https://gist.github.com/ghazel/142c96e3e713d1c8dee4b12625ba6586
@ghazel can you please create a pull request with your patch? I also work on mac and cannot compile libSTARK here.
Full diff: https://gist.github.com/ghazel/142c96e3e713d1c8dee4b12625ba6586
from @ghazel was really helpful. Codes got compiled and run with clang(Apple LLVM version 10.0.0 (clang-1000.10.44.2)
) just using gcc@7
and libomp
from brew
.
Guys, if this problem is still has an interest, I have opened the pull request to solve it, please help to review:
Awesome to have initial code! This is what I get from running
make -j8
on a Mac