Skip to content
hannes-landeholm edited this page Jul 22, 2015 · 7 revisions

Dependencies

The following dependencies are needed to compile librcd:

An x86_64 distribution of Linux. Librcd is NOT compatible with 32 bit and will likely never be.

  • bash - To run various tools.
  • yasm - To compile [./libs/asmlib/*.asm].
  • python3 - To run asmlib.build.
  • php-cli - To run rcd-post-pp.
  • pypy - To run rcd-pl.
  • pyelftools - To run rcd-pl.
  • occ - To make/compile.
  • llvm/librcd_33 - LLVM tools (clang, llc etc that is modified to emit code for librcd).

Installing on Arch Linux

This guide assumes you have /usr/local/bin in your PATH. Consult the rc file for your shell otherwise.

Installing packaged dependencies

pacman -S bash git yasm python3 python2 php pypy

Installing pyelftools

git clone https://github.com/eliben/pyelftools.git
cd pyelftools
pypy setup.py install

Installing occ

git clone https://github.com/jumpstarter-io/occ.git /usr/local/share/occ
ln -s /usr/local/share/occ/occ /usr/local/bin/occ

You should now be able to run occ from the shell.

Installing llvm/librcd_33 fork

pacman -S cmake
git clone git@github.com:jumpstarter-io/llvm.git /opt/llvm
cd /opt/llvm
git checkout librcd_33
git submodule update --init --recursive
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=relwithdebinfo -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2 ..
# in fish shell
    make -j (grep -c \^processor /proc/cpuinfo)
# OR in bash shell
    make -j `grep -c \^processor /proc/cpuinfo`

At this point you would want to install this custom librcd branch of llvm 3.3 (clang, etc). How this is done depends on your system. If you don't have llvm installed you can just install it right away through make install. This will place it in /usr/local/ by default.

If you already have llvm installed you could simply choose to uninstall it (pacman -R llvm). This may however be undesirable if a higher version than 3.3 is currently installed. Your option in this case is either to:

  • Deal with having a lower version of llvm installed.
  • Use dual installs and select the right clang by having different env PATH depending on what you are doing.
  • Contribute to librcd by testing, porting and writing patches for a newer version of llvm. This includes contacting the llvm devs and trying to get the patches upstreamed so librcd support becomes official.

To find out if the right llvm is used from the shell you can type llc --help | grep librcd. This should display information about the -librcd-stack-segmentation-fd flag indicating support for it.

Installing on Ubuntu

This guide assumes you have /usr/local/bin in your PATH. Consult the rc file for your shell otherwise.

Installing packaged dependencies

apt-get install bash git yasm python3 php5-cli pypy subversion libxml2-dev g++

Installing pyelftools

git clone https://github.com/eliben/pyelftools.git
cd pyelftools
pypy setup.py install

Installing occ

git clone https://github.com/jumpstarter-io/occ.git /usr/local/share/occ
ln -s /usr/local/share/occ/occ /usr/local/bin/occ

You should now be able to run occ from the shell.

Installing llvm/librcd_33 fork

git clone https://github.com/jumpstarter-io/llvm.git /opt/llvm
cd /opt/llvm
git checkout librcd_33
git submodule update --init --recursive
./configure --enable-optimized
# in fish shell
    make -j (grep -c \^processor /proc/cpuinfo)
# OR in bash shell
    make -j `grep -c \^processor /proc/cpuinfo`

At this point you would want to install this custom librcd branch of llvm 3.3 (clang, etc). How this is done depends on your system. If you don't have llvm installed you can just install it right away through make install. This will place it in /usr/local/ by default.

If you already have llvm installed you could simply choose to uninstall it (apt-get remove llvm). This may however be undesirable if a higher version than 3.3 is currently installed. Your option in this case is either to:

  • Deal with having a lower version of llvm installed.
  • Use dual installs and select the right clang by having different env PATH depending on what you are doing.
  • Contribute to librcd by testing, porting and writing patches for a newer version of llvm. This includes contacting the llvm devs and trying to get the patches upstreamed so librcd support becomes official.

To find out if the right llvm is used from the shell you can type llc --help | grep librcd. This should display information about the -librcd-stack-segmentation-fd flag indicating support for it.

Testing if librcd was installed correctly.

You can build and run the unit tests for librcd to see if everything was installed correctly. Go to the librcd root folder and type: occ -x, occ -c -m otest. This will index librcd with occ and compile the optimized unit tests for librcd. The process should complete successfully. Then run ./build/librcd.self-otest.