Compiling from source on FreeBSD 9.1
Hello,
I've stuck on couchstore compilation with this error:
gmake[1]: Entering directory `/tmp/couchbase-server_src/couchstore' /bin/sh ./libtool --tag=CC --mode=link gcc -std=c99 -D__STDC_FORMAT_MACROS -g -O2 -DHAVE_VISIBILITY=1 -fvisibility=hidden -L/tmp/couchbase-server_src/install/lib -o couch_dbdump src/couch_dbdump-dbdump.o libcouchstore.la libbyteswap.la -lsnappy -lm libtool: link: gcc -std=c99 -D__STDC_FORMAT_MACROS -g -O2 -DHAVE_VISIBILITY=1 -fvisibility=hidden -o .libs/couch_dbdump src/couch_dbdump-dbdump.o -L/tmp/couchbase-server_src/install/lib ./.libs/libcouchstore.so -lpthread ./.libs/libbyteswap.a -lsnappy -lm -Wl,-rpath -Wl,/tmp/couchbase-server_src/install/lib ./.libs/libcouchstore.so: undefined reference to `std::string::resize(unsigned long, char)' ./.libs/libcouchstore.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' ./.libs/libcouchstore.so: undefined reference to `operator delete(void*)' ./.libs/libcouchstore.so: undefined reference to `operator new[](unsigned long)' ./.libs/libcouchstore.so: undefined reference to `std::string::_M_leak_hard()' ./.libs/libcouchstore.so: undefined reference to `std::ios_base::Init::~Init()' ./.libs/libcouchstore.so: undefined reference to `__cxa_pure_virtual' ./.libs/libcouchstore.so: undefined reference to `std::cerr' ./.libs/libcouchstore.so: undefined reference to `operator delete[](void*)' ./.libs/libcouchstore.so: undefined reference to `__gxx_personality_v0' ./.libs/libcouchstore.so: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)' ./.libs/libcouchstore.so: undefined reference to `std::ios_base::Init::Init()' ./.libs/libcouchstore.so: undefined reference to `vtable for __cxxabiv1::__si_class_type_info' ./.libs/libcouchstore.so: undefined reference to `std::string::_Rep::_M_destroy(std::allocator<char> const&)' ./.libs/libcouchstore.so: undefined reference to `std::string::_Rep::_S_empty_rep_storage' ./.libs/libcouchstore.so: undefined reference to `vtable for __cxxabiv1::__class_type_info' ./.libs/libcouchstore.so: undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' collect2: error: ld returned 1 exit status gmake[1]: *** [couch_dbdump] Error 1 gmake[1]: Leaving directory `/tmp/couchbase-server_src/couchstore' gmake: *** [make-install-couchstore] Error 2
➜ couchstore ldd .libs/libcouchstore.so .libs/libcouchstore.so: libthr.so.3 => /lib/libthr.so.3 (0x801211000) libm.so.5 => /lib/libm.so.5 (0x801433000) libgcc_s.so.1 => /usr/local/lib/gcc48/libgcc_s.so.1 (0x801654000) libc.so.7 => /lib/libc.so.7 (0x80081a000) ➜ couchstore gcc --version gcc (FreeBSD Ports Collection) 4.8.0 20130113 (experimental) Copyright (C) 2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Well, frankly first I stuck on memcached compilation, then on snappy -fPIC thing, but this one killed me completely :) Would be glad to any help here :)
Hi
were you able to start it correctly?
I was able to compile (the only thing I had to do is with sugar to use utmpx instead of utmp), I also only built and deployed the "patched" version of erlang available in http://www.couchbase.com/wiki/display/couchbase/Build+Couchbase+Server+2.... I used other dependencies from standard ports.
And it was almost fine.
Almost mean I was able to start the application but got several errors related to start of moxi or memcached.
If you solved it, I would be interested to know how you solved it (for example detailed steps of the build). I will keep on searching meanwhile.
Best Regards
Hello,
Yes, I was able to run it and test everything.
I had this issue with utmp.h too, FreeBSD 9 uses utmpx so I had to patch it before compiling. Erlnag has been installed through ports with no issue. The worst thing was with couchstore, it didn't compile with the errors mentioned before, so I downloaded the latest version from github and replaces files from source archive, did autorun in couchstore folder and configure then it compiled with few warnings.
I started it with a few errors, first that memcached can't be run as root then that 11211 port is being used, I turned off our memcached instance and changed user to couchbase and run it again with no issues.
Hope it will help you.
Regards,
Nate
nateless,
you mentioned you were stuck with snappy for a while. i am trying to build from sources (2.0.1 on centos 6.3), and i am stuck at unable to find snappy while building couchstore. do you remember what you did?
cd couchstore && ./configure -C --prefix=/root/couchbase/install --disable-static --enable-shared
configure: loading cache config.cache
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
... then there is other stuff, and finally ...
checking snappy-c.h usability... no
checking snappy-c.h presence... no
checking for snappy-c.h... no
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking for inttypes.h... (cached) yes
checking for libsnappy... no
configure: error: Failed to locate snappy-c.h
make: *** [couchstore/Makefile] Error 1
Any pointers would be helpful? I have tried putting the snappy sources folder in all sorts of locations but to no avail.
thanks,
-Piyush
Sorry for the delayed reply,
I installed snappy with ports, with slight modification, don't remember which one, but I googled the error and successfully patched it.
Regards,
Nate
Nevermind :) Everything works fine.