Closed drewstone closed 6 years ago
Looks good. I will test on my Mac.
I use nvm
on Linux to manage node versions, the nvm-install
script will install the most recent LTS version of Node and NPM.
It would be good to be able to use either npm
or yarn
, depending on what's available.
re:
LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:"${LD_LIBRARY_PATH}"
CPATH=/usr/local/opt/openssl/include:"${CPATH}"
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:"${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH
I think these rely on brew
aren't available on Mac as standard.
There are Makefile targets, fedora-dependencies:
and ubuntu-dependencies:
to install the necessary dependencies for Fedora and Ubuntu. What would be necessary for Mac?
Gotcha, yea I think nvm wasn't causing issues for me in that case. As for dependencies for mac, I guess we only need openssl crypto libraries, which I have gotten from brew.
Ooh, Travis-CI supports OSX: https://docs.travis-ci.com/user/reference/osx
Building on multiple platform: https://docs.travis-ci.com/user/multi-os/
I have an initial build with Travis-CI on OSX: https://travis-ci.org/HarryR/ethsnarks/jobs/419645264
One of the tests fail, and I broke the Linux build on Travis at the same time, but it's a good start.
Might need to take this into account for OSX? - https://bitbucket.org/gallen/libvariant/pull-requests/2/resolves-cmake-warning-pertaining-to-rpath/diff
I've fixed the multi-OS travis build for Linux, and OSX is building but failing on one of the tests.
See: https://travis-ci.org/HarryR/ethsnarks/builds/419717071
./bin/test_sha256_full_gadget
full_output_bytes mismatch
FAIL
I can't reproduce that test failure with Clang on Linux.
The fix
I don't have a good grasp on making Makefiles so versatile, but wanted to document the issues I faced compiling/building this repo on a MacBook 13" Mid-2014 with MacOS High Sierra version 10.13.6 and how I resolved them to build and compile the contracts according to an updated
MakeFile
.Dependences:
Yarn - Make sure you have yarn installed as this will be the node package manager used.
I ran into issues initially compiling libsnark, which has seen similar issues on their board. The solution that I found was to include the following in my
~/.bash_profile
and use the makefile located in https://github.com/drewstone/ethsnarks with Node 10.9.0 (I usen
for nodejs management.Hopefully this helps someone running on Mac in the future.
For clarity, the entirety of the makefile is below: