Mac OS X Yosemite build failure with berkeley-db4 installed in nonstandard location #5741

issue skaht opened this issue on February 3, 2015
  1. skaht commented at 1:25 AM on February 3, 2015: none

    Followed the "build-osx.md" mark down instructions, but required slight tailoring. Step #4 documents where the errors occur. Beyond the "brew install autoconf automake libtool boost miniupnpc openssl pkg-config protobuf qt5"

    1. Recommend tweaking instructions after executing the "brew install https://raw.github.com/homebrew/homebrew/master/Library/Formula/berkeley-db4.rb -–without-java" command for people to type "pwd" immediately afterwards so they know for sure they are in the brew interactive mode before executing "cd ..".

    2. My Homebrew is installed in a nonstandard location. The brew interactive installation for berkeley-db4 looks like this "db-4.8.30/dist/configure --prefix=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30 --mandir=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx"

    3. interactive mode "make" completed successfully

    4. make install Installing DB library: /usr/local/Cellar/berkeley-db4/4.8.30/lib ... Installing DB include files: /usr/local/Cellar/berkeley-db4/4.8.30/include ... Installing DB utilities: /usr/local/Cellar/berkeley-db4/4.8.30/bin ... Installing documentation: /usr/local/Cellar/berkeley-db4/4.8.30/docs ... mkdir: /usr/local/Cellar/berkeley-db4/4.8.30: Permission denied make: *** [install_setup] Error 1 make: *** Waiting for unfinished jobs.... mkdir: /usr/local/Cellar/berkeley-db4/4.8.30/include: Permission denied mkdir: /usr/local/Cellar/berkeley-db4/4.8.30/lib: Permission denied mkdir: /usr/local/Cellar/berkeley-db4/4.8.30/bin: Permission denied make: *** [install_lib] Error 1 make: *** [install_include] Error 1 make: *** [install_utilities] Error 1 mkdir: /usr/local/Cellar/berkeley-db4/4.8.30/docs: Permission denied make: *** [install_docs] Error 1

    Any recommendations for a security conscious dude that does not like to use root-enabled brew commands unless absolutely necessary?

    My .cshrc file has the following environmental variables set:

    setenv HOMEBREW_PREFIX /Users/Dude/usr/local setenv HOMEBREW_REPOSITORY /Users/Dude/usr/local/Homebrew setenv HOMEBREW_CELLAR /Users/Dude/usr/local/Homebrew/Cellar setenv HOMEBREW_LIBRARY_PATH /Users/Dude/usr/local/Homebrew/Library/Homebrew setenv HOMEBREW_CACHE /Users/Dude/usr/local/cache

    1. Also - After the exit command, the next command should be "brew link berkeley-db4 --force". The last two arguments are transposed.

    FYSA - Got libbitcoin-server and bitcoin-explorer to compile with Homebrew installed in a non-standard location.

  2. skaht commented at 4:18 AM on February 3, 2015: none

    Ended up copy the "tar xvzf berkeley-db4-4.8.30.tar.gz" from the HOMEBREW_CACHE directory into a temporary build directory for berkeley-db4. Located the atomic.h file in temporary directory and changed to the directory containing that header file. Then promptly patched the header file using "patch < db-4.8.30-rename-atomic-compare-exchange.patch" that matched the contents from the bottom of https://raw.githubusercontent.com/homebrew/homebrew/master/Library/Formula/berkeley-db4.rb. A "db-4.8.30/dist/configure --help" gave me insights for overriding default directories installation directories.

    db-4.8.30/dist/configure --prefix=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30 --includedir=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30/include --libdir=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30/lib --bindir=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30/bin --mandir=/Users/Dude/usr/local/Homebrew/Cellar/berkeley-db4/4.8.30/share/man --enable-cxx

    The configure above worked and the associated "make install" finally worked. Afterwards, applied the "brew link --force berkeley-db4" command.

    Went on to "mkdir src" parallel to the bitcoin directory.

    1. ../bitcoin/autogen.sh
    2. ../bitcoin/configure --with-gui=qt5 --with-boost=/Users/Dude/usr/local/Homebrew/Cellar/boost/1.57.0 CXXFLAGS="-I /Users/Dude/usr/local/Homebrew/Cellar/boost/1.57.0/include"
    3. make

    The make has failed ... CXX libbitcoin_util_a-utilstrencodings.o CXX libbitcoin_util_a-utiltime.o AR libbitcoin_util.a /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libbitcoin_util.a(libbitcoin_util_a-strnlen.o) has no symbols /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libbitcoin_util.a(libbitcoin_util_a-strnlen.o) has no symbols CXX crypto/crypto_libbitcoin_crypto_a-sha1.o CXX crypto/crypto_libbitcoin_crypto_a-sha256.o CXX crypto/crypto_libbitcoin_crypto_a-sha512.o CXX crypto/crypto_libbitcoin_crypto_a-hmac_sha256.o CXX crypto/crypto_libbitcoin_crypto_a-hmac_sha512.o CXX crypto/crypto_libbitcoin_crypto_a-ripemd160.o AR crypto/libbitcoin_crypto.a Building LevelDB ... make: *** leveldb: No such file or directory. Stop. make[2]: *** [leveldb/libmemenv.a] Error 2 make[1]: *** [all-recursive] Error 1 make: *** [all-recursive] Error 1

    Any suggestions???

  3. paveljanik commented at 7:57 AM on February 3, 2015: contributor

    How did you checked out the bitcoin tree? leveldb is a directory under bitcoin/src...

  4. laanwj added the label Mac on Feb 3, 2015
  5. laanwj added the label Build system on Feb 3, 2015
  6. skaht commented at 2:00 PM on February 3, 2015: none

    The build-osx.md instructions indicated "git clone https://github.com/bitcoin/bitcoin.git" was to be used to download the source. After downloading the code within the last 48 hours, I tried checking out the source code multiple ways within the bitcoin directory as follows:

    1. git checkout master
    2. git checkout v0.9.4

    Results where similar.

  7. paveljanik commented at 2:14 PM on February 3, 2015: contributor

    After git clone https://github.com/bitcoin/bitcoin.git you do not see bitcoin/src/leveldb? I do...

  8. skaht commented at 5:50 PM on February 3, 2015: none

    The bitcoin/src/leveldb exist at this end. Any ideas for the step?

  9. paveljanik commented at 5:57 PM on February 3, 2015: contributor

    So where is make getting this:

    Building LevelDB ...
    make: *** leveldb: No such file or directory. Stop.
    

    Try to debug make.

    This issue should be closed now. Sorry, but this is for sure not Bitcoin Core related build issue.

  10. skaht commented at 6:50 PM on February 3, 2015: none

    Finally got it to compile. There were two issues:

    1. A bonehead mistake on my part. Forgot the --prefix for the bitcoin configure. Final configure looks like: ./configure --prefix=/Users/Dude/Projects/Bitcoin --with-gui=qt5 --with-boost=/Users/Dude/usr/local/Homebrew/Cellar/boost/1.57.0
    2. I assumed the autogen.sh and configure could function outside the the bitcoin directory. Its a habit of mine to build code in a src directory parallel to a distribution directory, tends to make it easier to cross compile things for different architectures. This was the big mistake... When I performed the autogen, configure, make, make check and make install all from the bitcoin directory, everything started to work. There must be a hard dependency in the bitcoin Makefile(s) preventing relative builds.
  11. laanwj commented at 7:08 AM on February 4, 2015: member

    Good to hear that you got compilation working.

    Yes, out-of-tree builds are not supported due to how leveldb is built (which makes it non-trivial, but feel free to try), I'm quite used to them too and agree it would be very nice to support this, but it doesn't right now.

  12. laanwj closed this on Feb 4, 2015

  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-04 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me