Compile fails on Mavericks (Xcode 5 really)

979 views
Skip to first unread message

Matt Galvin

unread,
Oct 23, 2013, 10:48:35 AM10/23/13
to memc...@googlegroups.com
Hello,

On both Mac OS X 10.8 and the new 10.9 with Xcode 5 memcached fails to compile. Is this a know issue already? Is there a fix in the works already?

./configure --enable-64bit --with-libevent=/usr/local

---

gcc -v

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/c++/4.2.1

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

Target: x86_64-apple-darwin13.0.0

Thread model: posix

---

gcc -DHAVE_CONFIG_H -I. -DNDEBUG -I/usr/local/include -m64 -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -MT memcached-cache.o -MD -MP -MF .deps/memcached-cache.Tpo -c -o memcached-cache.o `test -f 'cache.c' || echo './'`cache.c

mv -f .deps/memcached-cache.Tpo .deps/memcached-cache.Po

gcc -m64 -g -O2 -pthread -pthread -Wall -Werror -pedantic -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -L/usr/local/lib -Wl,-rpath,/usr/local/lib -o memcached memcached-memcached.o memcached-hash.o memcached-slabs.o memcached-items.o memcached-assoc.o memcached-thread.o memcached-daemon.o memcached-stats.o memcached-util.o memcached-cache.o -levent

clang: error: argument unused during compilation: '-pthread'

clang: error: argument unused during compilation: '-pthread'

make[2]: *** [memcached] Error 1

make[1]: *** [all-recursive] Error 1

make: *** [all] Error 2
---

If I manually remove the -pthread(s) it compiles fine but I'm not sure if that is the correct fix as I've not done any development on memcached as of yet.

Thoughts?

Thanks,

Matt

Felipe Cerqueira

unread,
Nov 21, 2013, 9:03:17 PM11/21/13
to memc...@googlegroups.com
Hello,


Trying to compile to OSX Mavericks, I got nor only pthread problem but this:
1) automake version compabilitie:
./autogen.sh
aclocal...
autoheader...
automake...
Did not find a supported automake

My automaker version: 1.14

2) testapp.c:
testapp.c:1812:13: error: variable length array folded to constant array as an extension [-Werror,-Wpedantic]

If accepted as a issue I would like to create a patch to fix it and better detect libpthread.

emcconville

unread,
Nov 29, 2013, 10:10:12 AM11/29/13
to memc...@googlegroups.com
Memcached v1.4.15 compiles just fine on OSX 10.9 with GCC v4.8.0. Xcode's LLVM+clang will have some configuration conflicts.
All conflicts are minor, and are more related to testing. In this case: clang works fine, but emits warnings that are treated as errors.
  • It's safe to remove the '-pthread' option from CFLAGS.
  • File testapp.c will need to be patched to address warning "variable length array folded to constant array as an extension." See pull request
  • Profile library `gcov` is not present in favor of an internal Xcode `profile_rt` library.
I'd recommend install & using GCC, but if you wish to use LLVM+clang, simply install from a working development branch:
Another option would be to import Memcached into Xcode as a CLI application project, and follow the step-by-step guide provided by Apple. (Docs & examples)
I'll have to double check, but I was under the impression Memcached already ships with Xcode.

Best of luck,
emcconville

dormando

unread,
Dec 9, 2013, 4:57:10 AM12/9/13
to memc...@googlegroups.com
Pushed your branch, thanks!

On Fri, 29 Nov 2013, emcconville wrote:

> Memcached v1.4.15 compiles just fine on OSX 10.9 with GCC v4.8.0. Xcode's LLVM+clang will have some configuration conflicts.
> All conflicts are minor, and are more related to testing. In this case: clang works fine, but emits warnings that are treated as errors.
> * It's safe to remove the '-pthread' option from CFLAGS.
> * File testapp.c will need to be patched to address warning "variable length array folded to constant array as an extension." See pull request
> * Profile library `gcov` is not present in favor of an internal Xcode `profile_rt` library.
> I'd recommend install & using GCC, but if you wish to use LLVM+clang, simply install from a working development branch:
> * Install automake
> * Grab development source (https://github.com/emcconville/memcached/archive/mavericks-support.tar.gz)
> * Extract & change directory
> * Run `./autogen.sh` (Note: This will kick-out an unknown version)
> * Compile with standard `./configure`, `make` & `make test`
> --
> �
> ---
> You received this message because you are subscribed to the Google Groups "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to memcached+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

vivek verma

unread,
Nov 29, 2014, 12:02:14 PM11/29/14
to memc...@googlegroups.com, matt.t...@gmail.com
Hi,
Can you please specify how to manually remove pthread?
I don't have certain rights in the system, so can't follow other solutions.
Thanks

vivek verma

unread,
Nov 29, 2014, 12:12:33 PM11/29/14
to memc...@googlegroups.com

--

---
You received this message because you are subscribed to a topic in the Google Groups "memcached" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/memcached/Ek5Z8VULEgc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to memcached+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

dormando

unread,
Nov 29, 2014, 2:21:34 PM11/29/14
to memc...@googlegroups.com
Please use a newer source tarball from http://memcached.org/ - this was
fixed ages ago.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "memcached" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to memcached+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages