Zcashd 2.0.1 on Gentoo


This is not the request for support but rather description of problems and solutions for building zcashd on Gentoo LInux distribution. I hope someone might find it useful and easier to find here, as I had to do some digging before solving these.

First of all, boost will not build out of the box on Gentoo, after git cloning zcashd repo apply the following changes:

diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk
index caf726132..4bd615171 100644
--- a/depends/packages/boost.mk
+++ b/depends/packages/boost.mk
@@ -33,9 +33,9 @@ define $(package)_config_cmds
 define $(package)_build_cmds
-  ./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
+  ./b2 --ignore-site-config -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) stage
 define $(package)_stage_cmds
-  ./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install
+  ./b2 --ignore-site-config -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) install

Second thing is related to upgrade to 2.0.1. long long has been migrated to int64_t and if you do not make sure old build files are completely removed you will get reference errors like:

zcash/src/./snark/libsnark/gadgetlib1/gadgets/basic_gadgets.tcc:69: undefined reference to `libsnark::div_ceil(long, long)'

/zcash/src/./snark/libsnark/gadgetlib1/gadgets/basic_gadgets.tcc:157: undefined reference to `libsnark::div_ceil(long, long)'

zcash/src/./zcash/circuit/gadget.tcc:331: undefined reference to `libsnark::div_ceil(long, long)' 

Therefore before runing ./zcutil/build.sh make sure you do:

git branch -vv
 (HEAD detached at v2.0.1) e8f5e592b Auto merge of #3602 - bitcartel:release-v2.0.1, r=ebfull
  master                    02dd675a2 [origin/master: behind 1315] Auto merge of #2585 - str4d:release-v1.0.11, r=str4d

git reset --hard e8f5e592b
git clean -fdx

This will clear all your previous build files. Now just remember to patch boost.mk and it should build fine.



I had some similar issues on ubuntu as well. Thanks for posting this

Looks like this is on the backlog of the dev infrastructure team: https://github.com/zcash/zcash/issues/755