SBCL setup in Gentoo

In summary, SBCL (aka Steel Bank Common Lisp) is the most active developed and performant Common Lisp runtime / interpreter. It is widely adopted in lisp user communities. But I found some issue installing it on my Gentoo machine, here is my solution...

Installing it via portage, the default gentoo package manager.


            sudo emerge --ask sbcl
        

It will shows some error messaging showing that core file not found. It is because it is looking at a wrong /usr directory.

The solution is quite simple, just change our environment variable in Gentoo.


            touch /etc/env.d/50sbcl
            echo 'SBCL_HOME=/usr/lib/sbcl' >> /etc/env.d/50sbcl
            echo 'SBCL_SOURCE_ROOT=/usr/lib/sbcl/src' >> /etc/env.d/50sbcl
        

And update the Gentoo environemnt.


            sudo env-update
        

The sbcl should work right now.