Pages:
Author

Topic: Why can't I compile the bitcoin source code? - page 3. (Read 895 times)

legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I would like to ask if I can install Ubuntu 18.04 LTS on a windows 7 machine. I changed the windows 10 device and now I have a desktop running windows 7.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Quote
3. Message signature
Choose a different message start signature:
Code:
CChainParams::pchMessageStart in chainparams.cpp

pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;

what exactly do I have to change here? On my altcoin instead of that:

pchMessageStart[0] = 0xf0;
pchMessageStart[1] = 0xb0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;

I did it this way:

pchMessageStart[0] = 0xb0;
pchMessageStart[1] = 0xf0;
pchMessageStart[2] = 0xb0;
pchMessageStart[3] = 0xd0;

I just change their position. Do I have to do anything else?
HCP
legendary
Activity: 2086
Merit: 4318
Lol why did they do that? Why not one program for everything? Didn't satoshi vision it like that?
Because it's pointless... you will never be able to mine a block on CPU/GPU anymore... ASICs have seen to that.


Quote
Started having some problems again  Tongue
At this point... I'm going to recommend you go and seek help in https://bitcointalk.org/index.php?topic=3345808.0]that Altcoin thread] or create your own thread in Altcoin Discussion board... as this thread is starting to veer away from compiling Bitcoin Core source code, and into creating an Altcoin.

That's not what this (Bitcoin Technical Support) board is for.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
If you want to mine, you'll need mining software (and preferably mining hardware Tongue)

Lol why did they do that? Why not one program for everything? Didn't satoshi vision it like that?

------------------------------------------

Started having some problems again  Tongue

I follow that guide on how to create a new altcoin. I'm quoting a text of it:
Quote
2.1 Change RPC port:
Code:
CBaseChainParams::nRPCPort in chainparamsbase.cpp

So while I have changed the ports, it still connects with the old peers:


And of course, it downloads me the entire blockchain...

This is what I've changed:



And this comes to my head. Is there any txt files with IPs inside? So I can delete it?
HCP
legendary
Activity: 2086
Merit: 4318
I believe the mining functionality was removed a long time ago (v0.12.1 was the last version to have the setgenerate command)... so the only way to "mine" with Bitcoin Core itself is when you're running a regtest environment and you use generate command.

If you want to mine, you'll need mining software (and preferably mining hardware Tongue)
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Can I mine directly from bitcoin core? Satoshi had designed it that way so everyone could mine without any other mining softwares.
HCP
legendary
Activity: 2086
Merit: 4318
If you're using the Bitcoin Core codebase... then the default way of getting two devices to talk to one another is by using "addnode"... either from the console or in your "bitcoin.conf" file (or whatever your altcoin .conf file is meant to be called).

2 devices on the same network cannot have the same IP... even if they're on the same router, the external IP might be shared from an external viewpoint (ie. from the internet), but on the internal network (behind the router) they will indeed have different IP addresses, and should be able to connect to each other using those.

You'd need to check the network settings on each device to see what they are... and you'd most likely want to assign static IP addresses in the router setup so you can use the "addnode" in the .conf file and not have to worry about it changing.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
EDIT: I MADE IT!!! I just had to add that line in the end:
Code:
sudo make install DESTDIR=/mnt/c/workspace/bitcoin
Yeah... it seems like a simple permissions error... no doubt because Windows 10 has made "C:" somewhat protected to try and prevent malware and viruses and the like... In Linux, "sudo" == "SuperUser do", so it's basically like running things as "administrator" in Windows.

Just one of the many "gotcha's" of trying to cross-compile things... made slightly more complicated by running Linux through Windows! Undecided

Glad you managed to finally get it sorted... good luck with the altcoin experimentation Wink

I am now building the altcoin. Then I will see how to mine. And if I mine a new block every 10 minutes on average of course, which is very important for me. Regtest doesn't provide me.

One question, if I install on 2 different devices the altcoin, how exactly are they gonna connect? There are no IP addresses written on a txt file. (Like on bitcoin core)

Do I have to point an IP from bitcoin core's settings? What if both devices are connected on the same IP? (same router)
HCP
legendary
Activity: 2086
Merit: 4318
EDIT: I MADE IT!!! I just had to add that line in the end:
Code:
sudo make install DESTDIR=/mnt/c/workspace/bitcoin
Yeah... it seems like a simple permissions error... no doubt because Windows 10 has made "C:" somewhat protected to try and prevent malware and viruses and the like... In Linux, "sudo" == "SuperUser do", so it's basically like running things as "administrator" in Windows.

Just one of the many "gotcha's" of trying to cross-compile things... made slightly more complicated by running Linux through Windows! Undecided

Glad you managed to finally get it sorted... good luck with the altcoin experimentation Wink
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Did u Reset the Ubuntu 18.04 by clicking on Advanced Options ? If not, go ahead with that and then access the Ubuntu 18.04 LTS application, create an username again and go with the build. If you haven't done that, you might run into unknown errors/warnings/exceptions again as it might clash with the older installation.

