Followed the instructions to build a node for MacOS: GitHub - algorand/go-algorand: Algorand's official implementation in Go.
make install, it can’t find a c++ header:
sortition.cpp:2:10: fatal error: 'boost/math/distributions/binomial.hpp' file not found
make: *** [buildsrc] Error 2
Happens on current master and v3.2.1-stable.
MacBook Pro, Apple Silicon
I have heard about that issue before, and it’s unique to M1 Macs. The boost package for brew doesn’t add the symlink which is required for gcc to find the header.( unlike the x86 darwin package ).
Given that I don’t have a M1 machine, I won’t be able to provide step by step instruction, but the workaround would be to add the missing symlink.
Ideally, the brew package would get fixed, and the workaround wouldn’t be needed.
The suggested solution did not work for me.
brew had the right symlinks. Besides, I have had this exact error in both my older Intel-based Mac and my new M1 Mac. Thus, I don’t this that this is specific to M1 Macs.
It tuned out that the problem was that the underlying
gcc needed to be made aware of where all the header files are located. So adding this snippet to the Makefile of the
go-algorand did the trick:
export CPLUS_INCLUDE_PATH := $(shell brew --prefix)/include
This sets up an environment variable that
gcc uses to look up header files. I hope this helps.
with mac m1, my the “shell” is not working (it came with zsh)
so I just ran this in my terminal and this problem is solved.
export CPLUS_INCLUDE_PATH="$(brew --prefix)/include"
The error of
#include "sodium.h" was solved by this post Getting error while building node from source