XDagger / xdag

XDAG (Dagger Coin) Official Main Repository. XDAG is a novel DAG based cryptocurrency.
https://xdag.io
MIT License
327 stars 130 forks source link

I followed the introduction to build this project. But I always get many errors like these #591

Open bigliam opened 3 years ago

bigliam commented 3 years ago

/home/luban/miner/xdag-0.4.0/client/block.c:1170: undefined reference to g_rx_pool_mem_index' /home/luban/miner/xdag-0.4.0/client/block.c:1174: undefined reference tog_rx_pool_mem' /home/luban/miner/xdag-0.4.0/client/block.c:1174: undefined reference to g_rx_pool_mem' /home/luban/miner/xdag-0.4.0/client/block.c:1174: undefined reference tog_rx_pool_mem' /home/luban/miner/xdag-0.4.0/client/block.c:1174: undefined reference to g_rx_pool_mem' /tmp/ccc7QLBP.o: In functionxdag_create_block': /home/luban/miner/xdag-0.4.0/client/block.c:1053: undefined reference to is_randomx_fork' /home/luban/miner/xdag-0.4.0/client/block.c:1054: undefined reference tog_rx_pool_mem_index' /home/luban/miner/xdag-0.4.0/client/block.c:1055: undefined reference to g_rx_hash_epoch_index' /home/luban/miner/xdag-0.4.0/client/block.c:1055: undefined reference tog_rx_pool_mem_index' /home/luban/miner/xdag-0.4.0/client/block.c:1059: undefined reference to g_rx_pool_mem' /home/luban/miner/xdag-0.4.0/client/block.c:1060: undefined reference tog_rx_pool_mem_index' /tmp/ccc7QLBP.o: In function rx_hash_difficulty': /home/luban/miner/xdag-0.4.0/client/block.c:2341: undefined reference torx_block_hash' /tmp/ccc7QLBP.o: In function add_block_nolock': /home/luban/miner/xdag-0.4.0/client/block.c:673: undefined reference tois_randomx_fork' /tmp/ccc7QLBP.o: In function unset_main': /home/luban/miner/xdag-0.4.0/client/block.c:370: undefined reference torx_unset_fork_time' /tmp/ccc7QLBP.o: In function work_thread': /home/luban/miner/xdag-0.4.0/client/block.c:1253: undefined reference torx_loading_fork_time' /tmp/ccc7QLBP.o: In function set_main': /home/luban/miner/xdag-0.4.0/client/block.c:357: undefined reference torx_set_fork_time' /tmp/ccpvnhZg.o: In function xdag_init': /home/luban/miner/xdag-0.4.0/client/init.c:116: undefined reference torx_init_flags' /home/luban/miner/xdag-0.4.0/client/init.c:109: undefined reference to rx_init_flags' /tmp/ccvI9LAk.o: In functionprocess_received_share': /home/luban/miner/xdag-0.4.0/client/pool.c:884: undefined reference to is_randomx_fork' /home/luban/miner/xdag-0.4.0/client/pool.c:888: undefined reference torx_pool_calc_hash' /tmp/ccOgMoqT.o: In function mining_thread': /home/luban/miner/xdag-0.4.0/client/miner.c:386: undefined reference toxdag_rx_mine_worker_hash' /tmp/ccOgMoqT.o: In function miner_net_thread': /home/luban/miner/xdag-0.4.0/client/miner.c:287: undefined reference torx_mine_init_dataset' /tmp/ccYiNv0n.o: In function processExitCommand': /home/luban/miner/xdag-0.4.0/client/commands.c:631: undefined reference torx_pool_release_mem' /home/luban/miner/xdag-0.4.0/client/commands.c:631: undefined reference to rx_pool_release_mem' /home/luban/miner/xdag-0.4.0/client/commands.c:631: undefined reference torx_pool_release_mem' collect2: error: ld returned 1 exit status make: *** [xdag] Error 1

MyronX commented 3 years ago

Can you tell me the version of your operating system and the steps you followed?
Looks like it lacks a dependency on randomx. You can check if randomx is installed.
If you can tell me more detailed information, I can try to help you solve this problem

bigliam commented 3 years ago

@MyronX Emmm. The system is [Linux version 3.10.0-957.el7.x86_64] in a k8s container. And I checked the randomx.h file. It is under the path:[/usr/local/include/randomx.h]. So I guess randomx.h is correctly installed. What is more, I followed the instructions by "cd client && make" command.

Here is information when installing randomx: [ 86%] Built target randomx [ 93%] Built target randomx-benchmark [ 96%] Built target randomx-codegen [100%] Built target randomx-tests Install the project... -- Install configuration: "Release" -- Installing: /usr/local/lib64/librandomx.a -- Up-to-date: /usr/local/include/randomx.h

MyronX commented 3 years ago

maybe u use centos? try this to build randomx

git clone https://github.com/tevador/RandomX.git
cd RandomX
mkdir build && cd build
cmake -DARCH=native ..
make
sudo make install

and try to open hugepage for randomx

then reboot system

See if this method solves your problem

bigliam commented 3 years ago

maybe u use centos? try this to build randomx

git clone https://github.com/tevador/RandomX.git
cd RandomX
mkdir build && cd build
cmake -DARCH=native ..
make
sudo make install

and try to open hugepage for randomx

  • Temporary open
sudo sysctl -w vm.nr_hugepages=2560
  • Permanent open
sudo bash -c "echo vm.nr_hugepages=2560 >> /etc/sysctl.conf"

then reboot system

See if this method solves your problem

I do actually build randomx in this way. Maybe rebooting is the key.

MyronX commented 3 years ago

maybe u use centos? try this to build randomx

git clone https://github.com/tevador/RandomX.git
cd RandomX
mkdir build && cd build
cmake -DARCH=native ..
make
sudo make install

and try to open hugepage for randomx

  • Temporary open
sudo sysctl -w vm.nr_hugepages=2560
  • Permanent open
sudo bash -c "echo vm.nr_hugepages=2560 >> /etc/sysctl.conf"

then reboot system See if this method solves your problem

I do actually build randomx in this way. Maybe rebooting is the key.

ok. Waiting for your feedback

ductridev commented 2 years ago

@MyronX I'm facing the same issue, but after I set hugepages and restart my machine, it is still not working. image