jtgrassie / monero-pool

A Monero mining pool server written in C
BSD 3-Clause "New" or "Revised" License
344 stars 125 forks source link

Can't build from sources #102

Closed ghost closed 3 years ago

ghost commented 3 years ago
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/libcncrypto.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/common/libcommon.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/ringct/libringct_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/device/libdevice.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/wallet/libwallet-crypto.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/contrib/epee/src/libepee.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/external/easylogging++/libeasylogging.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/libversion.a: No such file or directory

these folders src, external and contrib with required files are in /home/moneroist/Github/monero folder not in /home/moneroist/Github/monero/build/Linux/release-v0.17/release

coping these folder to /home/moneroist/Github/monero/build/Linux/release-v0.17/release gives another errors

Linking build/release/src/xmr.o...
g++ -o build/release/monero-pool \
  build/release/src/xmr.o build/release/src/pool.o build/release/src/forkoff.o build/release/src/util.o build/release/src/growbag.o build/release/src/webui.o build/release/src/bstack.o build/release/rxi/log/src/log.o  build/release/src/webui-embed.o \
  -fPIC -pie  /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_basic.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/libcncrypto.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/common/libcommon.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/ringct/libringct_basic.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/device/libdevice.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/wallet/libwallet-crypto.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/contrib/epee/src/libepee.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/external/easylogging++/libeasylogging.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/libversion.a /home/moneroist/Github/monero/build/Linux/release-v0.17/release/external/randomx/librandomx.a \
  -llmdb -lpthread -lunbound -ldl -luuid -lboost_system -lboost_date_time -lboost_chrono -lboost_filesystem -lboost_thread -lboost_regex -lboost_serialization -lboost_program_options -lhidapi-libusb \
  -L/opt/local/lib/ -L/usr/local/lib \
  -levent_core -levent_pthreads -levent -levent_extra -ljson-c -lssl -lcrypto -lsodium 
/usr/bin/ld: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/libcncrypto.a(rx-slow-hash.c.o): in function `rx_slow_hash_free_state':
rx-slow-hash.c:(.text+0xcf0): multiple definition of `rx_slow_hash_free_state'; build/release/src/pool.o:pool.c:(.text+0xddf0): first defined here
/usr/bin/ld: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/libcncrypto.a(rx-slow-hash.c.o): in function `rx_stop_mining':
rx-slow-hash.c:(.text+0xd30): multiple definition of `rx_stop_mining'; build/release/src/pool.o:pool.c:(.text+0xdde0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:175: monero-pool] Error 1
jtgrassie commented 3 years ago

From the README:

The build system requires the Monero source tree to be cloned and compiled. Follow the instructions for compiling Monero...

You are getting errors because the compiled dependencies have not been found.

ghost commented 3 years ago

But I have compiled Monero and add to my .zshrc export MONERO_ROOT="$HOME/Github/monero"

jtgrassie commented 3 years ago

coping these folder to...

You have done something wrong if you are manually copying files around.

ghost commented 3 years ago

I was trying by coping because after compile Monero source tree these files are under main repository folder not int build/../../release to compile Monero source tree I was do everything what is in Readme.md

ghost commented 3 years ago

OK I did not mention that I was doing make release when make building is done without errors, but still make release doesn't work

jtgrassie commented 3 years ago

The pools make vs make release only changes compiler flags. So if make works, make release should work fine too.

Is your release-17 branch recently pulled? Is your pool source recently pulled?

I've just recompiled both release-17 and the pool on Ubuntu 16, 18, 20 and macos without issue.

ghost commented 3 years ago

I am doing exactly this, after install dependencies through `apt-get install

git clone --recursive https://github.com/monero-project/monero
cd monero 
git submodule sync && git submodule update
cmake -DMANUAL_SUBMODULES=1 
make -j8

and compiling starts and finished without errors adding to my .zshrc

export MONERO_ROOT="$HOME/Github/monero"

next clone monero-pool and either make and make release gives me same errors

g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/libcncrypto.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/common/libcommon.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/ringct/libringct_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/device/libdevice.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/cryptonote_basic/libcryptonote_format_utils_basic.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/crypto/wallet/libwallet-crypto.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/contrib/epee/src/libepee.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/external/easylogging++/libeasylogging.a: No such file or directory
g++: error: /home/moneroist/Github/monero/build/Linux/release-v0.17/release/src/libversion.a: No such file or directory

I think problem is that monero is compiling to root repository folder not in /home/moneroist/Github/monero/build/Linux/release-v0.17/release

jtgrassie commented 3 years ago

So you're not following the Monero build instructions:

cd monero git checkout release-v0.17 make

ghost commented 3 years ago

I have forgotten to add to post but yes I have made this git checkout release-v0.17

jtgrassie commented 3 years ago

I am doing exactly this...

and

yes I have made this...

are contradictory.

Follow the instructions, to the letter, for both Monero and pool, and it will work flawlessly.

ghost commented 3 years ago

OK so to clarify everything I run this script in ~/Github folder.

#!/bin/bash
git clone --recursive https://github.com/monero-project/monero
cd monero 
git checkout release-v0.17
git submodule sync && git submodule update
cmake -DMANUAL_SUBMODULES=1
make -j8
cd ..
git clone https://github.com/jtgrassie/monero-pool.git
cd monero-pool
make release

and this is output from this script pastebin.com error is at the bottom of log of course I have export MONERO_ROOT="$HOME/Github/monero" in my ~/.zshrc

jtgrassie commented 3 years ago

Where in the Monero build instruction (in the README) mentions running cmake -DMANUAL_SUBMODULES=1?? (hint, it doesn't).

Running cmake -DMANUAL_SUBMODULES=1 (in the repository root) blitzes the Monero Makefile which will mess up the rest of the defaults. So I'll repeat again: "Follow the instructions, to the letter, for both Monero and pool, and it will work flawlessly."

ghost commented 3 years ago

OK I get this worked, just external/miniupnp had some new commits and make -j8 didn't work without cmake -DMANUAL_SUBMODULES=1 but after commit unstaged changes make -j8 works standalone. I would like to thank you for your time and patience :smile:

ghost commented 3 years ago

Have another question, don't want to create next issue. How to calculate mining speed particular miner in terms H/s?

jtgrassie commented 3 years ago

OK I get this worked...

If you just followed the instructions from the start, you wouldn't have wasted either of our time here.

Have another question, don't want to create next issue.

Good. Please don't. This is a bug tracker not a general support channel or learning resource.