Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leveldb does not build for riscv64 as AtomicPointer is not implemented #93

Open
lazyprogrammerio opened this issue Jul 16, 2024 · 1 comment · May be fixed by #94
Open

Leveldb does not build for riscv64 as AtomicPointer is not implemented #93

lazyprogrammerio opened this issue Jul 16, 2024 · 1 comment · May be fixed by #94

Comments

@lazyprogrammerio
Copy link

Command run:

There are two issues: leveldb and snappy. Leveldb was solved by adding a riscv assembly macro for Atomic (will make a PR on it).

Snappy Error:

rm -f Release/obj.target/deps/leveldb/leveldb.a Release/obj.target/deps/leveldb/leveldb.a.ar-file-list; mkdir -p `dirname Release/obj.target/deps/leveldb/leveldb.a`
ar crs Release/obj.target/deps/leveldb/leveldb.a @Release/obj.target/deps/leveldb/leveldb.a.ar-file-list
  COPY Release/leveldb.a
make: *** No rule to make target 'Release/obj.target/snappy/deps/snappy/snappy/snappy-sinksource.o', needed by 'Release/obj.target/deps/snappy/snappy.a'.  Stop.
make: Leaving directory '/classic-level/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/classic-level/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Linux 5.10.113+
gyp ERR! command "/usr/bin/node" "/classic-level/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /classic-level
gyp ERR! node -v v20.15.1
gyp ERR! node-gyp -v v9.4.1
gyp ERR! not ok
@lazyprogrammerio
Copy link
Author

The snappy error was due to the git submodules not being properly fetched.

The classic-level needs to be fixed for RISCV64:

gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/lodestar/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/lodestar/node_modules/classic-level/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/lodestar/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/20.15.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/20.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/lodestar/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/20.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/lodestar/node_modules/classic-level',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/lodestar/node_modules/classic-level/build'
  CXX(target) Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o
In file included from ../deps/leveldb/leveldb-1.20/port/port_posix.h:47,
                 from ../deps/leveldb/leveldb-1.20/port/port.h:16,
                 from ../deps/leveldb/leveldb-1.20/db/filename.h:14,
                 from ../deps/leveldb/leveldb-1.20/db/builder.cc:7:
../deps/leveldb/leveldb-1.20/port/atomic_pointer.h:229:2: error: #error Please implement AtomicPointer for this platform.
  229 | #error Please implement AtomicPointer for this platform.
      |  ^~~~~
make: *** [deps/leveldb/leveldb.target.mk:156: Release/obj.target/leveldb/deps/leveldb/leveldb-1.20/db/builder.o] Error 1
make: Leaving directory '/lodestar/node_modules/classic-level/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/lodestar/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
gyp ERR! System Linux 5.10.113+
gyp ERR! command "/usr/bin/node" "/lodestar/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /lodestar/node_modules/classic-level

The important error part is Please implement AtomicPointer for this platform -> which needs a fix.

@lazyprogrammerio lazyprogrammerio changed the title Leveldb does not build for riscv64 Leveldb does not build for riscv64 as AtomicPointer is not implemented Jul 16, 2024
@lazyprogrammerio lazyprogrammerio linked a pull request Jul 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant