Skip to content

Instantly share code, notes, and snippets.

@nathanhaigh
Created October 18, 2012 00:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanhaigh/3909221 to your computer and use it in GitHub Desktop.
Save nathanhaigh/3909221 to your computer and use it in GitHub Desktop.
Download, build and install MIRA assembler and dependencies for regular, non-sudo user.
#!/bin/bash
#
# NOTE: This may not entirely work! I couldn't quite get this working on my CentOS release 5.6 (Final) box
#
# References: http://www.freelists.org/post/mira_talk/header-file-missing-in-my-configlog,7
# https://svn.boost.org/trac/boost/ticket/5917
# http://permalink.gmane.org/gmane.comp.lib.boost.user/69898
####################
# Specify versions #
####################
MIRA_VERSION=3.4.0.2
EXPAT_VERSION=2.1.0
FLEX_VERSION=2.5.37
BOOST_VERSION=1.51.0
LIBUNWIND_VERSION=1.1
GPERFTOOLS_VERSION=2.0
####################
## expat
cd $HOME/downloads
wget http://sourceforge.net/projects/expat/files/expat/$EXPAT_VERSION/expat-$EXPAT_VERSION.tar.gz/download
tar zxf expat-$EXPAT_VERSION.tar.gz
cd expat-$EXPAT_VERSION
./configure --prefix=$HOME/expat-$EXPAT_VERSION CC=gcc44 CXX=g++44
make && make install
## flex
cd $HOME/downloads
wget http://prdownloads.sourceforge.net/flex/flex-$FLEX_VERSION.tar.gz?download
tar zxf flex-$FLEX_VERSION.tar.gz
cd flex-$FLEX_VERSION
./configure --prefix=$HOME/flex-$FLEX_VERSION CC=gcc44 CXX=g++44
make && make install
cd $HOME/flex-$FLEX_VERSION/bin
export PATH=$HOME/flex-$FLEX_VERSION/bin:$PATH
## boost
cd $HOME/downloads
wget http://sourceforge.net/projects/boost/files/boost/$BOOST_VERSION/boost_${BOOST_VERSION//./_}.tar.gz/download
tar zxf boost_${BOOST_VERSION//./_}.tar.gz
cd boost_${BOOST_VERSION//./_}
echo "using gcc : 4.4 : gcc44 ;" >> tools/build/v2/user-config.jam
./bootstrap.sh --prefix=$HOME/boost-$BOOST_VERSION
./b2 install
## libunwind and google-perftools
cd $HOME/downloads
wget http://download.savannah.gnu.org/releases/libunwind/libunwind-$LIBUNWIND_VERSION.tar.gz
tar zxf libunwind-$LIBUNWIND_VERSION.tar.gz
cd libunwind-$LIBUNWIND_VERSION
./configure --prefix=$HOME/libunwind-$LIBUNWIND_VERSION CC=gcc44 CXX=g++44
make && make install
cd $HOME/downloads
wget http://gperftools.googlecode.com/files/gperftools-$GPERFTOOLS_VERSION.tar.gz
tar zxf gperftools-$GPERFTOOLS_VERSION.tar.gz
cd gperftools-$GPERFTOOLS_VERSION
export LDFLAGS="-L$HOME/libunwind-$LIBUNWIND_VERSION/lib"
export CPPFLAGS="-I$HOME/libunwind-$LIBUNWIND_VERSION/include"
./configure --prefix=$HOME/gperftools-$GPERFTOOLS_VERSION CC=gcc44 CXX=g++44
make && make install
## mira itself
export CXXFLAGS="-I$HOME/flex-$FLEX_VERSION/include"
cd $HOME/downloads
wget http://sourceforge.net/projects/mira-assembler/files/MIRA/stable/mira-$MIRA_VERSION.tar.bz2/download
tar jxf mira-$MIRA_VERSION.tar.bz2
cd mira-$MIRA_VERSION
./configure --prefix=$HOME/mira-$MIRA_VERSION \
--with-boost=$HOME/boost-$BOOST_VERSION \
--with-expat=$HOME/expat-$EXPAT_VERSION \
--with-tcmalloc-dir=$HOME/gperftools-$GPERFTOOLS_VERSION/lib \
--enable-mirastatic CC=gcc44 CXX=g++44
make && make install
############
# Run MIRA #
############
#cd $HOME/mira-$MIRA_VERSION
#./mira
############
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment