Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

Compiling from source on FreeBSD 9.1

5 replies [Last post]
  • Login or register to post comments
Thu, 02/07/2013 - 13:47
nateless
Offline
Joined: 02/07/2013
Groups: None

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 :)

Top
  • Login or register to post comments
Thu, 02/07/2013 - 15:37
nateless
Offline
Joined: 02/07/2013
Groups: None

Nevermind :) Everything works fine.

Top
  • Login or register to post comments
Fri, 02/08/2013 - 11:52
pcohen
Offline
Joined: 02/01/2013
Groups: None

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

Top
  • Login or register to post comments
Fri, 02/08/2013 - 17:43
nateless
Offline
Joined: 02/07/2013
Groups: None

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

Top
  • Login or register to post comments
Tue, 04/09/2013 - 03:37
p77gin
Offline
Joined: 07/26/2012
Groups: None

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

Top
  • Login or register to post comments
Thu, 04/25/2013 - 11:13
nateless
Offline
Joined: 02/07/2013
Groups: None

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

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker