cculianu / Fulcrum

A fast & nimble SPV Server for BCH, BTC, and LTC
Other
343 stars 77 forks source link

ZeroMQ: zmq.h file not found #125

Open SatoriHoshiAiko opened 2 years ago

SatoriHoshiAiko commented 2 years ago

Hi there,

I am noticing an issue when building for ZeroMQ. The build is searching for zmq.h with fatal error "file not found"

/Volumes/X11/Fulcrum/src/zmq/zmq.hpp:35: error: 'zmq.h' file not found In file included from ../Fulcrum/src/ZmqSubNotifier.cpp:26: ../Fulcrum/src/zmq/zmq.hpp:35:10: fatal error: 'zmq.h' file not found

include

     ^~~~~~~

Upon further investigation it would appear that Bitcoin-Core compiles (with ./configure ... --enable-zmq) using zeromq 4.3.4 with the following in /src/zmq/*

zmqabstractnotifier.h zmqnotificationinterface.h zmqpublishnotifier.h zmqrpc.h zmqutil.h zmqabstractnotifier.cpp zmqnotificationinterface.cpp zmqpublishnotifier.cpp zmqrpc.cpp zmqutil.cpp .dirstamp libbitcoin_zmq_a-zmqabstractnotifier.o libbitcoin_zmq_a-zmqnotificationinterface.o libbitcoin_zmq_a-zmqpublishnotifier.o libbitcoin_zmq_a-zmqrpc.o libbitcoin_zmq_a-zmqutil.o

And at first glance it would appear that Fulcrum is expecting zmq.h but is instead having to reference the above in ZeroMQ 4.3.4

This would apply to linux build, although I am on MacOS and both home-brew as well as source install have the same concerns.

Perhaps I am missing the intended target of zmq.h, or it is not up to date with bitcoin-core 23.99.0 which build zmq with more detailed identifiers.

As mentioned in the docs, this will run fine without zmq, but I would prefer it to be updated to do so, if only for cleanliness.

I built with QT Creator 5.15.2 attempting to pass Additional argument ENABLE_ZMQ

Please check this and update as needed/required.

cculianu commented 2 years ago

So you are on macOS, using homebrew, and it can't find ZMQ headers? Hmm... Let me see. How are you configuring the project? Is libzmq installed via brew? If so where are the headers? You can try adding QMAKE_CXX_FLAGS += -I/path/to/zmq to your qmake configure line, if you know what that means. I believe in Qt creator you can add that variable and add additional CXX flags that way. The CXX flag itself is that -I/path/to/zmq which maybe on homebrew (which I don't use, I use macports), would be -I/usr/local/Homebrew/zmq. But don't quote me on that. It's been about 7 years since I last used homebrew.