Comments (12)
It works!
Thanks so much for your help!
from lua-mongo.
Note : the compiler gave me some trouble (I had to specify that I was using Lua 5.2, and it said : -- Using Lua '5.2', version 5.1.5), not sure if it's related.
This is probably related. Your mongo.so
is probably built against Lua 5.1 and not Lua 5.2. You can check this by issuing a command:
ldd /usr/local/lib/lua/5.2/mongo.so
Also, why use CMake? Try installing via LuaRocks.
from lua-mongo.
I'm not sure which library is Lua, so here's the whole output :
linux-vdso.so.1 (0x00007ffe94eee000)
libmongoc-1.0.so.0 => /usr/local/lib/libmongoc-1.0.so.0 (0x00007f3576947000)
libbson-1.0.so.0 => /usr/local/lib/libbson-1.0.so.0 (0x00007f3576908000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3576717000)
libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007f35766fa000)
libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007f3576668000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f3576393000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3576386000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f357636b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f3576348000)
/lib64/ld-linux-x86-64.so.2 (0x00007f3576a2d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3576342000)
I tried building with LuaRocks, but it couldn't detect libbson :
$ sudo luarocks make
[sudo] password for user:
Error: Could not find library file for LIBBSON
No file bson-1.0 in /usr/local/lib
No file bson-1.0 in /usr/local/lib/x86_64-linux-gnu
No file bson-1.0 in /usr/lib
No file bson-1.0 in /usr/lib/x86_64-linux-gnu
You may have to install LIBBSON in your system and/or pass LIBBSON_DIR or LIBBSON_LIBDIR to the luarocks command.
Example: luarocks install lua-mongo LIBBSON_DIR=/usr/local
Libbson was installed as a dependency when I installed the Mongo C Driver, but I can't seem to find any file names "bson-1.0" anywhere in any related folder.
Now that I notice it, it says "libbson-1.0.so.0" and the dependency asks for 1.16+. Am I looking at the correct place for the version number?
from lua-mongo.
Alright, I think I got it :
$ apt-cache show libbson-1.0
Package: libbson-1.0-0
Architecture: amd64
Version: 1.15.0-1
Priority: optional
Section: universe/libs
Source: mongo-c-driver
Origin: Ubuntu
"Version: 1.15.0-1", literally one below.
Do you know where I can find an up-to-date version of libbson? The Mongo C Driver site only tells me to download it from apt...
from lua-mongo.
from lua-mongo.
I've played a bit with the paths and found that both are in /usr/local.
Now I get a compilation error :
$ sudo luarocks install lua-mongo LIBBSON_DIR=/usr/local/ LIBMONGOC_DIR=/usr/local/
Installing https://luarocks.org/lua-mongo-1.2.1-1.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.2 -c src/bson.c -o src/bson.o -I/usr/local/include/libmongoc-1.0 -I/usr/local/include/libbson-1.0
In file included from src/bson.c:23:
src/common.h:25:10: fatal error: lauxlib.h: No such file or directory
25 | #include <lauxlib.h>
| ^~~~~~~~~~~
compilation terminated.
Error: Build error: Failed compiling object src/bson.o
Any ideas?
from lua-mongo.
Is there lauxlib.h in /usr/include/lua5.2 ?
from lua-mongo.
I think I found something...
/usr/include/lua5.1/lauxlib.h
Yes, Lua 5.1... No idea why, because running lua5.2
works, but running Lua5.1
only prompts me to install it through apt.
I manually renamed the folder to lua5.2 (I know I shouldn't do this but I'm investigating) and it compiled properly.
I'll keep following the installation steps and I'll come back with news ASAP. Thanks for putting me on the right road!
from lua-mongo.
Yes, it looks more and more that you have Lua 5.1 vs 5.2 messed up in the system. You need to untangle that first. Otherwise, things will go wonky.
from lua-mongo.
It also could be that you have Lua 5.1 headers installed but not for Lua 5.2. Try installing a lua5.2-devel package or whatever is relevant for your system. Note that you always need Lua headers to build modules written in C.
from lua-mongo.
It seems to work!
I did sudo apt-get install lua5.2-dev
, recompiled the module with LuaRocks, and the test script isn't printing any error anymore!
I'll try editing a collection to see if it really works :)
from lua-mongo.
Great! I’m closing this then....
from lua-mongo.
Related Issues (20)
- Find method how to select the specified column? HOT 1
- have a question HOT 1
- Install error HOT 5
- undefined symbol: mongoc_collection_replace_one HOT 4
- i have problem guy.how to find or aggregation ISODate. HOT 1
- Compile error HOT 2
- nginx content_by_lua_block gives an error if ssl is used HOT 3
- Process aborts due to a zero server_id HOT 1
- Session support HOT 4
- Unable to install lua-mongo with luarocks HOT 2
- insertOne question HOT 1
- cant get build via luarocks in windows HOT 1
- How to install on Windows? HOT 3
- When mongo has username and password, how can I do? HOT 2
- How to create a TTL index? HOT 4
- Lua-mongo can't be used with mongo-c-driver_v1.19 HOT 2
- Cannot create bson document with array indexed by numbers HOT 3
- building with luarocks mingw64 HOT 7
- The specified module could not be found? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lua-mongo.