ameetgohil / signalflip-js

verilator testbench w/ Javascript using N-API
MIT License
18 stars 3 forks source link

node: symbol lookup error #5

Closed drom closed 5 years ago

drom commented 5 years ago

npm run compile

node: symbol lookup error: /home/drom/work/github/ameetgohil/veri-js/build/Release/dut.node:
undefined symbol: _ZN9Verilated5mkdirEPKc
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! veri-js@1.0.0 test: `node index.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the veri-js@1.0.0 test 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/drom/.npm/_logs/2018-12-18T20_52_51_103Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! veri-js@1.0.0 all: `npm run clean && npm run compile && npm run build && npm run test`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the veri-js@1.0.0 all 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/drom/.npm/_logs/2018-12-18T20_52_51_117Z-debug.log

2018-12-18T20_52_51_117Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/home/drom/.nvm/versions/node/v10.14.2/bin/node',
1 verbose cli   '/home/drom/.nvm/versions/node/v10.14.2/bin/npm',
1 verbose cli   'run',
1 verbose cli   'test' ]
2 info using npm@6.4.1
3 info using node@v10.14.2
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle veri-js@1.0.0~pretest: veri-js@1.0.0
6 info lifecycle veri-js@1.0.0~test: veri-js@1.0.0
7 verbose lifecycle veri-js@1.0.0~test: unsafe-perm in lifecycle true
8 verbose lifecycle veri-js@1.0.0~test: PATH: /home/drom/.nvm/versions/node/v10.14.2/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/drom/work/github/ameetgohil/veri-js/node_modules/.bin:/home/drom/.nvm/versions/node/v10.14.2/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/drom/work/github/ameetgohil/veri-js/node_modules/.bin:/tmp/verilator/v3.922.0/bin:/tmp/verilator/v3.922.0/bin:/home/drom/.nvm/versions/node/v10.14.2/bin:/home/drom/bin:/usr/local/bin:/usr/bin:/bin:./node_modules/.bin:./node_modules/.bin
9 verbose lifecycle veri-js@1.0.0~test: CWD: /home/drom/work/github/ameetgohil/veri-js
10 silly lifecycle veri-js@1.0.0~test: Args: [ '-c', 'node index.js' ]
11 info lifecycle veri-js@1.0.0~test: Failed to exec test script
12 verbose stack Error: veri-js@1.0.0 test: `node index.js`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/home/drom/.nvm/versions/node/v10.14.2/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at ChildProcess.emit (events.js:182:13)
12 verbose stack     at maybeClose (internal/child_process.js:962:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
13 verbose pkgid veri-js@1.0.0
14 verbose cwd /home/drom/work/github/ameetgohil/veri-js
15 verbose Linux 4.19.7-1-default
16 verbose argv "/home/drom/.nvm/versions/node/v10.14.2/bin/node" "/home/drom/.nvm/versions/node/v10.14.2/bin/npm" "run" "test"
17 verbose node v10.14.2
18 verbose npm  v6.4.1
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error veri-js@1.0.0 test: `node index.js`
23 error spawn ENOENT
24 error Failed at the veri-js@1.0.0 test script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]
ameetgohil commented 5 years ago

do you have verilator and python installed?

ameetgohil commented 5 years ago

npm run compile should output this

npm run compile

> veri-js@1.0.0 compile /home/qubits/proj/veri-js
> make verilate && cd obj_dir && make -f ../Makefile_obj createlib

-- Verilator tracing example

-- VERILATE ----------------
verilator  -cc --exe -O2 -x-assign 0 -Wall --trace --assert --coverage -f src/input.vc src/top.sv 
created lib

archiving to verilator_global_libs.a
ar r verilator_global_libs.a *.o
drom commented 5 years ago

With the latest code npm run compile is ok, but npm run all is failing:

> veri-js@1.0.0 test /home/drom/work/github/ameetgohil/veri-js
> node index.js

Enabling waves into logs/vlt_dump.vcd...
node: symbol lookup error: /home/drom/work/github/ameetgohil/veri-js/build/Release/dut.node: undefined symbol: _ZN9Verilated5mkdirEPKc
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! veri-js@1.0.0 test: `node index.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the veri-js@1.0.0 test 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/drom/.npm/_logs/2018-12-22T05_23_10_151Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! veri-js@1.0.0 all: `npm run clean && npm run compile && npm run build && npm run test`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the veri-js@1.0.0 all 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/drom/.npm/_logs/2018-12-22T05_23_10_165Z-debug.log
drom@linux-sydi:~/work/github/ameetgohil/veri-js> 
ameetgohil commented 5 years ago

What is the output of the command npm run build? Also, does the folder "/usr/local/share/verilator/include" exist?

drom commented 5 years ago

It works with the latest Verilator v4.008 but not with the v3.922

drom commented 5 years ago

yes, I had 4.007 in the /usr/local/share/verilator/include path. You should not assume that Verilator is installed globally this way. https://www.veripool.org/projects/verilator/wiki/Installing Look at the README file in the source: https://github.com/sifive/verilator/blob/master/README.pod#installation

drom commented 5 years ago

Opening separate issue for the include path #8