MoneroOcean / node-cryptonight-hashing

Cryptonight hashing functions for node.js
27 stars 111 forks source link

Compile errors for v8.0.0 #24

Closed BKdilse closed 5 years ago

BKdilse commented 5 years ago

I'm getting errors compiling version 8.0.0 on Ubuntu 16.04:

make: Entering directory '/home/locadmin/nodejs-pool/node_modules/cryptonight-hashing/build'
  CC(target) Release/obj.target/cryptonight-hashing/xmrig/crypto/asm/cn_main_loop.o
  CC(target) Release/obj.target/cryptonight-hashing/xmrig/crypto/asm/CryptonightR_template.o
  CXX(target) Release/obj.target/cryptonight-hashing/xmrig/crypto/cn_gpu_ssse3.o
  CXX(target) Release/obj.target/cryptonight-hashing/xmrig/common/cpu/Cpu.o
  CXX(target) Release/obj.target/cryptonight-hashing/xmrig/common/cpu/BasicCpuInfo.o
  CXX(target) Release/obj.target/cryptonight-hashing/multihashing.o
../multihashing.cc:85:18: warning: #warning Using IvyBridge assembler implementation [-Wcpp]
                 #warning Using IvyBridge assembler implementation
                  ^
../multihashing.cc:100:18: warning: #warning Using IvyBridge assembler implementation [-Wcpp]
                 #warning Using IvyBridge assembler implementation
                  ^
../multihashing.cc:127:18: warning: #warning Using IvyBridge assembler implementation [-Wcpp]
                 #warning Using IvyBridge assembler implementation
                  ^
../multihashing.cc: In member function ‘virtual void CCryptonightAsync::HandleOKCallback()’:
../multihashing.cc:355:37: error: ‘async_resource’ was not declared in this scope
             callback->Call(2, argv, async_resource);
                                     ^
../multihashing.cc: In member function ‘virtual void CCryptonightLightAsync::HandleOKCallback()’:
../multihashing.cc:429:37: error: ‘async_resource’ was not declared in this scope
             callback->Call(2, argv, async_resource);
                                     ^
../multihashing.cc: In member function ‘virtual void CCryptonightHeavyAsync::HandleOKCallback()’:
../multihashing.cc:501:37: error: ‘async_resource’ was not declared in this scope
             callback->Call(2, argv, async_resource);
                                     ^
../multihashing.cc: In member function ‘virtual void CCryptonightPicoAsync::HandleOKCallback()’:
../multihashing.cc:587:37: error: ‘async_resource’ was not declared in this scope
             callback->Call(2, argv, async_resource);
                                     ^
cryptonight-hashing.target.mk:131: recipe for target 'Release/obj.target/cryptonight-hashing/multihashing.o' failed
make: *** [Release/obj.target/cryptonight-hashing/multihashing.o] Error 1
make: Leaving directory '/home/locadmin/nodejs-pool/node_modules/cryptonight-hashing/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/locadmin/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.4.0-141-generic
gyp ERR! command "/home/locadmin/.nvm/versions/node/v8.11.3/bin/node" "/home/locadmin/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/locadmin/nodejs-pool/node_modules/cryptonight-hashing
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cryptonight-hashing@8.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cryptonight-hashing@8.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/locadmin/.npm/_logs/2019-02-23T11_59_25_228Z-debug.log

I can't work out where it's going wrong, please advise...

MoneroOcean commented 5 years ago

It is likely because you are using old nodejs version. Please update it:

source ~/.nvm/nvm.sh
nvm install v8.11.3
nvm alias default v8.11.3
BKdilse commented 5 years ago

I recently updated to v8.11.3, using, on all my pools. Looks like something did not go right on this pool. I've tried removing node_modules, but still no good.

BKdilse commented 5 years ago

To fix this, this is what I've done this morning:

rm node_modules -r
reboot
npm update
npm install

now no errors relating to the hashing module.

BKdilse commented 5 years ago

I've got this issue back on another pool. I've ran what I did last time, but it has not solved it.

Looking at the log file, it shows the following:

77 verbose stack Error: cryptonight-hashing@8.0.1 install: `node-gyp rebuild`
77 verbose stack Exit status 1
77 verbose stack     at EventEmitter.<anonymous> (/home/locadmin/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:285:16)
77 verbose stack     at emitTwo (events.js:126:13)
77 verbose stack     at EventEmitter.emit (events.js:214:7)
77 verbose stack     at ChildProcess.<anonymous> (/home/locadmin/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
77 verbose stack     at emitTwo (events.js:126:13)
77 verbose stack     at ChildProcess.emit (events.js:214:7)
77 verbose stack     at maybeClose (internal/child_process.js:925:16)
77 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
78 verbose pkgid cryptonight-hashing@8.0.1
79 verbose cwd /home/locadmin/nodejs-pool/bk
80 verbose Linux 4.4.0-141-generic
81 verbose argv "/home/locadmin/.nvm/versions/node/v8.11.3/bin/node" "/home/locadmin/.nvm/versions/node/v8.11.3/bin/npm" "install" "https://github.com/MoneroOcean/node-cryptonight-hashing.git"
82 verbose node v8.11.3
83 verbose npm  v5.6.0
84 error code ELIFECYCLE
85 error errno 1
86 error cryptonight-hashing@8.0.1 install: `node-gyp rebuild`
86 error Exit status 1
87 error Failed at the cryptonight-hashing@8.0.1 install script.
87 error This is probably not a problem with npm. There is likely additional logging output above.
88 verbose exit [ 1, true ]

I feel it's a version issue of some sort, or some residue left over from the older version of NodeJS (6.9.2). Any further ideas?

EDIT1: Just tried npm install https://github.com/MoneroOcean/node-cryptonight-hashing.git in a directory outside of ~/nodejs-pool, so ~/BKTest and it installs fine. Permissions look ok, so I'm now lost.

EDIT2: Now, back in the ~/nodejs-pool directory I renamed package.json, installed your module fine, restored package.json, ran npm install, and all is fine. Something conflicting in the package.json? I'm using the original Snipa22 one.

MoneroOcean commented 5 years ago

I think you should clean node_modules directrory before npm install, so old modules compiled with old nodejs will be removed this way.

BKdilse commented 5 years ago

I did try that, by simply deleting the directory, but it made no difference (I'm sure it worked when on one of my other pools, the last time I reported this). The only way that has worked for me is rename the package.json 1st. I'll look at it again, next time I have to update. Thanks.