heapwolf / ldb

A C++ REPL / CLI for LevelDB
MIT License
201 stars 23 forks source link

unable to build #40

Closed stephenmathieson closed 9 years ago

stephenmathieson commented 10 years ago

make on a fresh checkout results in:

[ . . . ]
c++ -I./deps/leveldb/include -std=gnu++11 -stdlib=libc++ -I. -I./include -DOS_MACOSX -DLEVELDB_PLATFORM_POSIX -DSNAPPY -O2 -DNDEBUG        -c port/port_posix.cc -o port/port_posix.o
rm -f libleveldb.a
ar -rs libleveldb.a db/builder.o db/c.o db/db_impl.o db/db_iter.o db/dbformat.o db/filename.o db/log_reader.o db/log_writer.o db/memtable.o db/repair.o db/table_cache.o db/version_edit.o db/version_set.o db/write_batch.o table/block.o table/block_builder.o table/filter_block.o table/format.o table/iterator.o table/merger.o table/table.o table/table_builder.o table/two_level_iterator.o util/arena.o util/bloom.o util/cache.o util/coding.o util/comparator.o util/crc32c.o util/env.o util/env_posix.o util/filter_policy.o util/hash.o util/histogram.o util/logging.o util/options.o util/status.o port/port_posix.o
ar: creating archive libleveldb.a
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C ./deps/snappy-1.1.1
make[1]: *** No targets specified and no makefile found.  Stop.
make: *** [snappy] Error 2

looks like we're expecting a makefile in ./deps/snappy-1.1.1, but there's nothing there :/

jwerle commented 10 years ago

yeah looks like make configure needs to be ran first :|

jwerle commented 10 years ago

Seems like snappy requires a lot just for this tool... Maybe a custom configure script to generate a HAVE_SNAPPY constant?

heapwolf commented 10 years ago

yeah, that's a good idea. PR anyone? I'm locked into another project at the moment.

wouterbeek commented 9 years ago

I have run into the same / a similar issue. From within ldb/deps/snappy-1.1.1 I run the following:

$ make configure
$ make install
/bin/sh ./libtool  --tag=CXX   --mode=link g++  -I./deps/leveldb/include -std=gnu++11 -version-info 3:0:2  -o libsnappy.la -rpath /usr/local/lib snappy.lo snappy-sinksource.lo snappy-stubs-internal.lo snappy-c.lo  
libtool: link: g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-redhat-linux/4.9.2/crtbeginS.o  .libs/snappy.o .libs/snappy-sinksource.o .libs/snappy-stubs-internal.o .libs/snappy-c.o   -L/usr/lib/gcc/x86_64-redhat-linux/4.9.2 -L/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-redhat-linux/4.9.2/crtendS.o /usr/lib/gcc/x86_64-redhat-linux/4.9.2/../../../../lib64/crtn.o    -Wl,-soname -Wl,libsnappy.so.1 -o .libs/libsnappy.so.1.2.0
g++: error: .libs/snappy.o: No such file or directory
g++: error: .libs/snappy-sinksource.o: No such file or directory
g++: error: .libs/snappy-stubs-internal.o: No such file or directory
g++: error: .libs/snappy-c.o: No such file or directory
Makefile:668: recipe for target 'libsnappy.la' failed
make: *** [libsnappy.la] Error 1

Directory .libs/ is indeed empty :-(. Any ideas on how to circumvent this?

heapwolf commented 9 years ago

Ok, i fixed this. on linux apt-get install libsnappy1 (i think) and on osx brew install snappy which makes snappy an optional dependency.

heapwolf commented 9 years ago

I also made it so that the make file git clones the deps instead of checking them in. Perhaps this is a better job for clib? /cc @stephenmathieson