Fuego installation instructions for Mac OS X

These instructions require command-line developer tools such as svn (Subversion - a version control system), gcc (a compiler) and autoreconf (part of the autotools collection for creating configuration and makefiles). These tools are installed when you install Xcode from the App Store, and have it install the command line tools. See appendix 1 below for how to do this.

Apple, in its infinite wisdom, decided to leave out the autotools collection with Mountain Lion and its associated version of Xcode, so these must be installed separately if you are using OS X 10.8 and above. See appendix 2 below for how to do this.

With developer tools installed, and paths set correctly, The first task is to retrieve and install the appropriate Boost libraries. Download the most recent version from boost.org. On 29 July 2013, that version is 1.54.0.

Un-tar that in a directory of your choice. For my examples below, I will show a user called yama installing into a folder called igo. Assuming you have downloaded the tar.gz file into that directory, open the Terminal application and use the the following commands:

cd ~/igo
tar -zxvf boost_1_54_0.tar.gz

Now build the boost libraries that are needed for Fuego, and put them into a separate directory:

cd  boost_1_54_0/
./bootstrap.sh --prefix=../boost --with-libraries=thread,system,date_time,filesystem,program_options,test
./b2 install

This process will take a little bit of time as it copies a lot of files, and compiles a few others. When completed you should have the following:

/Users/yama/igo/boost_1_54_0.tar.gz
/Users/yama/igo/boost_1_54_0/  <-- filled with lots of stuff
/Users/yama/igo/boost/
/Users/yama/igo/boost/include/boost/  <-- filled with lots of stuff
/Users/yama/igo/boost/lib/  <-- filled with library executables

To make sure that these libraries are visible, we need to export the path to the libraries (assuming you are still using the default bash shell):

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/Users/yama/igo/boost/lib
Note that any time you compile or run Fuego, this variable needs to be in your environment. You can check if it is there by typing:
echo $DYLD_LIBRARY_PATH
If the response is blank, you will need to export it again.

Now we go and get Fuego. There is no tar file that contains the latest version of Fuego, so we get it directly from the repository using svn:

cd ..   <-- here you want to end up in the /Users/yama/igo/  directory.
svn checkout svn://svn.code.sf.net/p/fuego/code/trunk fuego
This should create a folder named fuego in the desired directory, in this case our example will now have a directory /Users/yama/igo/fuego filled with all the Fuego code.

Now we need to create the configure file using autoreconf, run the produced configure file, and then finally make the project:

cd fuego
autoreconf --force --install
./configure --with-boost=/Users/yama/igo/boost  --with-boost-libdir=/Users/yama/igo/boost/lib
make
Please note that when you run the ./configure for Fuego here, the --with-boost= and --with-boost-libdir= paths must be absolute paths, not relative paths: the entire pathname starting at / must be there. For example, do not use the shortcut --with-boost=../boost. It will not work.

Another reminder: any time you run Fuego, the DYLD_LIBRARY_PATH variable must be set.

Installation on Linux

In order to use these instructions on a Linux install instead of Mac OS, you need to change the DYLD_LIBRARY_PATH to LD_LIBRARY_PATH. Additionally note that most Linux installations locate users home directories in /home, not /Users.

Appendix 1

How to install the Xcode command line tools

To install the command line tools needed such as gcc and svn, you must first install Xcode itself. Xcode is available through the Apple App Store application.

Open the "App Store" application, found in the Applications folder, and do a search for Xcode. Install Xcode by clicking on the 'Free' button, and then clicking on it again after it becomes the 'Install App' button. After a long download and install, you will find the Xcode application in your Applications folder.

Start up Xcode, and open up its Preferences (from the Xcode menu). Choose the 'Downloads' tab, and inside that choose the 'Components' tab. One of the components that you can install is the "Command Line Tools". Install these and test that you have them installed by using the following commands in a Terminal window (the Terminal application is found in the Utilities folder inside the Applications folder):

which gcc   <--  should respond with /usr/bin/gcc
which svn   <--  should respond with /usr/bin/svn
If these commands have given the correct responses, you are ready to proceed.

Appendix 2

How to install autotools on Mac OS

The autoconf, automake, and libtool packages (all part of the autotools collection) should be installed in order to be able to use the autoreconf command to create Fuego's 'configure' file.

I recommend using the following shell script to install all three of these tools. Alternatively you can manually type in the commands found in the script. You must modify the script to place the tools in a directory of your choice. I show this one being put into a devtools directory in the yama user's igo directory, but you may or may not want to have the tools installed into /usr/local. The advantage is that if in /usr/local they are already on the PATH variable. The disadvantage is that you may forget to remove them from there (or may damage other things when you do) should you ever decide you don't need them. You can also modify the script to install more recent versions of the tools. You may want to visit the websites to investigate which version is the most recent.

Copy and paste the following (between, but not including, the ---------- lines) into a file named, for example, createDevTools.sh. If you created this file in the /Users/yama/igo directory, then make the file executable by typing the following commands in the Terminal application:

cd /Users/yama/igo
chmod 755 createDevTools.sh
Then execute it by using:
./createDevTools.sh
You will have to type in your password the first time the script uses 'sudo' in an install.

Remember that if you want to use any of the autotools in a different Terminal window or shell, you will need to add the installation directory's bin directory to the PATH variable, e.g.:

export PATH=$PATH:/Users/yama/igo/devtools/bin
unless you installed into /usr/local.

-------------------------------------------------------------
#!/bin/sh
 
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from 
# http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
 
export build=/Users/yama/igo/devtools # or wherever you'd like to build
mkdir -p $build
 
##
# Autoconf
# http://ftpmirror.gnu.org/autoconf
 
cd $build
curl -OL http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
#./configure --prefix=/usr/local
./configure --prefix=/Users/yama/igo/devtools
make
sudo make install
export PATH=$PATH:/Users/yama/igo/devtools/bin
 
##
# Automake
# http://ftpmirror.gnu.org/automake
 
cd $build
curl -OL http://ftpmirror.gnu.org/automake/automake-1.14.tar.gz
tar xzf automake-1.14.tar.gz
cd automake-1.14
#./configure --prefix=/usr/local
./configure --prefix=/Users/yama/igo/devtools
make
sudo make install
 
##
# Libtool
# http://ftpmirror.gnu.org/libtool
 
cd $build
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.tar.gz
tar xzf libtool-2.4.tar.gz
cd libtool-2.4
#./configure --prefix=/usr/local
./configure --prefix=/Users/yama/igo/devtools
make
sudo make install
 
echo "Installation complete."
-------------------------------------------------------------
When you are done installing, make sure that the PATH environment variable contains your autotools installation. Type
which autoreconf
and if there is no path given in the response (the response is blank), then add it to your path with:
export PATH=$PATH:/Users/yama/igo/devtools/bin
modifying the /Users/yama/igo/devtools/bin to reflect where you installed autotools.