"Windows Subsystem For Linux" for master not work #11549

issue AngelTs opened this issue on October 23, 2017
  1. AngelTs commented at 2:35 PM on October 23, 2017: none

    angel@DESKTOP-37ER0D7:/mnt/c/$ABC$/bitcoin/depends$ make HOST=x86_64-w64-mingw32 sha256sum: '/mnt/c/$/bitcoin/depends/patches/zeromq/9114d3957725acd34aa8b8d011585812f3369411.patch': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/zeromq/9e6745c12e0b100cd38acecc16ce7db02905e27c.patch': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/qt/mac-qmake.conf': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/qt/mingw-uuidof.patch': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/qt/pidlist_absolute.patch': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/qt/fix-xcb-include-order.patch': No such file or directory sha256sum: '/mnt/c/$/bitcoin/depends/patches/qt/fix_qt_pkgconfig.patch': No such file or directory Configuring native_ccache... /bin/sh: 1: Syntax error: "(" unexpected funcs.mk:242: recipe for target '/mnt/c/BCbitcoin/depends/work/build/x86_64-w64-mingw32/native_ccache/3.3.4-e6d1b7b6109/./.stamp_configured' failed make: *** [/mnt/c/BCbitcoin/depends/work/build/x86_64-w64-mingw32/native_ccache/3.3.4-e6d1b7b6109/./.stamp_configured] Error 2

  2. NicolasDorier commented at 2:48 PM on October 23, 2017: contributor

    Take a look at #11438

    You also probably need to run PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g')

  3. AngelTs commented at 3:31 PM on October 23, 2017: none

    I made each step in https://github.com/bitcoin/bitcoin/blob/master/doc/build-windows.md including "PATH=$(echo "$PATH" | sed -e 's/:/mnt.*//g')" without success.

  4. donaloconnor commented at 9:02 PM on October 23, 2017: contributor

    I reckon it's related to the $ABC$ path. Can you drop the $'s in your folder name.

    I tested even doing a CD to a path like that and it failed without it being escaped:

    donal@DESKTOP-XXX:/$ cd /mnt/c/$ABC$
    bash: cd: /mnt/c/$: No such file or directory
    donal@DESKTOP-XXX:/$ cd /mnt/c/\$ABC\$
    donal@DESKTOP-XXX:/mnt/c/$ABC$$
    
  5. fanquake added the label Windows on Oct 23, 2017
  6. sipsorcery commented at 3:13 AM on October 24, 2017: member

    Working steps for WSL are available here. Be sure to take note of the way the Ubunutu packages are being installed (Zesty packages onto Xenial). It gets the bitcoin build working but it may break other things.

  7. NicolasDorier commented at 7:23 AM on October 24, 2017: contributor

    it seems @donaloconnor is correct, if so, it seems that PATH=$(echo "$PATH" | sed -e 's/:/mnt.*//g') did not stripped this path correctly? is the sed wrong?

  8. donaloconnor commented at 8:19 AM on October 24, 2017: contributor

    That only strips the PATH environment variables. It could be and likely that it's to do with the current working dir that's used.

  9. NicolasDorier commented at 8:40 AM on October 24, 2017: contributor

    ah indeed I missed the fact his bitcoin code was in this folder.

  10. AngelTs commented at 8:47 AM on October 24, 2017: none

    I resolve the problem as rename directory "bitcoin-master" to "bitcoin" from master zip and move it into the root of C. Now I am trying to resolve the next errors during compilation. I will write the right and consecutive steps when I achieve success, but the steps in original tutorial are not correct, at least for my system. And the hole process to compile something simple as bitcoin should be very simple, but it is dramatically hard. Just compare with UE4 with millions of code-lines and even then with so easy compilation procedure in VS and windows. Complexity of the code in UE4 is fare, fare bigger than bitcoin.

  11. NicolasDorier commented at 9:01 AM on October 24, 2017: contributor

    @AngelTs welcome to linux world, where you build plane out of wooden sticks, because you don't trust anything bigger. ;)

    I plan in the future to make a simple docker file which setup a reproductible build environment which can work on windows every time. It is what I am using on my side, too much problem otherwise.

  12. sipsorcery commented at 9:08 AM on October 24, 2017: member

    @AngelTs what's the compilation error?

    Note that the current tutorial states building on Ubuntu 16.04 (which is what gets installed with WSL) is broken. Either see my instructions above to work around it or build on Ubuntu 14 or 17.

  13. AngelTs commented at 2:34 PM on October 24, 2017: none

    Here is THE STEPPER [for Ubuntu 16.04.3 LTS]: 1. bash 2. sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl sudo apt-get install g++-mingw-w64-x86-64 mingw-w64-x86-64-dev sudo apt-get update sudo apt-get update --fix-missing sudo apt-get install gcc sudo apt-get install g++ sudo apt-get install libtool sudo apt-get install pkg-config sudo apt-get install libdb4.8++ sudo apt-get install libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev sudo apt-get install libevent-dev sudo apt-get install automake sudo apt-get install libssl-dev close bash 3. Rename "bitcoin-master" directory to "bitcoin" and move it to root of C 4. bash cd bitcoin 5. To prevent the error "configure: error: libdb_cxx headers missing, Bitcoin Core requires this library for wallet functionality (--disable-wallet to disable wallet functionality)" Get db4.8 source, compile and install; #3686 wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz tar -xzvf db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix ../dist/configure --enable-cxx make sudo make install 6. cd ../.. PATH=$(echo "$PATH" | sed -e 's/:/mnt.*//g') cd depends make HOST=x86_64-w64-mingw32 cd .. ./autogen.sh ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" make 7. [optional] make install DESTDIR=/mnt/c/workspace/bitcoin 8. [optional] c:\workspace\bitcoin\usr\local\bin>bash -c "./bench_bitcoin"

    ---------------------------------------------------------------------------------------------------------
    Conclusion question:
    How this method (WSL) can produce standalone exe(s) for windows???
    (You need to start bash and then the program in win: c:\workspace\bitcoin\usr\local\bin>bash -c "ls -ls")
    Maybe it can't???
    ---------------------------------------------------------------------------------------------------------
    
  14. donaloconnor commented at 2:55 PM on October 24, 2017: contributor

    This method does not cross compile for native Windows (so no exe). There is an open PR with Visual Studio projects by @sipsorcery that's a WIP: #11526

    Edit: sorry what I said here is 100% incorrect. Mind else where :)

  15. sipsorcery commented at 8:44 PM on October 24, 2017: member

    @AngelTs I think you've awry somewhere. There's no need to separately install all the dependencies. The make script in the depends directory does that.

    The detailed steps below repeatedly work for me on Ubuntu for Windows (aka WSL) including as recently as a few hours ago.

    • sudo apt install g++-mingw-w64-x86-64
    • sudo apt install software-properties-common
    • sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu zesty universe"
    • sudo apt update
    • sudo apt upgrade
    • sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.
    • cd /usr/src
    • sudo git clone https://github.com/bitcoin/bitcoin.git
    • sudo chmod -R a+rw bitcoin
    • PATH=$(echo "$PATH" | sed -e 's/:/mnt.*//g') # strip out problematic Windows %PATH% imported var
    • cd bitcoin/depends
    • make HOST=x86_64-w64-mingw32
    • cd ..
    • ./autogen.sh
    • CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/
    • make
    • sudo make install
    • Copy binaries to Windows and check execution:
      • /bin/bitcoind.exe (e.g. test: mkdir bitcoind;./bitcoind.exe -printtoconsole -regtest -datadir=./bitcoind)
      • /bin/bitcoin-cli.exe
      • /bin/bitcoin-tx.exe
      • /bin/test_bitcoin.exe
      • /bin/bench_bitcoin.exe
      • /bin/bitcoin-qt.exe
      • /bin/test_bitcoin-qt.exe
      • /include/bitcoinconsensus.h
      • /lib/libbitcoinconsesnsus.a
      • /lib/libbitcoinconsesnsus.dll.a
  16. rebroad commented at 5:46 AM on November 8, 2017: contributor

    This has been fixed by #11438 so I think it can be closed.

  17. fanquake commented at 11:45 PM on November 14, 2017: member

    Closing now that #11438 has been merged. If you're still having issues, can you comment in #11685.

  18. fanquake closed this on Nov 14, 2017

  19. ashishchandr70 commented at 5:44 PM on September 11, 2018: none

    Here is THE STEPPER [for Ubuntu 16.04.3 LTS]: ./autogen.sh ./configure CPPFLAGS="-I/usr/local/BerkeleyDB.4.8/include -O2" LDFLAGS="-L/usr/local/BerkeleyDB.4.8/lib" make

    While running "./configure", for those, like me, who have Boost installed in a non standard location (i.e. not under /usr/local/) don't forget to use the --with-boost=<BOOST ROOT DIR> and --with-boost-libdir=<BOOST ROOT DIR/stage/lib>. FYI, these two directories are output to the screen once Boost is built successfully.

  20. DrahtBot 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-04-17 03:15 UTC

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