- CMake >3.13
- GCC >9
- Install dependencies by running
./deps.sh. This will not guarantee CMake and GCC versions so check them yourself. - Run
preinstall.sh - Install JS dependencies
npm ci
If you're on Mac, and have OpenSSL installed from brew, you may need to set OPENSSL_ROOT_DIR if any of the build commands fail to find <openssl/ec.h> for example.
export OPENSSL_ROOT_DIR=$(brew --prefix openssl)or if your OpenSSL is not linked
export OPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1)- Run
make client. The package is ready to be used - (Optional) Run tests
npm run testto test the binding. Run the server test as well.
- Run
make server. - (Optional) Run test by
go test.
If you encounter errors like symbol is undefined while running tests or building the server part,
try adding CGO_LDFLAGS="-lcrypto -lssl -ldl -lpthread -laesmpc" before the go build/go test command.
On Mac M1 you may need to provide some extra environment variables - GOARCH=arm64 CGO_ENABLED=1 CGO_LDFLAGS="-lcrypto -lssl -ldl -lpthread -laesmpc" go build/test.
If Go cannot find crypto or ssl libraries on Mac, try adding -L$(brew --prefix openssl)/lib to CGO_LDFLAGS string. It may also be that OpenSSL is not linked,
then you may want to specify OpenSSL version like brew --prefix openssl@1.1.
- Run
swig -go -intgosize 64 -cgo -c++ aesmpc.i - Add
// #cgo LDFLAGS: -L. -Lemp-tool/build -lcrypto -lssl -laesmpc -ldl -lpthreadright beforeimport "C"line inaesmpc.go