Skip to content

Conversation

@shaavan
Copy link
Contributor

@shaavan shaavan commented Dec 2, 2022

On Mac OS Version > 11.0.0, running ./contrib/install/db4.sh `pwd` on master leads to the following error.
\

WARNING: NO SHARED LATCH IMPLEMENTATION FOUND FOR THIS PLATFORM.
configure: error: Unable to find a mutex implementation

As documented in #20195, the reason for this error is that Apple has enabled -Werror=implicit-function-declaration by default.

The fix noticed in that PR was to set CFLAGS to "-Wno-error=implicit-function-declaration".
This PR adds that fix to the contrib/install_db4.sh file so that it can run smoothly for Mac OS version > 11.0.0

@DrahtBot
Copy link
Contributor

DrahtBot commented Dec 2, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@maflcko
Copy link
Member

maflcko commented Dec 2, 2022

Wouldn't it be better to just use brew, as explained in the docs: https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#legacy-wallet-support

brew install berkeley-db@4

@jarolrod
Copy link
Contributor

jarolrod commented Dec 2, 2022

A user would have no issue installing bdb on macOS since it is easily accessible with a package manager, this script is really meant for cases where there is no bdb package readily accessible and the user wants to perform a dynamic build. Otherwise, just use depends.

Nevertheless, this doesn't seem to work as intended in my testing. On macOS 12.6 M1 I still run into the issue.

@fanquake
Copy link
Member

fanquake commented Dec 5, 2022

Agree on leaving this as-is. You can also set your CFLAGS before invoking the script, i.e CFLAGS=-Wno-error=implicit-function-declaration ./install_db4.sh.

@fanquake fanquake closed this Dec 5, 2022
fanquake added a commit to fanquake/bitcoin that referenced this pull request Jan 18, 2023
Now that we can build a bdb-only depends prefix, there is no need to
maintain a bdb-building bash script, that does the same things as
depends, except worse, as it's missing patches and workarounds. i.e bitcoin#26623.
achow101 added a commit that referenced this pull request Jan 27, 2023
44f3c7d contrib: remove install_db4.sh (fanquake)
14ce843 doc: add new NO_* options from #26833 (fanquake)

Pull request description:

  Now that we can build a bdb-only depends prefix (#26833), there is no need to
  maintain a bdb-building bash script, that does the same thing as
  depends, except worse, as it's missing patches and workarounds. i.e #26623.

  Someone that wants to compile bdb themselves, but doesn't want to use other depends built libs, can do:
  ```bash
  make -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1
  ...
  to: /path/to/bitcoin/depends/x86_64-pc-linux-gnu
  ```

  which gives them a BDB only prefix, and then compile using:
  ```bash
  export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-pc-linux-gnu"
  ./autogen.sh
  ./configure \
      BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \
      BDB_CFLAGS="-I${BDB_PREFIX}/include"
  ```

  Wondering if we should extract the build bdb/legacy wallet docs somewhere, to avoid the repetition?

ACKs for top commit:
  TheCharlatan:
    ACK 44f3c7d
  achow101:
    ACK 44f3c7d
  hebasto:
    ACK 44f3c7d
  jarolrod:
    ACK 44f3c7d

Tree-SHA512: 50b33ae9df2ab94a1bd114e846cec16f647a61023b72f0d3e547a18db09c01d60bb7b42a04758212f4930314df03016feb6ebc96962dd8a8e26eb8cd4e0d167d
@bitcoin bitcoin locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants