Install

These instructions are targeted at systems running CentOS 6 or CentOS 7 .

Prerequisites

Install the dependencies (make sure that EPEL is enabled):

yum groupinstall -y 'Development Tools' yum install -y mysql-server memcached gettext-devel patch ncurses-devel perl-Time-HiRes libbsd-devel

Note: On Centos7, install the mariadb package instead of mysql-server

MySQL (or MariaDB)

To start MySQL and configure the magma username run the commands below. The supplied password should be replaced with value unique to your environment. You may also want to limit the permissions of the magma database user to the database it will need to access. The global permission is only needed to setup the table schema.

service mysqld start chkconfig mysqld on echo "CREATE USER 'magma'@'localhost' IDENTIFIED BY 'volcano';" | mysql -u root echo "GRANT ALL PRIVILEGES ON *.* TO 'magma'@'localhost' WITH GRANT OPTION;" | mysql -u root

Memcached

To start Memcached run the commands below.

service memcached start chkconfig memcached on

Compiling with Make

Magma may be built simply by running the make command in the project's root directory, which will automate most of the steps below. If you want more control over the build process you may follow the steps below.

Compiling with Build Scripts

To link up the development and build scripts run the linkup.sh. This will create a bin folder in your home directory, if it doesn't already exist, and create symbolic links to the scripts and tools used to build, run and test magma. The commands below assume the bin directory is in your PATH. If it isn't, or you simply don't want to create the symbolic links, you can also run the shell scripts directly from their location in the dev/scripts folder. To execute the linkup.sh script:

magma/dev/scripts/linkup.sh

To build the dependencies and create the magmad.so library separately, run the build.lib script. Run the script without any parameters to see the possible command line options. To compile and combine all of dependencies in a single operation:

build.lib all

The bundled Makefile can be used to compile magma. It will detect when the dependencies haven't been compiled and run the preceeding step automatically, if necessary, as the Makefile looks for required header files in folders created by the previous step. If the Makefile has trouble finding the necessary include files, odds are its because the previous step didn't run properly. Assuming the dependencies are available, you can compile magmad and magmad.check using:

build.magma build.check

To setup a sandbox database which can be used to run the unit tests, or experiment with magma, run (assuming the development userid is setup with permission to your database):

schema.reset

To launch the magma unit tests, or magma using the sandbox configuration, run:

check.run magma.run

To download the ClamAV virus definitions into the sandbox environment, run: