Skip to content

Building Mineserver for Mac Tutorial

timaaarrreee edited this page Nov 28, 2011 · 6 revisions

This tutorial assumes you have no build software ie. a C++ compiler, git, cmake installed yet.

The objective of this page is to get you up and running with the tools needed to build and run Mineserver 2 in its early development stages.

I'll try to make this as easy as possible (possibly too easy) so if you already have some of the software installed such as Xcode just skip along.

Install Xcode

Xcode installs the GNU C++ compiler which is included on the Mac OSX Install DVD. I have OSX 10.6 (Snow Leopard) but the install process should be the same if you are running 10.7 (Lion) or an older version.

  1. First find your 'Mac OS X Install' DVD.
  2. If that failed you'll have to download it here: http://developer.apple.com/xcode/ Annoyingly you'll have to get an Apple developer account to sign in get access to the free download link; so it's better if you use the disk and save yourself 2GB ;)

OS X 10.6 Install DVD

This is a screenshot of my installation DVD

Open the 'Optional Installs' Folder and run Xcode.mpkg

Optional Installs Folder

Simply click the 'Continue' button until the install is complete. There are no special options you need to select.

CMake

CMake is a clever tool that searches for files to be 'linked' when it comes to the stage of building your mineserver binary file.

  1. Download cmake-x.x.x.dmg from http://www.cmake.org/cmake/resources/software.html
  2. Open it and run the cmake.x.x.x.pkg installer.
  3. We will be using it in the terminal when we are about to compile.

Git

All the source code to Minserver 2 is stored in our GitHub repository where code can be quickly and easily 'cloned' or 'merged' when multiple developers are working on it.

  1. Download git from http://git-scm.com/
  2. Same install steps as CMake.

Boost C++ Libraries

Boost Logo

Mineserver currently uses 4 libraries provided by Boost. We have to compile them so that Mineserver will build and run.

  1. Download boost from http://sourceforge.net/projects/boost/files/boost/1.48.0/boost_1_48_0.tar.bz2/download
  2. Double click the file so that it extracts in your Downloads folder.
  3. Open terminal (Applications -> Utilities -> Terminal) and run these commands individually.

The 3rd command will ask for your password because it's installing libraries into your system. It will take a quite a while to complete.

cd ~/Downloads/boost_*
./bootstrap.sh --with-libraries=thread,signals,system,filesystem
sudo ./b2 install

TIP: If you have a processor with multiple cores you can add -j(number of cpu cores) to make it happen faster e.g. sudo ./b2 install -j4

Compiling Mineserver

So far you have;

  • Installed the C++ compiler (That came with Xcode).
  • Installed CMake.
  • Installed Git.

Now you can compile the latest bleeding edge source code with these easy commands. For simplicity just your home (~) directory to store mineserver2 (unless you want to put is elsewhere).

cd ~
git clone https://github.com/Mineserver/mineserver2.git

You now have a folder called mineserver2

cd mineserver2
cmake .
make

If no errors appeared all went well! To run Mineserver;

cd bin
./mineserver

Currently there is no config file. All configurations are 'hardcoded'.

Clone this wiki locally