Memcached doesn’t compile with -O3

Friday, June 20, 2014

Most of the ports in FreeBSD compile just fine with -O3, and why not use it? Not like compile time is a real constraint and one of the features of FreeBSD is that it is actually optimized for the hardware it runs on, rather than being generic, opaque code.

But memcached don’t play that game. The easy thing to do is modify /etc/make.conf on error, then fix it back after recompiling, but that gets tedious. The following edit to /etc/make.conf automates the process:

.if empty(.CURDIR:M/usr/ports/databases/memcached*)
CFLAGS= -O3 -pipe -march=native -mtune=native
.endif

.if (.CURDIR:M/usr/ports/databases/memcached*)
CFLAGS= -O2 -pipe -march=native -mtune=native
.endif

Summary
software image
Author Rating
1star1star1star1star1star
no rating based on 0 votes
Software Name
Memcached
Operating System
UN*X
Price
Free like speech and beer
Landing Page
Posted at 13:23:41 GMT-0700

Leave a Reply

286 Views