kyamagu / matlab-leveldb Goto Github PK
View Code? Open in Web Editor NEWMatlab LevelDB wrapper
License: Other
Matlab LevelDB wrapper
License: Other
After following the specific installation guide from Caffe (http://caffe.berkeleyvision.org/installation.html#specific-instructions-1), leveldb is installed using Homebrew and libstdc++ option.
Error using mex
Undefined symbols for architecture x86_64:
"leveldb::DB::Open(leveldb::Options const&, std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&, leveldb::DB**)", referenced
from:
(anonymous namespace)::Operation_new::operator()(int, mxArray_tag**, int, mxArray_tag
const**) in LevelDB_.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)</code>
Download the source directly from https://github.com/google/leveldb, and compile with default at another place.
leveldb.make('all', '-I/path/to/leveldb/include -L/path/to/leveldb')
Make fails on a fresh install of matlab-leveldb in Matlab R2013b, using gcc 4.8.2 in Ubuntu. The error is:
In file included from /usr/include/c++/4.8/type_traits:35:0,
from include/mexplus/mxtypes.h:10,
[...]
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
[...]
These are enabled. By adding $(MEX) -v to Makefile, the command which is executed is also printed:
g++ -c -Iinclude -Ileveldb-1.18/include -I/usr/local/MATLAB/extern/include -I/usr/local/MATLAB/simulink/include -DMATLAB_MEX_FILE -std=c++11 -ansi -D_GNU_SOURCE -fPIC -fno-omit-frame-pointer -pthread -DMX_COMPAT_32 -O -DNDEBUG "src/LevelDB_.cc"
It also fails with -std=gnu++11 and -std=c++0x.
Any idea what's wrong?
There is an error with the linking command:
-> g++ -O -fPIC -pthread -shared -Wl,--version-script,/usr/local/MATLAB/extern/lib/glnxa64/mexFunction.map -Wl,--no-undefined -o "+leveldb/private/LevelDB_.mexa64" LevelDB_.o leveldb-1.18/libleveldb.a -Wl,-rpath-link,/usr/local/MATLAB/bin/glnxa64 -L/usr/local/MATLAB/bin/glnxa64 -lmx -lmex -lmat -lm
/usr/bin/ld: leveldb-1.18/libleveldb.a(db_impl.o): relocation R_X86_64_32S against `_ZTVN7leveldb2DBE' can not be used when making a shared object; recompile with -fPIC
leveldb-1.18/libleveldb.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
[...]
I tried -std=gnu++11, -std=c++0x, and -std=c++11 in CXXFLAGS. Before adding -fPIC to LDFLAGS to mexopts.sh, the error was the same.
Does it have anything to do with
rm -f libleveldb.a
which is done earlier in the make?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.