SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

Currently SHOGUN has been confirmed to be fully functional on PowerPC, i386 and AMD64 Linux (tested on debian/ubuntu and gentoo). We also managed to compile SHOGUN on MacOSX and via cygwin on WIN32 platforms. However some manual tweakings of configuration files might be necessary.

From a Package

SHOGUN is currently pre-packaged for debian (see and available on MacOSX via macports (see )

Installation on Debian/Ubuntu

On debian, depending on the interface you want, install the package(s)

libshogun-dev         - for C++ developers building extensions using
shogun-csharp-modular - for the modular csharp interface
shogun-lua-modular    - for the modular lua interface
shogun-java-modular   - for the modular java interface
shogun-octave-static  - for the static octave interface
shogun-octave-modular - for the modular octave interface
shogun-python-static  - for the static python interface
shogun-python-modular - for the modular python interface
shogun-r-static       - for the static r interface
shogun-ruby-modular   - for the modular ruby interface
shogun-cmdline-static - for the static command-line interface.
shogun-elwms-static   - for the static eierlegende wollmilchsau interface
                        (one interface to r/python/octave allowing
                        to run commands in non-native languages)
shogun-doc            - for the documentation

Installation on MacOSX

The mac port is provided by James Kyle (Thanks!!) and makes installations on OSX as easy as under linux. To install shogun you will need macports (see Then issue

sudo port selfupdate

sudo port install swig -php5 -ruby -perl +python
  (shogun users who want the r and octave interfaces should add
  +octave and/or +r to this list)

sudo port install shogun
  (for r, octave, and elwms interfaces: +r +octave +elwms)



to your shell profile. Tip the default ${macports_prefix} is /opt/local/. In that case, the library path would be /opt/local/lib.

Installing SHOGUN from Source

Download SHOGUN from , aswell as its requirements.


SHOGUN requires the standard linux utils like bash, grep, test, sed, cut, ldd, uname gcc g++ and cat python (debian package: python2.4 or python2.5) for the ./configure to work.

Optionally you will need atlas and lapack (debian packages lapack3-dev, atlas3-headers atlas3-base-dev or atlas3-altivec-dev atlas3-sse2-dev) installed. Note that atlas/lapack is only supported under linux (high performance computing should be done under linux only anyway). In case atlas/lapack is unavailable, don't worry most of shogun will work without, though slightly slower versions are used. To enable Multiple Kernel Learning with CPLEX(tm) just make sure cplex can be found in the PATH. If it is not found shogun will resort to GLPK (if version at least 4.29 is found) for 1-norm MKL, p-norm MKL with p>1 will work nonetheless.

Compiling SHOGUN

On most platforms (Linux,MacOSX,cygwin) it is sufficient to issue

sudo make install

In case you just want to compile for a single interfaces you can use

./configure --interfaces=libshogun,libshogunui,<interface>
sudo make install

where interface is one of the following

(you don't need to compile libshogunui in case you compile a modular interface)

However, just running


will autodetect and configure for the available interfaces.


./configure --help 

to see the list of additional options detailed below.

cmake version 2.8.9

  cmake [options] <path-to-source>
  cmake [options] <path-to-existing-build>

  -C <initial-cache>          = Pre-load a script to populate the cache.
  -D <var>:<type>=<value>     = Create a cmake cache entry.
  -U <globbing_expr>          = Remove matching entries from CMake cache.
  -G <generator-name>         = Specify a makefile generator.
  -Wno-dev                    = Suppress developer warnings.
  -Wdev                       = Enable developer warnings.
  -E                          = CMake command mode.
  -i                          = Run in wizard mode.
  -L[A][H]                    = List non-advanced cached variables.
  --build <dir>               = Build a CMake-generated project binary tree.
  -N                          = View mode only.
  -P <file>                   = Process script mode.
  --find-package              = Run in pkg-config like mode.
  --graphviz=[file]           = Generate graphviz of dependencies.
  --system-information [file] = Dump information about this system.
  --debug-trycompile          = Do not delete the try_compile build tree.
                                Only useful on one try_compile at a time.
  --debug-output              = Put cmake in a debug mode.
  --trace                     = Put cmake in trace mode.
  --warn-uninitialized        = Warn about uninitialized values.
  --warn-unused-vars          = Warn about unused variables.
  --no-warn-unused-cli        = Don't warn about command line options.
  --check-system-vars         = Find problems with variable usage in system
  --help-command cmd [file]   = Print help for a single command and exit.
  --help-command-list [file]  = List available listfile commands and exit.
  --help-commands [file]      = Print help for all commands and exit.
  --help-compatcommands [file]= Print help for compatibility commands.
  --help-module module [file] = Print help for a single module and exit.
  --help-module-list [file]   = List available modules and exit.
  --help-modules [file]       = Print help for all modules and exit.
  --help-custom-modules [file]= Print help for all custom modules and exit.
  --help-policy cmp [file]    = Print help for a single policy and exit.
  --help-policies [file]      = Print help for all policies and exit.
  --help-property prop [file] = Print help for a single property and exit.
  --help-property-list [file] = List available properties and exit.
  --help-properties [file]    = Print help for all properties and exit.
  --help-variable var [file]  = Print help for a single variable and exit.
  --help-variable-list [file] = List documented variables and exit.
  --help-variables [file]     = Print help for all variables and exit.
  --copyright [file]          = Print the CMake copyright and exit.
  --help,-help,-usage,-h,-H,/?= Print usage information and exit.
  --help-full [file]          = Print full help and exit.
  --help-html [file]          = Print full help in HTML format.
  --help-man [file]           = Print full help as a UNIX man page and exit.
  --version,-version,/V [file]= Show program name/version banner and exit.


The following generators are available on this platform:
  Ninja                       = Generates files (experimental).
  Unix Makefiles              = Generates standard UNIX makefiles.
  CodeBlocks - Ninja          = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles = Generates CodeBlocks project files.
  Eclipse CDT4 - Ninja        = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.
  KDevelop3                   = Generates KDevelop 3 project files.
  KDevelop3 - Unix Makefiles  = Generates KDevelop 3 project files.

If this does not work for you, consult the INSTALL file for platform specific build instructions. The INSTALL file is contained in the shogun src distribution and quoted below.


SHOGUN Machine Learning Toolbox - Documentation