bitcoin / bitcoin

Bitcoin Core integration/staging tree

Home Page:https://bitcoincore.org/en/download

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'event2/buffer.h' file not found

andrzejsemeniuk opened this issue · comments

What behavior did you expect?

Building BitcoinCore on MacOS BigSur 11.6 Mac Mini M1 2020

What was the actual behavior (provide screenshots if the issue is GUI-related)?

% make HOST=arm-apple-darwin20

fails:

....
CXX test/fuzz/fuzz-http_request.o
test/fuzz/http_request.cpp:12:10: fatal error: 'event2/buffer.h' file not found
#include <event2/buffer.h>
^~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [test/fuzz/fuzz-http_request.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

How reliably can you reproduce the issue, what are the steps to do so?

% cd depends/
% make
% cd -
% ./autogen.sh
% export BOOST_ROOT=/opt/homebrew/opt/boost
% ./configure --prefix=$PWD/depends/arm-apple-darwin20.2.0 --with-boost=$BOOST_ROOT
% make HOST=arm-apple-darwin20

What version of Bitcoin Core are you using, where did you get it (website, self-compiled, etc)?

Did a git pull today Nov 20, 2021

What type of machine are you observing the error on (OS/CPU and disk type)?

MacOS BigSur 11.6 Mac Mini M1 2020

GUI-related issue? What is your operating system and its version? If Linux, what is your desktop environment and graphical shell?

Not a GUI related issue.

export BOOST_ROOT=/opt/homebrew/opt/boost

Why?

Otherwise there's an error during configure about boost version, even after I explicitly do brew install boost

Incidentally my previous install in June 2021 built and worked fine; this is my first pull since that time, so this must be a recent issue.

Otherwise there's an error during configure about boost version, even after I explicitly do brew install boost

You should either build against the system boost package (provided by Homebrew), or against boost form depends.

Otherwise there's an error during configure about boost version, even after I explicitly do brew install boost

You should either build against the system boost package (provided by Homebrew), or against boost form depends.

You think this issue is related to the boost version I am using? I think the configure command should figure this out without my intervention, it was complaining about not seeing at least a 1.64.0 version, and if I don't specify the boost root explicitly I get this:

checking for boostlib >= 1.64.0 (106400)... configure: We could not detect the boost libraries (version 1.64.0 or higher). If you have a staged boost library (still not installed) please specify $BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.
configure: error: Boost is not available!

BTW the boost version installed in homebrew I am using is 1.76.0

On my Mac mini (M1, 2020) + macOS Monterey 12.0.1:

% git rev-parse HEAD
80ae64db6b27d69b0fe7b6583066b1141f7a2f51

Building with system packages:

% brew info boost | head -1    
boost: stable 1.76.0 (bottled), HEAD
% ./autogen.sh
% ./configure --enable-suppress-external-warnings
% make clean > /dev/null
% make -j 9

Building with depends:

% make -j 9 -C depends NO_QT=1
% ./autogen.sh
% CONFIG_SITE=$PWD/depends/aarch64-apple-darwin21.1.0/share/config.site ./configure
% make clean > /dev/null
% make -j 9

Looks like --prefix=$PWD/depends/arm-apple-darwin20.2.0 should be --prefix=$PWD/depends/aarch64-apple-darwin20.2.0

% ./autogen.sh
% ./configure --enable-suppress-external-warnings

fails for me with the boost version issue like before.

Are you sure your environment does not contain the exported BOOST_ROOT variable?

Yes, it is unset, doing % env | grep BOOST yields nothing.

I just tried the 2nd method and get the same result with ./configure

I did this ./configure --prefix=$PWD/depends/aarch64-apple-darwin20.6.0 and this command succeeds without boost errors. Then doing make HOST=arm-apple-darwin20 succeeds. Doing just make -j 9 works as well. Not sure if I need to include HOST=arm-apple-darwin20 anymore.

Not sure if I need to include HOST=arm-apple-darwin20 anymore.

Yes, it is wrong host name. Anyway, when building depends for the same machine you can just skip HOST altogether.

Can this be closed now?

Yes. No bug, my mistake in building using --prefix=--prefix=$PWD/depends/arm-apple-darwin20.2.0

@hebasto Thank you very much for your help.

Here is the sequence of steps I used now that works:

% cd depends/
% make
% cd -
% ./autogen.sh
% ./configure --prefix=$PWD/depends/aarch64-apple-darwin20.6.0
% make
% make check
% make deploy