Downloaded and installed jemalloc 4.0.0 using their recommended steps(from the root directory):
./autogen.sh
make dist
make
make install
Verified install was in my path:
$ls /usr/local/bin | grep je
jemalloc-config
jemalloc.sh
jeprof
Using rbenv 0.4.0, attempted to build ruby 2.2.3 and pass flags to ruby build as specified here to use the --with-jemalloc
option. Build fails :( If I just pass the compiler, it succeeds. Any ideas how to get rbenv/ruby-build to find my jemalloc installation?
$CC="/usr/local/Cellar/gcc5/5.2.0/bin/gcc-5" CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3
Downloading ruby-2.2.3.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/df795f2f99860745a416092a4004b016ccf77e8b82dec956b120f18bdc71edce
Installing ruby-2.2.3...
BUILD FAILED (OS X 10.10.4 using ruby-build 20150818)
Inspect or clean up the working tree at /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819
Results logged to /var/folders/xw/15_55jhn0hb309d6zvh5k9mc0000gn/T/ruby-build.20150913102001.819.log
Last 10 log lines:
checking gmp.h usability... no
checking gmp.h presence... no
checking for gmp.h... no
checking for malloc_conf in -ljemalloc... no
checking jemalloc/jemalloc.h usability... no
checking jemalloc/jemalloc.h presence... no
checking for jemalloc/jemalloc.h... no
checking for jemalloc with JEMALLOC_MANGLE... no
configure: error: jemalloc requested but not found
make: *** No targets specified and no makefile found. Stop.
Figured it out. Cleaned up my first attempt then on OS X Yosemite, downloaded jemalloc-4.0.0.tar.bz2
instead. Unpacked it and ran ./configure --with-jemalloc-prefix=""
from the root directory based on Nobu's note in https://bugs.ruby-lang.org/issues/9113#note-39. Then just make
and make install
.
Once I verified jemalloc was installed correctly, I was able to pass in the option to rbenv with CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3
.
Bonus: Another thing that was helpful in targeting the break point was to download and unpack the ruby source tarball directly and then run ./configure --with-jemalloc
inside of the root directory. It will spit out an output of all the build checks, including one for jemalloc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With