Correct way to compile Ruby 2.2 with jemalloc and rbenv?

We downloaded and installed jemalloc 4.0.0 using the recommended steps (from the root directory):

./autogen.sh
make dist
make
make install

The verified installation was in my way:

    $ls /usr/local/bin | grep je
    jemalloc-config
    jemalloc.sh
    jeprof

Using rbenv 0.4.0, I tried to create ruby ​​2.2.3 and pass the flags to ruby ​​build, as indicated here , to use the option --with-jemalloc. Build fails :( If I just pass the compiler, it will succeed. Any ideas on 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.
+4
source share
1 answer

. , OS X Yosemite, jemalloc-4.0.0.tar.bz2. ./configure --with-jemalloc-prefix="" Nobu https://bugs.ruby-lang.org/issues/9113#note-39. make make install.

, jemalloc , rbenv CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3.

: , , , tar ruby ​​, ./configure --with-jemalloc . , jemalloc.

+5

Source: https://habr.com/ru/post/1607172/


All Articles