John K. Boyle

Computing Notes - Home Directory Installed Software

Directories for Everything

.bashrc or .profile

# pkg-config setup (OS X it is not default installed)
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib:/usr/lib/pkgconfig"

# "sw" directory
export PATH="${HOME}/sw/bin:${PATH}"
export MANPATH="${HOME}/sw/man:${HOME}/sw/share/man:${MANPATH}"
export INFOPATH="${HOME}/sw/info:${HOME}/sw/share/info:${INFOPATH}"
export PKG_CONFIG_PATH="${HOME}/sw/lib/pkgconfig:${PKG_CONFIG_PATH}"
export LD_LIBRARY_PATH="${HOME}/sw/lib"

Building/Installing Software

Build/Install CMake (you’ll probably need it)

Build/Install pkg-config

Building/Installing with CMake

Building with CMake is best done as an “out of tree build”, which means build in a separate directory. If something goes wrong, just remove the build directory and start again.

If you wish a visual check of the options on the command line (DCMAKE_...), then call ccmake rather than cmake to run the graphical command-line program. Configure the build there by pressing c (you may need to press it twice). The option Press [g] to generate and exit will appear. Press g. Now continue with the usual ‘make && make install`


ADVANCED: Build a bleeding edge version of a compiler

I’m serious. This is advanced. If you mess it up, you can destroy much of your system’s ability to function. So be careful.

Check every command you type twice.

You have been warned.

LLVM/Clang (on OSX)

These steps may be checked against the latest at the clang website

cd ~/src
svn co llvm
cd llvm/tools/
svn co clang
cd ../projects/
svn co compiler-rt
cd ../..
mkdir llvm-svn-build
cd llvm-svn-build

# Here we will install to ${HOME}/llvm-svn
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${HOME}/llvm-svn/" -DLLVM_TARGETS_TO_BUILD=host -G "Unix Makefiles" ../llvm
time -p make -j12
make install