Not able to build and compile on macos #29083

issue sarthak13gupta openend this issue on December 14, 2023
  1. sarthak13gupta commented at 7:56 pm on December 14, 2023: none

    Hey there , I’m facing these issues. I ran these commands

    ./autogen.sh ./configure --disable-bench --disable-fuzz-binary --enable-debug --without-gui --enable-suppress-external-warnings make

  2. maflcko commented at 8:00 pm on December 14, 2023: member
    Did you run make clean?
  3. maflcko added the label macOS on Dec 14, 2023
  4. maflcko added the label Build system on Dec 14, 2023
  5. maflcko added the label Questions and Help on Dec 14, 2023
  6. sarthak13gupta commented at 8:08 pm on December 14, 2023: none
    Yes I have tried that.Didn’t work.
  7. maflcko commented at 8:10 pm on December 14, 2023: member
    What is your operating system and architecture? Where did you get BDB from?
  8. maflcko commented at 8:11 pm on December 14, 2023: member
    Do you need BDB? If not, you can disable it with --without-bdb.
  9. hebasto commented at 8:13 pm on December 14, 2023: member
    What is the ./configure script summary?
  10. jonatack commented at 8:27 pm on December 14, 2023: member

    Can also try make distclean and then rebuild.

    If that doesn’t work, or if you are seeing linker issues, the header and compilation might be out of sync and you may want to ensure that you are building from a clean tree. If you are using ccache, try clearing the cache by running ccache -C (see ccache -h for help) and then rebuilding.

    If that doesn’t solve it, you can also run git clean -f -x -d and rebuild. This wipes everything in the tree that doesn’t belong to git, so be careful that you don’t have anything else in the directory that you don’t want to lose and move it out first.

    See https://jonatack.github.io/articles/how-to-compile-bitcoin-core-and-run-the-tests for more info.

  11. sarthak13gupta commented at 8:33 pm on December 14, 2023: none

    What is your operating system and architecture? Where did you get BDB from?

    MacOS 13.0 Arm64 architechture . I tried installing BDB using homebrew while following the docs -> https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md

  12. maflcko commented at 8:35 pm on December 14, 2023: member

    MacOS 13.0 Arm64 architechture . I tried installing BDB using homebrew while following the docs -> https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md

    Can you try to re-install it, and check that it installs it for arm64? Otherwise, if you don’t need it, you can disable it by passing --without-bdb to ./configure.

  13. maflcko added the label Upstream on Dec 14, 2023
  14. maflcko added the label Wallet on Dec 14, 2023
  15. sarthak13gupta commented at 8:40 pm on December 14, 2023: none

    What is the ./configure script summary?

    I don’t exactly understand it but this is what i got after running the ./configure command. https://gist.github.com/sarthak13gupta/6ab7cf9b402a3695b20da574a5957804

  16. sarthak13gupta commented at 8:43 pm on December 14, 2023: none

    MacOS 13.0 Arm64 architechture . I tried installing BDB using homebrew while following the docs -> https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md

    Can you try to re-install it, and check that it installs it for arm64? Otherwise, if you don’t need it, you can disable it by passing --without-bdb to ./configure.

    I don’t think I need it currently. Do I need to add anything else in this line ./configure --disable-bench --disable-fuzz-binary --enable-debug --without-gui --enable-suppress-external-warnings apart from --without-bdb

  17. hebasto commented at 8:46 pm on December 14, 2023: member

    @sarthak13gupta

    Did you move your macOS from x86_64 (Intel) machine to a new Apple Silicon based one?

    (I saw a similar issue back then)

  18. maflcko commented at 8:47 pm on December 14, 2023: member

    Do I need to add anything else in this line

    Yes, that sounds good. Your configure summary should then print, just to confirm:

     0Options used to compile and link:
     1  external signer = yes
     2  multiprocess    = no
     3  with libs       = yes
     4  with wallet     = yes
     5    with sqlite   = yes
     6-    with bdb      = yes
     7+    with bdb      = no
     8  with gui / qt   = no
     9  with zmq        = yes
    10  with test       = yes
    11  with fuzz binary = no
    12  with bench      = no
    13  with upnp       = no
    14  with natpmp     = no
    15  use asm         = yes
    16  USDT tracing    = no
    17  sanitizers      = 
    18  debug enabled   = yes
    19  gprof enabled   = no
    20  werror          = no
    21  LTO             = no
    22
    23  target os       = darwin22.1.0
    24  build os        = darwin22.1.0
    25
    26  CC              = /opt/homebrew/bin/ccache gcc
    27  CFLAGS          = -pthread -g -O2
    28  CPPFLAGS        =  -DDEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -DRPC_DOC_CHECK -DABORT_ON_FAILED_ASSUME -fmacro-prefix-map=$(abs_top_srcdir)=.   -DHAVE_BUILD_INFO -Xclang -internal-isystem/usr/local/include -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0 
    29  CXX             = /opt/homebrew/bin/ccache g++ -std=c++17
    30  CXXFLAGS        =   -O0 -g3 -ftrapv -fdebug-prefix-map=$(abs_top_srcdir)=.  -Wstack-protector -fstack-protector-all -fcf-protection=full  -Wall -Wextra -Wgnu -Wformat -Wformat-security -Wvla -Wshadow-field -Wthread-safety -Wloop-analysis -Wredundant-decls -Wunused-member-function -Wdate-time -Wconditional-uninitialized -Woverloaded-virtual -Wsuggest-override -Wunreachable-code-loop-increment -Wimplicit-fallthrough -Wdocumentation  -Wno-unused-parameter -Wno-self-assign    
    31  LDFLAGS         =  -lpthread  -Wl,-bind_at_load -Wl,-fixup_chains   -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-dead_strip_dylibs 
    32  AR              = /usr/bin/ar
    33  ARFLAGS         = cr
    
  19. sarthak13gupta commented at 8:49 pm on December 14, 2023: none

    @sarthak13gupta

    Did you move your macOS from x86_64 (Intel) machine to a new Apple Silicon based one?

    (I saw a similar issue back then)

    Nope it’s an m1 so I guess that would be arm64 since the start.

  20. hebasto commented at 8:58 pm on December 14, 2023: member
    If nothing else helps, I would suggest to remove and reinstall Homebrew from scratch.
  21. sarthak13gupta commented at 9:04 pm on December 14, 2023: none

    The linker issue persists… this is what I’m getting after running ./configure https://gist.github.com/sarthak13gupta/6ab7cf9b402a3695b20da574a5957804 and make https://gist.github.com/sarthak13gupta/a993a3f2eb2183b32c1e6042fe7d96db commands. also, another command used initially was git checkout v26.0 to checkout to 26.0

    Also, should I reinstall command line tools as well, given the issue below?

  22. fanquake removed the label Wallet on Dec 14, 2023
  23. fanquake removed the label Build system on Dec 14, 2023
  24. fanquake removed the label Upstream on Dec 14, 2023
  25. maflcko commented at 9:10 pm on December 14, 2023: member

    For reference, the configure output seems to target x86:

    0% ./configure --disable-bench --disable-fuzz-binary --enable-debug --without-gui --enable-suppress-external-warnings --without-bdb
    1checking for pkg-config... /opt/homebrew/bin/pkg-config
    2checking pkg-config is at least version 0.9.0... yes
    3checking build system type... x86_64-apple-darwin22.1.0
    4checking host system type... x86_64-apple-darwin22.1.0
    5...
    
  26. maflcko removed the label Questions and Help on Dec 14, 2023
  27. maflcko added the label Build system on Dec 14, 2023
  28. fanquake commented at 9:11 pm on December 14, 2023: member

    You said you’re running on arm, but configure says otherwise:

    checking build system type… x86_64-apple-darwin22.1.0

    Is your terminal running under Rosetta or something.

  29. fanquake removed the label Build system on Dec 14, 2023
  30. fanquake added the label Questions and Help on Dec 14, 2023
  31. fanquake commented at 9:12 pm on December 14, 2023: member
    This is clearly a local issue / misconfiguration, not a problem with Core.
  32. maflcko commented at 9:18 pm on December 14, 2023: member
    Could this be due to an env var? Maybe check env | grep 'HOST='?
  33. sarthak13gupta commented at 9:22 pm on December 14, 2023: none

    You said you’re running on arm, but configure says otherwise:

    checking build system type… x86_64-apple-darwin22.1.0

    Is your terminal running under Rosetta or something.

    Yes, now that I checked because it gives compatibility issues with dependencies sometimes.

    Should I change it and run it without Rosseta?

    But I don’t know why this would happen , also when brew is located at /opt/homebrew/bin/brew and I’m installing dependencies using arch -arm64 brew install ... because it would give a warning cannot install under rosseta 2 mostly .

  34. sarthak13gupta commented at 7:43 am on December 15, 2023: none

    This is clearly a local issue / misconfiguration, not a problem with Core.

    Changing the terminal config to running it without rosetta worked, Thanks Guys!

  35. maflcko commented at 8:37 am on December 15, 2023: member
    Good to hear. Closing for now.
  36. maflcko closed this on Dec 15, 2023

  37. bitcoin locked this on Dec 14, 2024

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: 2024-12-21 15:12 UTC

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