c-rocksdb icon indicating copy to clipboard operation
c-rocksdb copied to clipboard

Fails to compile on DragonflyBSD

Open cgag opened this issue 10 years ago • 2 comments

I tried to go get cockroach, but I get this error:

# github.com/cockroachdb/c-rocksdb
In file included from internal/port/port.h:18:0,
                 from internal/db/filename.h:18,
                 from internal/util/auto_roll_logger.h:12,
                 from src/go/src/github.com/cockroachdb/c-rocksdb/auto_roll_logger.cc:6:
internal/port/port_posix.h:37:22: fatal error: endian.h: No such file or directory
compilation terminated.

I looked at the detect platform script and I can see it uses uname -s and compares it to DragonFly, which should define OS_DRAGONFLYBSD. That all looks correct but the if defined check still seems to fail in port_posix.h.

Let me know if there's any more information I can get for you if you don't have access to a dragonfly system.

cgag avatar Jul 04 '15 21:07 cgag

@cgag While rocksdb supports DragonFly, our c-rocksdb package doesn't (yet). Adding support should be pretty easy. You just need to add the appropriate cflags to https://github.com/cockroachdb/c-rocksdb/blob/master/cgo_flags.go with the build constraint of dragonfly. Something like:

// #cgo dragonfly CPPFLAGS: -DOS_DRAGONFLYBSD

petermattis avatar Jul 06 '15 14:07 petermattis

See https://github.com/cockroachdb/c-rocksdb/pull/12 And also https://github.com/cockroachdb/c-rocksdb/commit/4d67cb2d76c14b7d117fbcd95fa9586b7b92e048

knz avatar Dec 29 '15 13:12 knz