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

libmongoc not defined #88

Closed
pptav0 opened this issue Nov 2, 2021 · 3 comments
Closed

libmongoc not defined #88

pptav0 opened this issue Nov 2, 2021 · 3 comments

Comments

@pptav0
Copy link

pptav0 commented Nov 2, 2021

Hi, I'm trying to connect my app to my Mongo DB using Julia. I am finding next error and I've not found any reference yet. I hope you may have some clue

julia> client = Mongoc.Client()

ERROR: UndefVarError: libmongoc not defined
Stacktrace:
 [1] mongoc_uri_new_with_error(uri_string::String, bson_error_ref::Base.RefValue{Mongoc.BSONError})
   @ Mongoc ~/.julia/packages/Mongoc/gXfqP/src/c_api.jl:351
 [2] URI
   @ ~/.julia/packages/Mongoc/gXfqP/src/types.jl:97 [inlined]
 [3] Mongoc.Client(uri::String)
   @ Mongoc ~/.julia/packages/Mongoc/gXfqP/src/client.jl:27
 [4] client_mongo(config::Dict{String, Any})
   @ Main ~/Codes/Projects/backtest/data/src/utils/database.jl:14
 [5] client_mongo()
   @ Main ~/Codes/Projects/backtest/data/src/utils/database.jl:8
 [6] top-level scope
   @ REPL[23]:1

Pkg.status()

BSON v0.3.4
HTTP v0.8.19
JSON v0.21.2
Mongoc v0.6.2
SimpleWebsockets v0.2.1
StatsBase v0.33.12
WebSockets v1.5.9
@pptav0 pptav0 changed the title libmongoc not found libmongoc not defined Nov 2, 2021
@pptav0
Copy link
Author

pptav0 commented Nov 2, 2021

I followed this instructions and then libmongoc appears installed in /opt/homebrew/lib, not sure if I need to symlink somewhere else so Pkg.add("Mongoc") could find it

@giordano
Copy link
Contributor

giordano commented Nov 3, 2021

@pptav0 when you report this kind of issues please provide as many details as possible, in particular about your operating system. By the fact you mention homebrew I presume you are on macOS, but what architecture? Is that ARM or Intel? In the former case this is a duplicate of #86

@pptav0
Copy link
Author

pptav0 commented Nov 3, 2021

Thank you for the reply. I checked duplicated issued and it worked. I am adding my system info for further reference.

julia> versioninfo()
Julia Version 1.7.0-rc2
Commit f23fc0d27a (2021-10-20 12:45 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin20.6.0)
  CPU: Apple M1
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, cyclone)

Result after building new update

(dummy) pkg> add Mongoc
    Updating registry at `~/.julia/registries/General.toml`
   Resolving package versions...
   Installed MongoC_jll ─ v1.19.1+0
  Downloaded artifact: MongoC
  Downloaded artifact: MongoC

...

Precompiling project...
  3 dependencies successfully precompiled in 5 seconds (9 already precompiled)

julia> using Mongoc

julia> Mongoc.Client()
Client(URI("mongodb://localhost:27017"))

@pptav0 pptav0 closed this as completed Nov 3, 2021
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

No branches or pull requests

2 participants