Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Compiling-Installing

COMPILING & INSTALLING

Dependencies

How to compile the project

You will want to have an independent different folder for Autotools to place all the temporary files (objects files) so that the repository folder does not get full of useless files (Making hard using git).

$ mkdir -p local_eclipse/{tmp,sandbox}                 # Create a sandbox directories
$ cd local_eclipse                                     # enter in the directory
$ git clone git@github.com:DICL/VeloxDFS.git           # Clone the project from github
$ sh autogen.sh                                        # Generate configure script 
$ cd ../tmp                                            # Go to building folder
$ sh ../VeloxDFS/configure --prefix=`pwd`/../sandbox   # Generate Makefile

In case that boost library is in a non standard place

$ sh ../VeloxDFS/configure --prefix=`pwd`/../sandbox --with-boost=/pathtoboostheaders  # Generate Makefile

Lastly,

### This last command will be needed whenever you want to recompile the source
$ make [-j#] install                                   # Compile & install add -j flag to speed up

Now edit in your ~/.bashrc or ~/.profile:

export PATH="/home/*..PATH/To/eclipse/..sandbox/bin":$PATH
export LIBRARY_PATH="/home/*..PATH/To/eclipse/..sandbox/lib"
export C_INCLUDE_PATH="/home/*..PATH/To/eclipse/..sandbox/include"

Configure custom flags

Our configure script supports the following flags:

GNU/Autotools 101

What's the deal with Autotools and why are we using it

When it comes to C++ we do not have much of a choice for Building Systems. How can we make our Project compatible with other computers (Lets think only within Linux). VeloxDFS depends on Boost ASIO, UnitTest++, and C++14.

How can you check that the computer you are installing it contains those libraries? Or, if the libraries are in a different location how can you find them?.

Regular Makefiles are not enough since while it let you do some complex things, you will endup with a giant Makefile that would be harder to maintain the the source code itself.

GNU/Autotools creates this crazy big and complex Makefile for you, only calling the following standard commands that all the Linux community is familiar with:

$ ./configure "many options here"  # Generate Makefile
$ ./make
$ sudo make install

It will compile and install the software in your computer. It will also deal with many differences between plataforms.

Learning GNU/Autotools is hard and boring, but if you will use Linux for some years, it worth learn it.

How is VeloxDFS using Autotools

VeloxDFS is using Autotools by the files configure.ac, Makefile.am, and lesser important autogen.sh.

Here is a diagram which explain the workflow of creating the Makefile:

  +-------------+               +-------------+
  | configure.ac+---------------> configure   +-----+
  +-------------+  ./autogen.sh +-------------+     |
                                                    |      +-------------+
                                                    +----->+ Makefile    |
                                                    |      +-------------+
                                +-------------+     |
                                | Makefile.am +-----+
                                +-------------+