Going by the pic which you posted, didn't you install mingw-w64 cross-compilation tool chain? Also didn't you change the default compiler option to posix? I think if you didn't change the compiler option, you will get the error which you posted in the first video : 'recursive_mutex' is not a member of 'std'

If you have an unsuccessful build, try the above 2 options which I posted.

I had an unseccussful build, I tried both options you told me, and I still have unsuccessful build.

This is what it returns me after make:
Code:
blablablablah, things after make and boom errors:
make[2]: Leaving directory '/home/angelo/bitcoin/src'
make[1]: Leaving directory '/home/angelo/bitcoin/src'
Making all in doc/man
make[1]: Entering directory '/home/angelo/bitcoin/doc/man'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/home/angelo/bitcoin/doc/man'
make[1]: Entering directory '/home/angelo/bitcoin'
make[1]: Nothing to be done for 'all-am'.
make[1]: Leaving directory '/home/angelo/bitcoin'
angelo@LAPTOP-NC8MQ733:~/bitcoin$ sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status"
[sudo] password for angelo:
angelo@LAPTOP-NC8MQ733:~/bitcoin$ make install DESTDIR=/mnt/c/workspace/bitcoin
Making install in src
make[1]: Entering directory '/home/angelo/bitcoin/src'
make[2]: Entering directory '/home/angelo/bitcoin/src'
make[3]: Entering directory '/home/angelo/bitcoin'
make[3]: Leaving directory '/home/angelo/bitcoin'
make[3]: Entering directory '/home/angelo/bitcoin/src'
make[4]: Entering directory '/home/angelo/bitcoin'
make[4]: Leaving directory '/home/angelo/bitcoin'
 /bin/mkdir -p '/mnt/c/workspace/bitcoin//lib'
 /bin/bash ../libtool --preserve-dup-deps  --mode=install /usr/bin/install -c   libbitcoinconsensus.la '/mnt/c/workspace/bitcoin//lib'
libtool: install: /usr/bin/install -c .libs/libbitcoinconsensus.dll.a /mnt/c/workspace/bitcoin//lib/libbitcoinconsensus.dll.a
/usr/bin/install: setting permissions for '/mnt/c/workspace/bitcoin//lib/libbitcoinconsensus.dll.a': Operation not permitted
Makefile:7186: recipe for target 'install-libLTLIBRARIES' failed
make[3]: *** [install-libLTLIBRARIES] Error 1
make[3]: Leaving directory '/home/angelo/bitcoin/src'
Makefile:18478: recipe for target 'install-am' failed
make[2]: *** [install-am] Error 2
make[2]: Leaving directory '/home/angelo/bitcoin/src'
Makefile:18150: recipe for target 'install-recursive' failed
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory '/home/angelo/bitcoin/src'
Makefile:788: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1

In workspace/bitcoin this is what I get:




I am one step before giving it up... I don't get what my computer doesn't read right...

EDIT: I MADE IT!!! I just had to add that line in the end:
Code:
sudo make install DESTDIR=/mnt/c/workspace/bitcoin
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
Did u Reset the Ubuntu 18.04 by clicking on Advanced Options ? If not, go ahead with that and then access the Ubuntu 18.04 LTS application, create an username again and go with the build. If you haven't done that, you might run into unknown errors/warnings/exceptions again as it might clash with the older installation.

Going by the pic which you posted, didn't you install mingw-w64 cross-compilation tool chain? Also didn't you change the default compiler option to posix? I think if you didn't change the compiler option, you will get the error which you posted in the first video : 'recursive_mutex' is not a member of 'std'

If you have an unsuccessful build, try the above 2 options which I posted.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
I hope "Ubuntu" is the 20.04 one. It can't be the other one.

Yes, it is. If you look it up in the Microsoft Store, the description of the app says that it installs Ubuntu 20.04.

Okay, I've uninstalled it and I'm trying again with the 18.04 one. I'm praising to work ^^



legendary
Activity: 1876
Merit: 3132
I hope "Ubuntu" is the 20.04 one. It can't be the other one.

Yes, it is. If you look it up in the Microsoft Store, the description of the app says that it installs Ubuntu 20.04.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Do you know how to uninstall ubuntu 20.04 from my windows 10? I had installed it, but I don't know how to get rid of it.

Go to "Apps & features" in your system and search for "Ubuntu". You should see Ubuntu 20.04 and 18.04 separately. The uninstall button will be right next to their names. If you also want to have a clean install of Ubuntu 18.04 then you can click on it, select "Advanced options" and reset it.



I hope "Ubuntu" is the 20.04 one. It can't be the other one.
legendary
Activity: 1876
Merit: 3132
Do you know how to uninstall ubuntu 20.04 from my windows 10? I had installed it, but I don't know how to get rid of it.

