# github.com/dgraph-io/ristretto/z
vendor/github.com/dgraph-io/ristretto/z/calloc_jemalloc.go:73:9: could not determine kind of name for C.je_calloc
vendor/github.com/dgraph-io/ristretto/z/calloc_jemalloc.go:103:3: could not determine kind of name for C.je_free
vendor/github.com/dgraph-io/ristretto/z/calloc_jemalloc.go:143:2: could not determine kind of name for C.je_mallctl
vendor/github.com/dgraph-io/ristretto/z/calloc_jemalloc.go:170:2: could not determine kind of name for C.je_malloc_stats_print
Hi Abdul, did you use the makefile in badger to install jemalloc? Try running make badger and let us know what happens. Badger compiles with jemalloc on my MacOS machine.
@Vishal_Jangid I can’t speak personally for RHEL but I’d suggest the same advice to compile with make badger and report back what happens.
I cloned the dgraph-io/badger repository and executed make badger command which resulted in same error:
Compiling Badger binary...
# github.com/dgraph-io/ristretto/z
/go/pkg/mod/github.com/dgraph-io/ristretto@v0.1.1/z/calloc_jemalloc.go:73:9: could not determine kind of name for C.je_calloc
/go/pkg/mod/github.com/dgraph-io/ristretto@v0.1.1/z/calloc_jemalloc.go:103:3: could not determine kind of name for C.je_free
/go/pkg/mod/github.com/dgraph-io/ristretto@v0.1.1/z/calloc_jemalloc.go:143:2: could not determine kind of name for C.je_mallctl
/go/pkg/mod/github.com/dgraph-io/ristretto@v0.1.1/z/calloc_jemalloc.go:170:2: could not determine kind of name for C.je_malloc_stats_print
make[1]: *** [badger] Error 2
make: *** [badger] Error 2
It would be awesome, if you can guide us with the exact steps on how to build DGraph with MacOS and explicitly mention any external dependencies required separately.
Sorry for the delay. That is interesting - usually this error comes the Cgo preamble being misconfigured (e.g. see here) but it doesn’t look like that is the problem here.
Could you try running go install github.com/dgraph-io/badger/v4/badger@latest? This should also install the Badger CLI. Alternatively, if you want to build the CLI locally, you can try running go build . from the Badger subdirectory.
To be clear, if your goal is to build Dgraph from source, you don’t have to first build Badger, since this is just a CLI for debugging (Badger is an embedded key-value store). Instructions for building Dgraph are in the Dgraph readme.