dryman/opic

Compile Errors

manjus3 opened this issue · 7 comments

Hi dryman,

Thanks for making this library available to the public. I'm eager to try but am running into build issues. I simply cloned the repo, ran bootstrap.sh, followed by ./configure, and make. Please take a look below and let me know if I'm missing anything. I do have log4c and cmocka installed. First, here's the output from the uname command:
Linux manju-VirtualBox 4.13.0-38-generic #43-Ubuntu SMP Wed Mar 14 15:20:44 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

And now the build errors, showing the last few lines:
libtool: link: gcc -shared -fPIC -DPIC common/.libs/op_log.o malloc/.libs/op_malloc.o malloc/.libs/allocator.o malloc/.libs/deallocator.o malloc/.libs/init_helper.o malloc/.libs/lookup_helper.o hash/.libs/cityhash.o hash/.libs/op_hash_table.o hash/.libs/pascal_hash_table.o -g -O2 -Wl,-soname -Wl,libopic.so.0 -o .libs/libopic.so.0.0.0
libtool: link: (cd ".libs" && rm -f "libopic.so.0" && ln -s "libopic.so.0.0.0" "libopic.so.0")
libtool: link: (cd ".libs" && rm -f "libopic.so" && ln -s "libopic.so.0.0.0" "libopic.so")
libtool: link: ar cru .libs/libopic.a common/op_log.o malloc/op_malloc.o malloc/allocator.o malloc/deallocator.o malloc/init_helper.o malloc/lookup_helper.o hash/cityhash.o hash/op_hash_table.o hash/pascal_hash_table.o
ar: u' modifier ignored since D' is the default (see `U')
libtool: link: ranlib .libs/libopic.a
libtool: link: ( cd ".libs" && rm -f "libopic.la" && ln -s "../libopic.la" "libopic.la" )
make[3]: Leaving directory '/home/manju/opic/opic'
make[2]: Leaving directory '/home/manju/opic/opic'
Making all in benchmark
make[2]: Entering directory '/home/manju/opic/benchmark'
Making all in malloc
make[3]: Entering directory '/home/manju/opic/benchmark/malloc'
gcc -DHAVE_CONFIG_H -I. -I../.. -g -O2 -Wall -MT malloc_bench.o -MD -MP -MF .deps/malloc_bench.Tpo -c -o malloc_bench.o malloc_bench.c
mv -f .deps/malloc_bench.Tpo .deps/malloc_bench.Po
/bin/bash ../../libtool --tag=CC --mode=link gcc -g -O2 -Wall -static -o malloc_bench malloc_bench.o ../../opic/libopic.la -latomic -L/usr/local/lib -llog4c
libtool: link: gcc -g -O2 -Wall -o malloc_bench malloc_bench.o ../../opic/.libs/libopic.a -latomic -L/usr/local/lib /usr/local/lib/liblog4c.so /usr/lib/x86_64-linux-gnu/libexpat.so -lpthread
make[3]: Leaving directory '/home/manju/opic/benchmark/malloc'
Making all in robin_hood
make[3]: Entering directory '/home/manju/opic/benchmark/robin_hood'
Making all in spookyhash-c
make[4]: Entering directory '/home/manju/opic/benchmark/robin_hood/spookyhash-c'
make[4]: *** No rule to make target 'all'. Stop.
make[4]: Leaving directory '/home/manju/opic/benchmark/robin_hood/spookyhash-c'
Makefile:711: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/manju/opic/benchmark/robin_hood'
Makefile:363: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/manju/opic/benchmark'
Makefile:484: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/manju/opic'
Makefile:392: recipe for target 'all' failed
make: *** [all] Error 2

Thanks,
Manju

Did you try: git submodule update --init --recursive?
The error was due to a dependency spookyhash-c didn't get compiled.
Let me know how it goes.

Sorry for slow reply. I'll test it with valgrind and see what went wrong.

Sorry for slow reply

Regarding your questions:

  1. Unfortunately, for user structs/data that has pointers to other data, it is not supported.
    You can define data structures using the pointer opic provides. However, any data that uses the pointer that opic doesn't recognize, it will segfault when reading it back from disk.

  2. It is actually natural for valgrind to fail.
    The program writes the pointer to disk and does not free the address, which is intended.
    The idea of opic is to continue the use of pointer in next process.
    Therefore the pointer cannot be freed when program ends.
    Having non-freed pointer, or uninitialized pointer when reading it back from disk is a natural thing.

I wrote a blog post for how it works.
http://www.idryman.org/blog/2017/06/28/opic-a-memory-allocator-for-fast-serialization/