Code Monkey home page Code Monkey logo

Comments (9)

chetmurthy avatar chetmurthy commented on September 26, 2024 1

OK, done. Now that I'm all hep to opam and stuff, I'll go thru and cleanup everything add real tests, switch to Makefiles for build, etc, etc. Should take a day-or-two.

Please don't stop to debug if you have problems; just contact me right away and let me debug for you.

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

Oh geez, this is such old code at this point: I'm surprised anybody even notices it! But I think it's still a great way to solve this problem, and was just waiting for somebody to want to use it to go and refurbish it, get it working with modern OCaml.

Let me get it working on my system, and I'll report back? I'm sure it's solvable. And after that, I'll (even) look into distributing it via opam!

Thanks for trying, and for reporting the problem instead of just giving up! I'll be back with news soon!

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

OK, I just built and it went fine. My machine below. This doesn't mean that it actually works: I'll need to build ocaml-rocksdb (next on the list) to verify that. I see that I'm using g++ 9.3.0, not 11.2. Gee, wonder if that's the issue. I see that for Ubuntu, g++ 10 is available, and I could upgrade to that. But this is my home server, and I'm a little loath to make such changes. By some chance can you try this with g++ 10 ? Then if that also fails, I could upgrade to g++ 10 and debug ?

Or, heck, if you can downgrade to g++ 9.3, that'd be even better: anything to reduce the distance between your config and mine.

chet@digg:/Hack/Camlp5/src/ocaml-cppffigen$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
chet@digg:
/Hack/Camlp5/src/ocaml-cppffigen$ g++ --version
g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

chet@digg:~/Hack/Camlp5/src/ocaml-cppffigen$ ocaml -version
The OCaml toplevel, version 4.13.1

from ocaml-cppffigen.

danvonk avatar danvonk commented on September 26, 2024

Sure, I can try on those versions

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

If you can use this software, I'm happy to get it both working on your preferred platforms, and make its use as seamless as possible. And obviously any feedback would be welcome. Just wanna debug this issue before getting on with all that.

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

FYI, some more data: I'm getting the same error as you, with ocaml-rocksdb. So I suspect the issue is something to do with include-files not being in there correctly. I'll report back once I narrow it down. This was with G++ unchanged from above, so maybe the problem isn't on your end.

If you haven't yet (gosh, it's only been an hour grin) tried with G++ 10.x, might as well hold off until I resolve this.

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

OK, so it's been so long that I forgot about the example! I see that that's what's failing. And (HA!) it fails the same way for me. So I'll go debug that. FWIW, ocaml-rocksdb had a minor bug (b/c not compat with the rocksdb installed on my machine, and rocksdb changes so much from version-to-version, sigh).

Anyway, getting to the bottom of this! So just rest easy, it'll all be resolved soon, I suspect.

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

Alright, I know the problem, and am surprised that it worked back in the day. Here's a patch, but really, you should wait until I checkin, which shouldn't be too long.
modified cppffi.inc
@@ -72,7 +72,7 @@ void ml2c(const value v, uint64_t *cv) { *cv = Int64_val(v) ; }
value c2ml(const std::string& v) {
uint32_t size = v.size() ;
value res = caml_alloc_string(size);

  • memmove(String_val(res), v.c_str(), size);
  • memmove((void *)String_val(res), (const void *)v.c_str(), size);
    return res ;
    }

from ocaml-cppffigen.

chetmurthy avatar chetmurthy commented on September 26, 2024

OK, I've switched this package over to opam, so at some point when things get thru the system, you should be able to install the package "cppffigen". I'll go over to the ocaml-rocksdb package and work on getting that updated now.

from ocaml-cppffigen.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.