Go to "Apps & features" in your system and search for "Ubuntu". You should see Ubuntu 20.04 and 18.04 separately. The uninstall button will be right next to their names. If you also want to have a clean install of Ubuntu 18.04 then you can click on it, select "Advanced options" and reset it.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo


A little tired of trying to accomplish that "simple" compilation. Do you know how to uninstall ubuntu 20.04 from my windows 10? I had installed it, but I don't know how to get rid of it.
legendary
Activity: 1584
Merit: 1280
Heisenberg Design Services
I captured a video, with the steps that I do: https://youtu.be/xt-lqp9W640
Can someone tell me what's the problem?

Not sure if my post would be of any help but I had built the source a couple of times in 2 different OS. One was in Ubuntu last year where I didn't have any problem in building and had run various python tests successfully. Last month, I built it in Windows 10 OS and encountered the same issue which you are going through in #35. Later on after many tries I just left that and 2 days back I though of retrying this again after you posted this topic.

As @HCP instructed, I uninstalled Ubuntu 20.04 completely with all its data and had a clean install of 18.04 version. The mistake I did in the previous build last month was neglecting the line which states

Code:
sudo update-alternatives --config x86_64-w64-mingw32-g++ # Set the default mingw32 g++ compiler option to posix.

As stated in the footnotes, it is not possible to do a successful build of Bitcoin Core without changing the compiler option to posix. Try to run the above code and select 1 in the option which states posix and continue building again. After changing the compiler option to posix, I never encountered the issue with make and everything passed smoothly.

Also note that, if you have any error while running

Code:
make install DESTDIR=/mnt/c/workspace/bitcoin

use

Code:
sudo make install DESTDIR=/mnt/c/workspace/bitcoin
sudo make deploy

instead. This did indeed solve the problem which you have posted in the previous post but I am not sure how well this might work on your PC.



So, after building I tried to run unit tests with python3 example_test.py and I got these errors  Huh Can anyone throw some light in this?

Code:
2020-08-02T11:04:12.271000Z TestFramework (INFO): Initializing test directory /tmp/bitcoin_func_test_kpw50dmv
2020-08-02T11:04:29.609000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 503, in start_nodes
    node.wait_for_rpc_connection()
  File "/home/username/bitcoin/test/functional/test_framework/test_node.py", line 221, in wait_for_rpc_connection
    'bitcoind exited with status {} during initialization'.format(self.process.returncode)))
test_framework.test_node.FailedToStartError: [node 0] bitcoind exited with status 1 during initialization

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 117, in main
    self.setup()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 249, in setup
    self.setup_network()
  File "example_test.py", line 114, in setup_network
    self.setup_nodes()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 371, in setup_nodes
    self.start_nodes()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 506, in start_nodes
    self.stop_nodes()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 522, in stop_nodes
    node.stop_node(wait=wait)
  File "/home/username/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
    self.stop(wait=wait)
  File "/home/username/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
2020-08-02T11:04:29.699000Z TestFramework (INFO): Stopping nodes
Traceback (most recent call last):
  File "example_test.py", line 217, in
    ExampleTest().main()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 141, in main
    exit_code = self.shutdown()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 265, in shutdown
    self.stop_nodes()
  File "/home/username/bitcoin/test/functional/test_framework/test_framework.py", line 522, in stop_nodes
    node.stop_node(wait=wait)
  File "/home/username/bitcoin/test/functional/test_framework/test_node.py", line 319, in stop_node
    self.stop(wait=wait)
  File "/home/username/bitcoin/test/functional/test_framework/test_node.py", line 179, in __getattr__
    assert self.rpc_connected and self.rpc is not None, self._node_msg("Error: no RPC connection")
AssertionError: [node 0] Error: no RPC connection
[node 2] Cleaning up leftover process
[node 1] Cleaning up leftover process
[node 0] Cleaning up leftover process
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
Did you make any changes to the code yourself?

You may have an unclean build environment where old compilation results are being used. Try doing make clean before running make.

clean make? I did it. Same results. I think I'm gonna try it on another computer.
staff
Activity: 3458
Merit: 6793
Just writing some code
Did you make any changes to the code yourself?

You may have an unclean build environment where old compilation results are being used. Try doing make clean before running make.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
@HCP, thank you for your reply and your interest. I had installed Ubuntu 20.04 and not 18.04. That was my mistake. Although, when I do exactly what you're telling me I'm reaching on an error on:
Code:
make
(the one before sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status")

This is what it returns:


Code:
Makefile:13450: recipe for target 'bitcoind-bitcoind.o' failed
make[2]: *** [bitcoind-bitcoind.o] Error 1
make[2]: Leaving directory '/home/angelo/bitcoin/src'
Makefile:16665: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/angelo/bitcoin/src'
Makefile:781: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

I don't make sense. I also don't get why bitcoin core developers don't simply create a .bat file that compiles the source code by itself.

Edit: I captured a video, with the steps that I do: https://youtu.be/xt-lqp9W640
Can someone tell me what's the problem?
Pages:
Jump to: