SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
INSTALL.md
浏览该文件的文档.
1 INSTALL {#install}
2 =======
3 
4 ##GENERAL
5 Starting from the version 3.0 Shogun uses CMake to facilitate
6 the building process. When using command line on Linux- and Unix-based
7 systems with the `make` being available the building steps are:
8 
9 1. go to the shogun repository root
10 2. do `mkdir build`
11 3. do `cmake [options] ..` (or `ccmake ..` if available). It is very
12 recommended to use any of CMake GUIs (such as ccmake) if you feel unsure
13 about possible parameters and configurations.
14 4. do `make` (and `sudo make install` if needed)
15 
16 In case you want to generate some IDE project (e.g. Eclipse CDT4 project)
17 use the `-G generator-name` key. You may obtain possible generators with
18 the `cmake --help` command. For example to generate Eclipse CDT4 project
19 for Shogun use the `cmake -G "Eclipse CDT4 - Unix Makefiles"`.
20 
21 Sometimes you would need to clean up your build (e.g. in case of some major
22 changes). The easiest way to do that is straightforward:
23 just remove the `build` directory you created before.
24 
25 If you prefer to not run the `make install` command, you should
26 instead include the shogun library in your path:
27 
28 export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:path_to_shogun/src/shogun/
29 
30 Often you are just interested in one language and we always recommend to
31 use the more powerful modular interfaces.
32 
33 ##SPECIAL FEATURES
34 
35 To enable Multiple Kernel Learning with CPLEX(tm) just make sure cplex can
36 be found in the PATH. If it is not found shogun will resort to GLPK (if found)
37 for 1-norm MKL, p-norm MKL with p>1 will work nonetheless.
38 
39 ##REQUIREMENTS
40 
41 The standard linux utils like bash, grep, test, sed, cut, awk, ldd, uname gcc
42 g++ and cat, python (debian package: python2.7) are required
43 for the cmake to work.
44 
45 To compile the R interface you need to have the R developer files
46 (debian package r-base-dev) installed.
47 
48 To compile the octave interface you need to have the octave developer files
49 (debian package liboctave-dev) installed.
50 
51 To compile the java interface you need to have the java developer files
52 (debian package openjdk-6-jdk or openjdk-7-jdk) and jblas (debian package
53 jblas) installed.
54 
55 To compile the python interface you need to have the python developer files
56 installed (debian packages python2.7-dev or python3.X-dev) and numpy
57 version 1.x installed (debian package python-numpy) installed.
58 
59 Optionally you will need atlas, lapack and eigen3 (debian packages lapack3-dev,
60 atlas3-headers atlas3-base-dev, libeigen3-dev) installed. Note that
61 atlas/lapack is only supported under linux and osx (high performance computing
62 should be done under linux only anyway). In case atlas/lapack is unavailable,
63 don't worry most of shogun will work without, though slightly slower versions
64 are used. For standard 1-norm multiple kernel learning (MKL) the GNU Linear
65 Programming Kit (GLPK) version at least 4.29 or CPLEX is required. If you want
66 to build the html documentation or python online help you will need doxygen
67 version 1.6.0 or higher.
68 
69 For the interfaces to compile you will need swig.
70 
71 
72 ##SPECIFIC BUILD INSTRUCTIONS FOR MODULAR INTERFACES
73 
74 ###object oriented python/swig interface:
75 
76  $ mkdir build && cd build
77  $ cmake -DPythonModular=ON ..
78  $ make
79  $ sudo make install
80 
81 to test if it is working try
82 
83  $ export LD_LIBRARY_PATH=SHOGUN_INSTALL_DIR/lib
84  $ export PYTHONPATH=SHOGUN_INSTALL_DIR/lib/pythonX.Y/dist-packages/
85  $ python examples/undocumented/python_modular/graphical/svm.py
86 
87 ###object oriented octave/swig interface:
88 do all of the above you did for octave but now in addition install the swig
89 package and configure+compile shogun with:
90 
91  $ mkdir build && cd build
92  $ cmake -DOctaveModular=ON ..
93  $ make
94  $ sudo make install
95 
96 to test if it is working try octave examples/documented/octave_modular/libsvm.m
97 
98 ###object oriented r/swig interface:
99 note that this interface is pre-alpha quality
100 
101  $ mkdir build && cd build
102  $ cmake -DRModular=ON ..
103  $ make
104  $ sudo make install
105 
106 to test if it is working try R examples/documented/r_modular/all_classifier.R
107 
108 ###object oriented java/swig interface:
109 
110  $ mkdir build && cd build
111  $ cmake -DJavaModular=ON ..
112  $ make
113  $ sudo make install
114 
115 to test if it is working try
116 
117  $ export CLASSPATH=/usr/share/java/jblas.jar:SHOGUNDIR/src/java_modular/shogun.jar:.
118  $ export LD_LIBRARY_PATH=SHOGUNDIR/src/shogun:SHOGUNDIR/src/java_modular
119  $ javac ../examples/udocumented/java_modular/classifier_libsvm_minimal_modular.java
120  $ java classifier_libsvm_minimal_modular
121 
122 ##SPECIFIC BUILD INSTRUCTIONS FOR LEGACY STATIC INTERFACES
123 
124 ###standalone:
125 
126  $ mkdir build && cd build
127  $ cmake -DCmdLineStatic=ON ..
128  $ make
129 
130 a shogun executable can be found in interfaces/cmdline_static
131 
132 In order to test the shogun standalone binary, you can run the following
133 commands from the project root directory:
134 
135  $ cd examples/documented/cmdline_static
136  $ ../../../src/interfaces/cmdline_static/shogun classifier_liblinear.sg
137 
138 ###octave
139 To compile the octave interface you need to have the octave developer files
140 (debian package liboctave-dev).
141 
142 then do a
143 
144  $ mkdir build && cd build
145  $ cmake -DOctaveStatic=ON ..
146  $ make
147  $ sudo make install
148 
149 a sg.oct file should be created. as a test start octave in the
150 examples/documented/octave_static/ directory and type
151 
152  addpath('../../../src/interfaces/octave_static/graphical')
153  svr_regression
154 
155 ###matlab
156 To compile the matlab interface you need to have matlab installed in the path
157 (i.e., typing matlab in the shell should start matlab).
158 
159 then do a
160 
161  $ mkdir build && cd build
162  $ cmake -DMatlabStatic=ON ..
163  $ make
164  $ sudo make install
165 
166 a sg.mexglx (or sg.mexa64 or sg.mexmac etc file should be created in
167 src/interfaces/matlab_static/). As a test start matlab in the
168 examples/documented/matlab_static directory and type
169 
170  addpath('../../../src/interfaces/matlab_static/graphical')
171  svr_regression
172 
173 For permanent use you could add the following line to your matlab/startup.m
174 
175  addpath('path_to_shogun/src/interfaces/matlab_static');
176 
177 ###R
178 To compile the R interface you need to have the R developer files
179 (debian package r-base-dev) installed.
180 
181 then do the usual
182 
183  $ mkdir build && cd build
184  $ cmake -DRStatic=ON ..
185  $ make
186  $ sudo make install
187 
188 ###python
189 To compile the python interface you need to have numpy version 1.x installed
190 (debian package python-numpy) and optionally for plotting
191 python-matplotlib installed.
192 
193  $ mkdir build && cd build
194  $ cmake -DPythonStatic=ON ..
195  $ make
196  $ sudo make install
197 
198 A sg.so file should be created in the src/interfaces/python_static directory:
199 To test whether it is working change to examples/documented/python_static/graphical
200 and run:
201 
202  $ PYTHONPATH=path_to_shogun/src/interfaces/python_static/ python svm_classification.py
203 
204 ###eierlegendewollmichsau (elwms) interface
205 This is a .so file that works with R,python,matlab,octave all in one. To compile
206 you should have at least python and some other interface enabled:
207 
208  $ mkdir build && cd build
209  $ cmake -DElwmsStatic=ON ..
210  $ make
211  $ sudo make install
212 
213  $ cd src/interfaces/elwms_static
214  $ LD_LIBRARY_PATH=/path/to/octave/lib:/path/to/matlab/libs octave
215 
216 All examples from
217 examples/documented/{r_static,python_static,matlab_static,octave_static}/*
218 should work plus the ones in examples/documented/elwms_static/
219 (that allows lang -> python subcommands).
220 
221 ##PROBLEMS
222 In case header files or libraries are not at standard locations one needs
223 to manually adjust the libray/include paths. This can be done with
224 `-DCMAKE_INCLUDE_PATH=/my/include/path` (for includes) and `-DCMAKE_LIBRARY_PATH=/my/library/path`.
225 A good reference for that is http://cmake.org/Wiki/CMake_Useful_Variables .
double norm(double *v, double p, int n)
Definition: epph.cpp:452
CSGInterface * interface
Definition: SGInterface.cpp:45
static float base
Definition: JLCoverTree.h:82

SHOGUN 机器学习工具包 - 项目文档