Build Yjit on my mac

Follow the official document : ruby/yjit

Step

  1. clone the repo and enter the directory

     git clone https://github.com/ruby/ruby yjit
     cd yjit
    
  2. install the deps first:

     brew install openssl readline libyaml
    
  3. build:

     ./autogen.sh
     ./configure --enable-yjit=dev --prefix=$HOME/.rbenv/versions/ruby-yjit --disable-install-doc --with-opt-dir="$(brew --prefix openssl):$(brew --prefix readline):$(brew --prefix libyaml)"
     make -j install
    

    I'm use rbenv, so I change the --prefix option to the rbenv versions directory.

  4. Use

     rbenv versions
     rbenv global ruby-yjit
    

Problem

  1. Haven't id.h

    Solve: rebuild ruby-yjit and success

  2. Bison version it to low

    Solve: install the lastest version Bison and add export it:

     brew install bison
     export PATH="/opt/homebrew/opt/bison/bin:$PATH"