2015-09-13 49 views
4

下載並使用他們推薦的步驟(從根目錄)安裝jemalloc 4.0.0:使用jemalloc和rbenv編譯Ruby 2.2的正確方法?

./autogen.sh 
make dist 
make 
make install 

驗證安裝在我的道路:

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

使用rbenv 0.4.0,試圖建立紅寶石2.2.3並通過標誌紅寶石建立如指定here使用--with-jemalloc選項。構建失敗:(如果我只是通過編譯器,它成功。任何想法如何獲取rbenv /紅寶石打造找到我jemalloc安裝?

$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. 

回答

5

想通了。整理了我的第一次嘗試,然後在OS X優山美地,下載jemalloc-4.0.0.tar.bz2來代替。打開包裝,並基於在https://bugs.ruby-lang.org/issues/9113#note-39 Nobu餐廳的音符根目錄下​​運行./configure --with-jemalloc-prefix=""。然後,只需makemake install

一旦我覈實jemalloc已正確安裝,我能夠在選項傳遞給rbenv與CONFIGURE_OPTS="--with-jemalloc" rbenv install 2.2.3

獎勵:另一個有助於確定中斷點的方法是直接下載並解壓縮ruby源tarball,然後在根目錄內運行./configure --with-jemalloc。它會吐出所有構建檢查的輸出,其中一個用於jemalloc。