disclaimer: I don't really know what I am doing - this is probably not the best way to go.
Based on: https://github.com/dapphub/dapptools/tree/master/src/hevm#building-with-stack-or-cabal
following: https://www.haskell.org/ghcup/
install ghc 8.10.7 and cabal via:
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
git clone https://github.com/GaloisInc/libBF-hs.git
cd libBF-hs
cabal install --lib
The output should include a line like
Wrote tarball sdist to /path/to/libBF-hs/dist-newstyle/sdist/libBF-0.6.3.tar.gz
note the /path/to/libBF-hs/dist-newstyle/sdist/
modify ~/.cabal/config
, add at the bottom:
repository my-local-repository
url: file+noindex:///path/to/libBF-hs/dist-newstyle/sdist/
where you replace /path/to/libBF-hs/dist-newstyle/sdist/
with the actual path from the previous step
secp256k1
git clone https://github.com/bitcoin-core/secp256k1.git
cd secp256k1
./autogen.sh
./configure --enable-module-recovery # for generating secp256k1_recovery.h
make
sudo make install
homebrew (skip if already installed)
following: https://docs.brew.sh/Installation
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
libff
brew install boost cmake gmp libsodium
git clone https://github.com/scipr-lab/libff --recursive
cd libff
mkdir build && cd build
cmake .. -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURVE=ALT_BN128 -DUSE_ASM=OFF
make
sudo make install
brew install llvm
export PATH="$(brew --prefix llvm)/bin:$PATH"
git clone https://github.com/dapphub/dapptools.git
modify dapptools/src/hevm/ethjet/ethjet-ff.cc
:
replace line 6 #include <libff/algebra/fields/bigint.hpp>
with #include <libff/algebra/field_utils/bigint.hpp>
cd dapptools/src/hevm
cabal v2-update && cabal v2-configure
cabal v2-install
modify dapptools/src/hevm/hevm.cabal
in library
section, add:
include-dirs:
/path/to/gmp/include
where /path/to/gmp
is the output of echo $(brew --prefix gmp)
(don't forget the /include
)
If you're like me and trying to install this from scratch,
ghcup
will likely install the higher version ofghc
, resulting in conflicting dependencies. To use the correctghc
:ghcup install ghc 8.10.7
ghcup set ghc 8.10.7
right after the initial curl.