LLVM-3.0

Introduction to LLVM

The llvm package contains a collection of modular and reusable compiler and toolchain technologies. The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!) These libraries are built around a well specified code representation known as the LLVM intermediate representation ("LLVM IR").

This package is known to build and work properly using an LFS-7.0 platform.

Package Information

LLVM Dependencies

Optional

Doxygen-1.7.5, Graphviz-2.26.3, and libffi-3.0.10

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/llvm

Installation of LLVM

Install llvm by running the following commands:

touch tools/edis/EnhancedDisassembly.exports               &&
./configure --prefix=/opt/llvm                             &&
find -name Makefile -exec                                  \
        sed -i -r -e '/^LIBRARYNAME/a SHARED_LIBRARY = 1'  \
                  -e 's#BUILD_ARCHIVE :*= 1#NO_&#'         \
                  -e '/^USEDLIBS/s# ([A-Za-z]*).a# -l\1#g' \
                  -e 's#^USEDLIBS#LDFLAGS#' {} \;          &&
sed -i 's#BUILD_ARCHIVE = 1#NO_&#' Makefile.rules          &&
sed -i 's#x)/docs#x)/share/doc#' Makefile.config           &&
make

To test the results, issue: make check.

Now, as the root user:

make install                            &&
echo "/opt/llvm/lib" >> /etc/ld.so.conf &&
ldconfig                                &&
echo "pathappend /usr/share/man MANPATH"      >> /etc/profile.d/extrapaths.sh &&
echo "pathappend /opt/llvm/share/man MANPATH" >> /etc/profile.d/extrapaths.sh &&
echo "pathappend /opt/llvm/bin"               >> /etc/profile.d/extrapaths.sh &&
ln -svf /opt/llvm/share/doc /usr/share/doc/llvm-3.0

Command Explanations

--prefix=/opt/llvm: This package has a large number of libraries and executables. This option keeps them separate.

find -name Makefile -exec sed ...: This command ensures that dynamic libraries are built.

sed ... Makefile.rules: This command disables building static libraries.

echo "pathappend ..." >> /etc/profile.d/extrapaths.sh: Set up the user paths properly to find the program executables and man pages.

Contents

Installed Programs: numerous programs installed in /opt/llvm/bin
Installed Libraries: numerous libraries installed in /opt/llvm/lib
Installed Directories: /opt/llvm

Last updated on 2011-12-13 01:41:57 +0000