Wednesday, December 25, 2024

bitcoind – Bitcoin fails to compile with Enhance

I simply had this drawback occur… On Mac OS 12.4, I put in increase with homebrew, and it was put in to /decide/homebrew/Cellar/increase/1.82.0_1

Once I ran ./configure I obtained:

checking whether or not the Enhance::System library is obtainable... no
checking whether or not the Enhance::Filesystem library is obtainable... no
checking whether or not the Enhance::Program_Options library is obtainable... no
checking whether or not the Enhance::Thread library is obtainable... no
checking whether or not the Enhance::Chrono library is obtainable... no
checking whether or not the Enhance::Unit_Test_Framework library is obtainable... no
checking for dynamic linked increase check... no
checking for mismatched increase c++11 scoped enums... okay
configure: error: No working increase sleep implementation discovered.

So I added the with-boost flag with that path: ./configure --with-boost=/decide/homebrew/Cellar/increase/1.82.0_1

After which it labored. However operating make failed for varied causes corresponding to lacking import statements, std::placeholder conflicting with increase::placeholder and different causes… So I needed to make the next modifications:

diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index e1763c6ad..66390c4e3 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -16,6 +16,7 @@
 #embrace <stdlib.h>
 #embrace <string.h>
 
+#embrace <deque>
 #embrace <sys/varieties.h>
 #embrace <sys/stat.h>
 #embrace <sign.h>
diff --git a/src/miner.h b/src/miner.h
index 3ba92b16b..993bde682 100644
--- a/src/miner.h
+++ b/src/miner.h
@@ -73,7 +73,7 @@ struct modifiedentry_iter {
 // besides working on CTxMemPoolModifiedEntry.
 // TODO: refactor to keep away from duplication of this logic.
 struct CompareModifiedEntry {
-    bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b)
+    bool operator()(const CTxMemPoolModifiedEntry &a, const CTxMemPoolModifiedEntry &b) const
     {
         double f1 = (double)a.nModFeesWithAncestors * b.nSizeWithAncestors;
         double f2 = (double)b.nModFeesWithAncestors * a.nSizeWithAncestors;
@@ -88,7 +88,7 @@ struct CompareModifiedEntry {
 // That is enough to type an ancestor package deal in an order that's legitimate
 // to seem in a block.
 struct CompareTxIterByAncestorCount {
-    bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b)
+    bool operator()(const CTxMemPool::txiter &a, const CTxMemPool::txiter &b) const
     {
         if (a->GetCountWithAncestors() != b->GetCountWithAncestors())
             return a->GetCountWithAncestors() < b->GetCountWithAncestors();
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 3ec1a1c27..54a6c5f36 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -31,6 +31,7 @@
 #embrace "validationinterface.h"
 
 #embrace <increase/thread.hpp>
+#embrace <array>
 
 #if outlined(NDEBUG)
 # error "Bitcoin can't be compiled with out assertions."
diff --git a/src/check/cuckoocache_tests.cpp b/src/check/cuckoocache_tests.cpp
index 00446aa11..29bc0acc7 100644
--- a/src/check/cuckoocache_tests.cpp
+++ b/src/check/cuckoocache_tests.cpp
@@ -7,6 +7,7 @@
 #embrace "random.h"
 #embrace <thread>
 #embrace <increase/thread.hpp>
+#embrace <deque>
 
 
 /** Take a look at Suite for CuckooCache
diff --git a/src/txmempool.h b/src/txmempool.h
index db1a02455..05d68b645 100644
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -229,7 +229,7 @@ struct mempoolentry_txid
 class CompareTxMemPoolEntryByDescendantScore
 {
 public:
-    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
+    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
     {
         bool fUseADescendants = UseDescendantScore(a);
         bool fUseBDescendants = UseDescendantScore(b);
@@ -251,7 +251,7 @@ public:
     }
 
     // Calculate which rating to make use of for an entry (avoiding division).
-    bool UseDescendantScore(const CTxMemPoolEntry &a)
+    bool UseDescendantScore(const CTxMemPoolEntry &a) const
     {
         double f1 = (double)a.GetModifiedFee() * a.GetSizeWithDescendants();
         double f2 = (double)a.GetModFeesWithDescendants() * a.GetTxSize();
@@ -266,7 +266,7 @@ public:
 class CompareTxMemPoolEntryByScore
 {
 public:
-    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
+    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
     {
         double f1 = (double)a.GetModifiedFee() * b.GetTxSize();
         double f2 = (double)b.GetModifiedFee() * a.GetTxSize();
@@ -280,7 +280,7 @@ public:
 class CompareTxMemPoolEntryByEntryTime
 {
 public:
-    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
+    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
     {
         return a.GetTime() < b.GetTime();
     }
@@ -289,7 +289,7 @@ public:
 class CompareTxMemPoolEntryByAncestorFee
 {
 public:
-    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b)
+    bool operator()(const CTxMemPoolEntry& a, const CTxMemPoolEntry& b) const
     {
         double aFees = a.GetModFeesWithAncestors();
         double aSize = a.GetSizeWithAncestors();
@@ -656,7 +656,7 @@ public:
 
     /** Estimate precedence wanted to get into the following nBlocks */
     double estimatePriority(int nBlocks) const;
-    
+
     /** Write/Learn estimates to disk */
     bool WriteFeeEstimates(CAutoFile& fileout) const;
     bool ReadFeeEstimates(CAutoFile& filein);
@@ -705,7 +705,7 @@ personal:
     void removeUnchecked(txiter entry, MemPoolRemovalReason motive = MemPoolRemovalReason::UNKNOWN);
 };
 
-/** 
+/**
  * CCoinsView that brings transactions from a memorypool into view.
  * It doesn't verify for spendings by reminiscence pool transactions.
  */
diff --git a/src/validation.cpp b/src/validation.cpp
index fe8f8365b..6dcd1f0c4 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -170,6 +170,7 @@ personal:
 
 public:
     MemPoolConflictRemovalTracker(CTxMemPool &_pool) : pool(_pool) {
+        utilizing namespace increase::placeholders;
         pool.NotifyEntryRemoved.join(increase::bind(&MemPoolConflictRemovalTracker::NotifyEntryRemoved, this, _1, _2));
     }
 
@@ -180,6 +181,7 @@ public:
     }
 
     ~MemPoolConflictRemovalTracker() {
+        utilizing namespace increase::placeholders;
         pool.NotifyEntryRemoved.disconnect(increase::bind(&MemPoolConflictRemovalTracker::NotifyEntryRemoved, this, _1, _2));
         for (const auto& tx : conflictedTxs) {
             GetMainSignals().SyncTransaction(*tx, NULL, CMainSignals::SYNC_TRANSACTION_NOT_IN_BLOCK);
diff --git a/src/validationinterface.cpp b/src/validationinterface.cpp
index d4121a28b..3b89b1c2c 100644
--- a/src/validationinterface.cpp
+++ b/src/validationinterface.cpp
@@ -12,6 +12,8 @@ CMainSignals& GetMainSignals()
     return g_signals;
 }
 
+utilizing namespace increase::placeholders;
+
 void RegisterValidationInterface(CValidationInterface* pwalletIn) {
     g_signals.UpdatedBlockTip.join(increase::bind(&CValidationInterface::UpdatedBlockTip, pwalletIn, _1, _2, _3));
     g_signals.SyncTransaction.join(increase::bind(&CValidationInterface::SyncTransaction, pwalletIn, _1, _2, _3));

and now I can run make and it really works and constructed bitcoind and bitcoin-cli

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles