From 2fd193217b85052be29c5a0c627f61e05ea2d06b Mon Sep 17 00:00:00 2001 From: 4rgorok Date: Mon, 25 Jul 2022 12:11:22 +0200 Subject: [PATCH] Add support for 32-bit builds. --- README.md | 2 ++ src/starkware/algebra/big_int.h | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 8d916ca..b6e5a72 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,5 @@ This repo requires the installation of the Golang compiler on the system in orde presubmit script and the provided Go FFI and test. To install Go under Ubuntu, run the following: ``sudo apt install golang-go`` + +For 32-bit builds to work, boost library is required. \ No newline at end of file diff --git a/src/starkware/algebra/big_int.h b/src/starkware/algebra/big_int.h index ec2ad62..5e47f6c 100644 --- a/src/starkware/algebra/big_int.h +++ b/src/starkware/algebra/big_int.h @@ -13,6 +13,14 @@ #include "starkware/utils/error_handling.h" #include "starkware/utils/prng.h" +/* + Support for 32-bit builds, where __uint128_t isn't defined. +*/ +#ifndef __SIZEOF_INT128__ + #include + typedef boost::multiprecision::uint128_t __uint128_t; +#endif + namespace starkware { static constexpr inline __uint128_t Umul128(uint64_t x, uint64_t y) {