Open jebej opened 9 years ago
Note: It seems that building the mongo-c-driver should build the libbson dlls too, maybe that would be a simpler path since the goal is really to get Mongo.jl working on Windows.
Hi, yes it would be nice to have support for Windows. If you have patches to make it work I would be happy to merge them in!
I tried looking at BinDeps but am still not sure exactly what is required to get the compilation to work on Windows, could you point me to some references?
To be honest I haven't explored the Windows side of things at all -- I'm on OS X myself. I would start by exploring the code in some of the other Julia packages that already work on Windows that are using external libraries, the source is available to all of them!
Hi, I have manually installed C-driver (with libbson dll) on my Windows machine but how can I use it with the package?
Go in the deps.jl file and manually enter the DLL location.
Thanks. I have added deps file with the following content for libBSON and Mongo but Julia can't load the library.
libBSON deps:
# This is an auto-generated file; do not edit
# Pre-hooks
# Macro to load a library
macro checked_lib(libname, path)
((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
quote const $(esc(libname)) = $path end
end
# Load dependencies
@checked_lib libbson "C:\\Julia\\v0.6\\LibBSON\\mongo-c-driver\\bin\\libbson-1.0.dll"
# Load-hooks
Mongo deps:
# This is an auto-generated file; do not edit
# Pre-hooks
# Macro to load a library
macro checked_lib(libname, path)
((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
quote const $(esc(libname)) = $path end
end
# Load dependencies
@checked_lib libmongoc "C:\\Julia\\v0.6\\Mongo\\mongo-c-driver\\bin\\libmongoc-1.0.dll"
# Load-hooks
julia> using Mongo, libBSON
ERROR: LoadError: LoadError: Unable to load
libmongoc (C:\Julia\v0.6\Mongo\mongo-c-driver\bin\libmongoc-1.0.dll)
Please re-run Pkg.build(package), and restart Julia.
@jebej Have you successfully used this package in Windows?
I have. What did you compile the DLLs with? Did the tests pass? You might be missing a Windows runtime DLL.
What I would try would be to copy the test executables in your mongo-c-driver\bin
and executing them from there to see if they work. This will tell you if you are missing DLLs. If you are missing DLLs, copy them in that folder.
Once that's done, if it still doesn't work, you can add that bin
folder to the Windows PATH
.
Make sure you restart the shell your are using after changing the path and try again. This is what I get: (i.e. no errors)
julia> Base.Libdl.dlopen("libmongoc-1.0.dll")
Ptr{Void} @0x000007fef5790000
@jebej thanks a lot for support!
I have recompiled the last version of mongo-c driver following the guide
http://mongoc.org/libmongoc/current/installing.html#building-on-windows
and I have added the bin
folder to the Windows PATH
and now everything works!
Would it be possible to add support for Windows?
I am not sure how to go about this but am willing to help.