Rick

Rick
Rick

Friday, May 16, 2014

Installing wrk on OSX

  • Go to app store and install OSX developer tools, i.e., Xcode.
  • Ensure that you have the xcode command line tools installed.
xcode-select --install 
  • Install brew see instructions at: http://brew.sh/ (Very simple process)
  • Install openssl latest lib this will put lib files and *.h files on your OSX box
brew install openssl
  • If you do not have git then install it
brew install git
  • Ensure that the search order for openssl and brew is ahead of system bin
  • You can do the last step by putting this in your ~/.profile
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • Note that brew installs packages to /usr/local/bin
  • Download the source code
 git clone https://github.com/wg/wrk.git
 cd wrk
  • Now you need to edit the Makefile and add a few things
Change the first two lines from:
CFLAGS  := -std=c99 -Wall -O2 -D_REENTRANT 
LIBS    := -lpthread -lm -lcrypto -lssl 
To:
CFLAGS  := -std=c99 -Wall -O2 -D_REENTRANT -I/usr/local/opt/openssl/include
LIBS    := -lpthread -lm -lcrypto -lssl -L/usr/local/opt/openssl/lib
  • Note the last step just adds the libs and headers to the openssl that brew installed.
  • Now run make
  make
  • Expected output
$ make
CC src/wrk.c
CC src/net.c
CC src/ssl.c
CC src/aprintf.c
CC src/stats.c
CC src/script.c
CC src/units.c
CC src/ae.c
CC src/zmalloc.c
CC src/http_parser.c
CC src/tinymt64.c
LUAJIT src/wrk.lua
LINK wrk

No comments:

Post a Comment

Kafka and Cassandra support, training for AWS EC2 Cassandra 3.0 Training