ethereum / ethash

188 stars 515 forks source link

not able to make benchmark_full #123

Closed manwapri closed 4 years ago

manwapri commented 4 years ago

getting below errors

========================================================================

[root@localhost build]# make Benchmark_FULL [ 71%] Built target ethash Scanning dependencies of target Benchmark_FULL [ 85%] Building CXX object src/benchmark/CMakeFiles/Benchmark_FULL.dir/benchmark.cpp.o /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp: In function ‘int main()’: /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:108:2: error: ‘ethash_params’ was not declared in this scope ethash_params params; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:108:16: error: expected ‘;’ before ‘params’ ethash_params params; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:109:22: error: ‘params’ was not declared in this scope ethash_params_init(&params, 0); ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:109:31: error: ‘ethash_params_init’ was not declared in this scope ethash_params_init(&params, 0); ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:129:2: error: ‘ethash_cache’ was not declared in this scope ethash_cache cache; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:129:15: error: expected ‘;’ before ‘cache’ ethash_cache cache; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:130:2: error: ‘cache’ was not declared in this scope cache.mem = cache_mem; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:135:40: error: ‘ethash_mkcache’ was not declared in this scope ethash_mkcache(&cache, &params, &seed); ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:146:58: error: invalid use of incomplete type ‘struct ethash_light’ ethash_light(&hash, &cache, &params, &previous_hash, 0); ^ In file included from /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:25:0: /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/../libethash/ethash.h:58:8: error: forward declaration of ‘struct ethash_light’ struct ethash_light; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:153:54: error: ‘ethash_compute_full_data’ was not declared in this scope ethash_compute_full_data(full_mem, &params, &cache); ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:175:58: error: invalid use of incomplete type ‘struct ethash_full’ ethash_full(&hash, full_mem, &params, &previous_hash, 0); ^ In file included from /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:25:0: /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/../libethash/ethash.h:60:8: error: forward declaration of ‘struct ethash_full’ struct ethash_full; ^ /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:248:64: error: invalid use of incomplete type ‘struct ethash_full’ ethash_full(&hash, full_mem, &params, &previous_hash, nonce); ^ In file included from /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/benchmark.cpp:25:0: /home/project_ethash/ethash_by_xilix/ethash/src/benchmark/../libethash/ethash.h:60:8: error: forward declaration of ‘struct ethash_full’ struct ethash_full; ^ make[3]: [src/benchmark/CMakeFiles/Benchmark_FULL.dir/benchmark.cpp.o] Error 1 make[2]: [src/benchmark/CMakeFiles/Benchmark_FULL.dir/all] Error 2 make[1]: [src/benchmark/CMakeFiles/Benchmark_FULL.dir/rule] Error 2 make: [Benchmark_FULL] Error 2 [root@localhost build]#

manwapri commented 4 years ago

install all python dependencies and done pip install pysha3 pyethereum nose export GIT_DISCOVERY_ACROSS_FILESYSTEM=1

for the above error, you need to install g++ packages sudo yum install -y *g++*

please find the below procedure to compile the ethash program,

ethash clone and compile procedure:

sudo yum install -y *gcc* sudo yum install -y *g++* sudo yum install -y *libboost* sudo yum install -y python sudo yum install -y python-virtualenv* sudo yum install -y cryptopp sudo yum install -y *opencl* wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh sudo sh xrtdeps.sh sudo yum install -y cmake sudo yum install -y git git clone https://github.com/ethereum/ethash.git cd ethash/ git checkout v23.1 sed -i '16 s/^/pip install --upgrade pip\npip install nose\npip install pysha3\n/' ./test/python/test.sh sed -i '39 s/^/#include \n/' ./src/benchmark/benchmark.cpp make cd test/c/build make ethash make Benchmark_FULL ./src/benchmark/Benchmark_FULL

manwapri commented 4 years ago

program has been compiled

SaphyNguyen commented 3 years ago

Hi,

I also have same issue in Ubuntu, could you help to fix it?

Thanks,

manwapri commented 3 years ago

I have shared the solution, check the issues tab or pulled request tab on github.

On Thu, 18 Feb 2021, 10:47 am Saphy Nguyen, notifications@github.com wrote:

Hi,

I also have same issue in Ubuntu, could you help to fix it?

Thanks,

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ethereum/ethash/issues/123#issuecomment-781061490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2LSM5JEDHS32JIL3TJBXTS7SPGVANCNFSM4LSOZZQA .

SaphyNguyen commented 3 years ago

Many thanks, manwapri

manwapri commented 3 years ago

cool beans.

On Thu, 18 Feb 2021, 2:02 pm Saphy Nguyen, notifications@github.com wrote:

Many thanks, manwapri

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ethereum/ethash/issues/123#issuecomment-781163039, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2LSMYSIZISNXQFF6B3K23S7TGCHANCNFSM4LSOZZQA .

shlgmbr commented 2 years ago

I am getting the same issue while making a build on ubuntu but when trying on Red hat I am getting the following error.

[ 66%] Built target ethash [ 83%] Building CXX object src/benchmark/CMakeFiles/Benchmark_FULL.dir/benchmark.cpp.o /home/ec2-user/ethash/src/benchmark/benchmark.cpp:39:10: error: #include expects "FILENAME" or

include

      ^

/home/ec2-user/ethash/src/benchmark/benchmark.cpp:87:13: error: 'string' in namespace 'std' does not name a type static std::string bytesToHexString(uint8_t const* bytes, unsigned size) ^~ /home/ec2-user/ethash/src/benchmark/benchmark.cpp:87:8: note: 'std::string' is defined in header ''; did you forget to '#include '? /home/ec2-user/ethash/src/benchmark/benchmark.cpp:39:1: +#include

include

/home/ec2-user/ethash/src/benchmark/benchmark.cpp:87:8: static std::string bytesToHexString(uint8_t const bytes, unsigned size) ^~~ /home/ec2-user/ethash/src/benchmark/benchmark.cpp: In function 'int main()': /home/ec2-user/ethash/src/benchmark/benchmark.cpp:132:86: error: 'bytesToHexString' was not declared in this scope debugf("ethash_mkcache: %ums, sha3: %s\n", (unsigned)((time1000)/CLOCKS_PER_SEC), bytesToHexString(cache_hash,sizeof(cache_hash)).data()); ^~~~ /home/ec2-user/ethash/src/benchmark/benchmark.cpp:169:91: error: 'bytesToHexString' was not declared in this scope debugf("ethash_full test: %uns, %s\n", (unsigned)((time*1000000)/CLOCKS_PER_SEC), bytesToHexString(hash.result, 32).data()); ^~~~ make[3]: [src/benchmark/CMakeFiles/Benchmark_FULL.dir/build.make:76: src/benchmark/CMakeFiles/Benchmark_FULL.dir/benchmark.cpp.o] Error 1 make[2]: [CMakeFiles/Makefile2:158: src/benchmark/CMakeFiles/Benchmark_FULL.dir/all] Error 2 make[1]: [CMakeFiles/Makefile2:165: src/benchmark/CMakeFiles/Benchmark_FULL.dir/rule] Error 2 make: [Makefile:137: Benchmark_FULL] Error 2

please help