mfp / ocaml-leveldb Goto Github PK
View Code? Open in Web Editor NEWOCaml bindings for Google's LevelDB
License: Other
OCaml bindings for Google's LevelDB
License: Other
Hi,
I am not sure if that's something that should be filed to the OPAM guys, but currently it's impossible to install ocaml-leveldb
from opam. This is the error I am getting:
=-=-= Installing leveldb.1.0.2 =-=-=
default Downloading https://opam.ocaml.org/archives/leveldb.1.0.2+opam.tar.gz
Downloading https://opam.ocaml.org/archives/leveldb.1.0.2+opam.tar.gz
Applying link_against_extra_libs.patch.
Building leveldb.1.0.2:
omake -j9
omake install prefix=/Users/sergi/.opam/4.01.0dev+trunk
[ERROR] The compilation of leveldb.1.0.2 failed.
Removing leveldb.1.0.2.
ocamlfind remove leveldb
===== ERROR while installing leveldb.1.0.2 =====
# opam-version 1.1.1
# os darwin
# command omake -j9
# path /Users/sergi/.opam/4.01.0dev+trunk/build/leveldb.1.0.2
# compiler 4.01.0dev+trunk
# exit-code 1
# env-file /Users/sergi/.opam/4.01.0dev+trunk/build/leveldb.1.0.2/leveldb-12555-2dea01.env
# stdout-file /Users/sergi/.opam/4.01.0dev+trunk/build/leveldb.1.0.2/leveldb-12555-2dea01.out
# stderr-file /Users/sergi/.opam/4.01.0dev+trunk/build/leveldb.1.0.2/leveldb-12555-2dea01.err
### stdout ###
# ...[truncated]
# --- Checking for ocamlopt.opt... (found /Users/sergi/.opam/4.01.0dev+trunk/bin/ocamlopt.opt)
# --- Checking whether ocamlc understands the "z" warnings... (yes)
# *** omake: finished reading OMakefiles (0.09 sec)
# --- Checking for gcc... (found /usr/bin/gcc)
# --- Checking for g++... (found /usr/bin/g++)
# --- Checking if ocamldep understands -modules... (yes)
# - scan src leveldb_stubs.o
# + g++ -I. -MM leveldb_stubs.cc
# *** omake: 36/61 targets are up to date
# *** omake: failed (0.31 sec, 6/6 scans, 4/4 rules, 24/129 digests)
### stderr ###
# leveldb_stubs.cc:26:10: fatal error: 'caml/mlvalues.h' file not found
# #include <caml/mlvalues.h>
# ^
#1 error generated.
# *** omake: targets were not rebuilt because of errors:
# <scanner src/leveldb_stubs.o>
# depends on: src/leveldb_stubs.cc
Thanks a lot.
I tried to install leveldb
via OPAM for OCaml 4.06.1. In OPAM, the leveldb
version is 1.1.2.
There are compilation errors that appear to be type mismatches between the bytes
and string
types in several places.
I started to patch these by hand, changing everything to bytes
, not sure if that will work.
I compiled leveldb
1.2 by hand with OCaml 4.06.1, that works fine. So probably the fix is just to update the OPAM package.
Since LevelDB says that โKeys and values are arbitrary byte arrays.โ, I was wondering whether general (marshallable) values are possible. The idea is to have a functor to "generate" the type specialized functions:
module Make : functor (T : sig type key type value end) -> sig
type db
...
val get : db -> T.key -> T.value option
...
end
(The db
type is not shared between generated modules to avoid calling different get
function on it.)
Hi I cannot install ocaml-leveldb on any of my macs (version 10.15.6).
Error: "The packages you requested declare the following system dependencies. Please make sure they are installed before retrying:
leveldb"
I have installed leveldb. I am using it with success with Rust for example. So it is not the issue of missing leveldb lib.
Best,
Michal
ubuntu@ip-172-30-1-130:~$ ocaml
OCaml version 4.04.2
Findlib has been successfully loaded. Additional directives:
<snip>
# #require "leveldb";;
/home/ubuntu/.opam/tezos/lib/leveldb: added to search path
# #require "leveldb";;os/lib/leveldb/leveldb.cma: loaded
Error: Reference to undefined global `Thread'
#
ubuntu@ip-172-30-1-130:~$ cat .ocamlinit
(* Added by OPAM. *)
let () =
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
with Not_found -> ()
;;
(* ## added by OPAM user-setup for ocamltop / base ## 3ec62baf6f9c219ae06d9814069da862 ## you can edit, but keep this line *)
#use "topfind";;
(* ## end of OPAM user-setup addition for ocamltop / base ## keep this line *)
ocaml pkg/build.ml native=true native-dynlink=true
ocamlfind ocamlopt -linkpkg -g -thread -package core -package leveldb -package scid lib/tick.cmx src/ldb_browser.cmx -o src/ldb_browser.native
+ ocamlfind ocamlopt -linkpkg -g -thread -package core -package leveldb -package scid lib/tick.cmx src/ldb_browser.cmx -o src/ldb_browser.native
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_open_native':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:329: undefined reference to `leveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:330: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_destroy':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:357: undefined reference to `leveldb::DestroyDB(std::string const&, leveldb::Options const&)'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_repair':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:368: undefined reference to `leveldb::RepairDB(std::string const&, leveldb::Options const&)'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_get':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:409: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_put':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:436: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_delete':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:461: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_mem':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:486: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o): In function `ldb_it_key_unsafe':
/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:623: undefined reference to `leveldb::Status::ToString() const'
/home/vb/.opam/4.02.3/lib/leveldb/libcamlleveldb.a(leveldb_stubs.o):/home/vb/.opam/4.02.3/build/leveldb.1.1.0/src/leveldb_stubs.c:646: more undefined references to `leveldb::Status::ToString() const' follow
collect2: error: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
Hi,
Thanks for this project first of all. I have a compilation issue:
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (0.02 sec)
The dependencies mentioned here are obviously satisfied, and I have installed all 4 requirements.
Would be nice to have this code functorized over either bytes / bigstrings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.