Skip to content

Commit 5a73240

Browse files
author
Soeren Sonnenburg
committed
2 parents 8db96c8 + f904862 commit 5a73240

File tree

365 files changed

+5070
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

365 files changed

+5070
-1400
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,6 @@ examples/undocumented/python_modular/*
130130
CMakeCache.txt
131131
/build
132132
/third_party
133+
134+
# protobuf
135+
src/shogun/io/protobuf/*.pb.*

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[submodule "data"]
22
path = data
33
url = git://github.com/shogun-toolbox/shogun-data.git
4+
branch = master
45
[submodule "doc/tutorial"]
56
path = doc/tutorial
67
url = git://github.com/shogun-toolbox/shogun-tutorial.git

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ matrix:
5151
virtualenv:
5252
system_site_packages: true
5353
before_install:
54+
- if [ -z $OSX ] ; then sudo apt-add-repository -y ppa:kubuntu-ppa/backports ; sudo apt-get update -qq ; fi
5455
- if [ -z $OSX ] ; then sudo apt-add-repository -y ppa:dr-graef/octave-3.6.precise ; sudo apt-get update -qq ; else brew update ; fi
5556
- if [ -z $OSX ] ; then sudo apt-get install -qq libbz2-dev cdbs libarpack2-dev libatlas-base-dev libblas-dev libglpk-dev libhdf5-serial-dev zlib1g-dev libxml2-dev libreadline6-dev libreadline-dev libsnappy-dev liblzo2-dev liblzma-dev liblapack-dev gdb cmake python-jinja2 $EXTRA_PACKAGES ; else brew install cmake ; fi
5657
- if [ $OSX ] ; then curl -O https://raw.github.com/rudix-mac/package-manager/master/rudix.py && sudo python rudix.py install rudix && sudo rudix install jinja2 ; fi

CMakeLists.txt

Lines changed: 85 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# $ make
66

77
project(shogun)
8-
cmake_minimum_required(VERSION 2.8.4)
8+
cmake_minimum_required(VERSION 2.8.8)
99
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
1010
include(ShogunUtils)
1111

@@ -69,11 +69,7 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
6969
ENDIF()
7070

7171
# Get processor type, sets MACHINE macro
72-
IF(NOT WIN32)
73-
execute_process(COMMAND uname -m
74-
OUTPUT_VARIABLE MACHINE_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
75-
SET(MACHINE ${MACHINE_OUTPUT})
76-
ENDIF()
72+
SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR})
7773

7874
SET(EXT_LIB_SWIG_RUBY_MODULAR ".so")
7975
if(DARWIN)
@@ -186,8 +182,16 @@ ENDIF()
186182
# check for supported c++11 features
187183
#
188184
# clang with -std=c++11 and -stdlib=libc++ does not work
189-
# well with swig generated cxx
190-
# hence disable c++11 for this case.
185+
# well with swig generated cxx hence disable c++11 for this case.
186+
187+
# TODO: until swig 2.0.11 does not support compilation with libc++
188+
# There are PRs against SWIG HEAD to fix this hence it needs to be checked
189+
# which later version can support compilation with libc++
190+
IF (COMPILE_MODULAR_INTERFACE AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND NOT SWIG_VERSION VERSION_GREATER "2.0.11")
191+
SET(CMAKE_CXX_FLAGS "-stdlib=libstdc++ ${CMAKE_CXX_FLAGS}")
192+
SET(SWIG_CXX_COMPILER_FLAGS "-stdlib=libstdc++ ${SWIG_CXX_COMPILER_FLAGS}")
193+
ENDIF()
194+
191195
IF (NOT ((CYGWIN AND ENABLE_TESTING) OR (DARWIN AND COMPILE_MODULAR_INTERFACE)))
192196
INCLUDE(CheckCXX11Features)
193197

@@ -210,6 +214,12 @@ IF (NOT ((CYGWIN AND ENABLE_TESTING) OR (DARWIN AND COMPILE_MODULAR_INTERFACE)))
210214
ENDIF()
211215
ENDIF()
212216

217+
include(CheckIncludeFileCXX)
218+
CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_STD_UNORDERED_MAP)
219+
IF (HAVE_STD_UNORDERED_MAP)
220+
LIST(APPEND DEFINES HAVE_STD_UNORDERED_MAP)
221+
ENDIF()
222+
213223
IF(CMAKE_BUILD_TYPE MATCHES "Release")
214224
# there's a bug on FreeBSD -march=native.
215225
# for some CPU types it does not detect the right flags
@@ -396,6 +406,20 @@ ENDIF()
396406

397407
######################### LIBRARIES #########################
398408

409+
#check for symbols
410+
include (CheckCXXSymbolExists)
411+
CHECK_CXX_SYMBOL_EXISTS(isfinite "cmath" HAVE_DECL_ISFINITE)
412+
AppendToDefines(HAVE_DECL_ISFINITE)
413+
414+
CHECK_CXX_SYMBOL_EXISTS(isinf "cmath" HAVE_DECL_ISINF)
415+
AppendToDefines(HAVE_DECL_ISINF)
416+
417+
CHECK_CXX_SYMBOL_EXISTS(isnan "cmath" HAVE_DECL_ISNAN)
418+
AppendToDefines(HAVE_DECL_ISNAN)
419+
420+
CHECK_CXX_SYMBOL_EXISTS(signgam "cmath" HAVE_DECL_SIGNGAM)
421+
AppendToDefines(HAVE_DECL_SIGNGAM)
422+
399423
# check for math functions
400424
include(CheckFunctionExists)
401425
IF(UNIX)
@@ -421,6 +445,37 @@ IF(HAVE_SQRTL)
421445
LIST(APPEND DEFINES HAVE_SQRTL)
422446
ENDIF()
423447

448+
CHECK_FUNCTION_EXISTS(finite HAVE_FPCLASS)
449+
AppendToDefines(HAVE_FPCLASS)
450+
451+
CHECK_FUNCTION_EXISTS(fpclass HAVE_FPCLASS)
452+
AppendToDefines(HAVE_FPCLASS)
453+
454+
CHECK_FUNCTION_EXISTS(isfinite HAVE_ISFINITE)
455+
AppendToDefines(HAVE_ISFINITE)
456+
457+
CHECK_FUNCTION_EXISTS(isinf HAVE_ISINF)
458+
AppendToDefines(HAVE_ISINF)
459+
460+
CHECK_FUNCTION_EXISTS(isnan HAVE_ISNAN)
461+
AppendToDefines(HAVE_ISNAN)
462+
463+
include(CheckCXXSourceCompiles)
464+
CHECK_CXX_SOURCE_COMPILES(
465+
"#include <cmath>\nint main() { return std::isinf( 0 ); }\n"
466+
HAVE_STD_ISINF )
467+
AppendToDefines(HAVE_STD_ISINF)
468+
469+
CHECK_CXX_SOURCE_COMPILES(
470+
"#include <cmath>\nint main() { return std::isfinite( 0 ); }\n"
471+
HAVE_STD_ISFINITE )
472+
AppendToDefines(HAVE_STD_ISFINITE)
473+
474+
CHECK_CXX_SOURCE_COMPILES(
475+
"#include <cmath>\nint main() { return std::isnan( 0 ); }\n"
476+
HAVE_STD_ISNAN )
477+
AppendToDefines(HAVE_STD_ISNAN)
478+
424479
# check SSE and SSE2 intrinsics header
425480
IF(NOT CYGWIN)
426481
include(CheckIncludeFile)
@@ -431,6 +486,17 @@ IF(HAVE_SSE2)
431486
ENDIF(HAVE_SSE2)
432487
ENDIF(NOT CYGWIN)
433488

489+
###### checks for random
490+
CHECK_FUNCTION_EXISTS(arc4random HAVE_ARC4RANDOM)
491+
IF(NOT HAVE_ARC4RANDOM)
492+
# assume that /dev/random is non-blocking if /dev/urandom does not exist
493+
if(EXISTS /dev/urandom)
494+
set(DEV_RANDOM "/dev/urandom" CACHE INTERNAL "" FORCE)
495+
elseif( EXISTS /dev/random )
496+
set(DEV_RANDOM "/dev/random" CACHE INTERNAL "" FORCE)
497+
endif()
498+
ENDIF()
499+
434500
FIND_PACKAGE(GDB)
435501
IF (GDB_FOUND)
436502
SET(GDB_DEFAULT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/src/.gdb)
@@ -667,7 +733,6 @@ IF (HDF5_FOUND)
667733
SET(HAVE_HDF5 1)
668734
LIST(APPEND DEFINES HAVE_HDF5)
669735
LIST(APPEND INCLUDES ${HDF5_INCLUDE_DIRS})
670-
SET(HDF5_LIBRARIES "${HDF5_LIBRARIES_RELEASE}")
671736
SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${HDF5_LIBRARIES})
672737
ENDIF()
673738

@@ -725,18 +790,21 @@ IF (SPINLOCK_FOUND)
725790
LIST(APPEND DEFINES USE_SPINLOCKS)
726791
ENDIF()
727792

728-
#FIND_PACKAGE(Protobuf)
729-
#IF (PROTOBUF_FOUND)
730-
# SET(HAVE_PROTOBUF 1)
731-
# LIST(APPEND DEFINES HAVE_PROTOBUF)
732-
# LIST(APPEND INCUDES ${PROTOBUF_INCLUDE_DIRS})
733-
# SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${PROTOBUF_LIBRARIES})
734-
#ENDIF()
793+
FIND_PACKAGE(Protobuf)
794+
IF (PROTOBUF_FOUND)
795+
SET(HAVE_PROTOBUF 1)
796+
LIST(APPEND DEFINES HAVE_PROTOBUF)
797+
LIST(APPEND INCUDES ${PROTOBUF_INCLUDE_DIRS})
798+
SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${PROTOBUF_LIBRARIES})
799+
ENDIF()
735800

736801
#SWIG Interfaces
737802
SET(CMAKE_SWIG_FLAGS "${CMAKE_SWIG_FLAGS};-w473;-w454;-w312;-w325;-fvirtual")
738803

739-
OPTION(USE_SWIG_DIRECTORS "" OFF)
804+
OPTION(USE_SWIG_DIRECTORS "Enable SWIG director classes" OFF)
805+
IF(USE_SWIG_DIRECTORS)
806+
LIST(APPEND DEFINES USE_SWIG_DIRECTORS)
807+
ENDIF()
740808

741809
# python modular
742810
IF (PythonModular OR PythonStatic)

NEWS

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
2014-01-06 Soeren Sonnenburg <sonne@debian.org>
2+
3+
* SHOGUN Release version 3.1.1 (libshogun 15.1, data 0.7, parameter 1)
4+
* This is a bugfix release:
5+
* Bugfixes:
6+
- Fix compile error occurring with CXX0X
7+
- Bump data version to required version
8+
9+
2014-01-05 Soeren Sonnenburg <sonne@debian.org>
10+
11+
* SHOGUN Release version 3.1.0 (libshogun 15.0, data 0.6, parameter 1)
12+
* This release also contains several cleanups and bugfixes:
13+
* Features:
14+
- Add option to set k-means cluster centers [Parijat Mazumdar]
15+
- Add leave one out crossvalidation scheme [Saurabh Mahindre]
16+
- Add multiclass ipython notebook tutorials [Chiyuan Zhang]
17+
- Add learning of StreamingSparseFeatures in OnlineLibLinear [Thoralf Klein]
18+
* Bugfixes:
19+
- Decrease memory footprint of SGObject
20+
- Fix protobuf detection
21+
- Fix doxygen files and various doxygen errors
22+
- Fix compile error with directors
23+
- Fix memory leak in modular interfaces and apply*()
24+
- Fix leak in KNN::store_model_features
25+
- Notebook fixes
26+
- Allow custom kernel matrices of size 2^31-1 x 2^31-1 [Koen van de Sande]
27+
- Fix Protobuf cmake detection
28+
- Fix LabelsFactory methods' object ownership in SWIG interfaces with the %newobject directive.
29+
* Cleanup and API Changes:
30+
- Introduce slim SGRefObject for refcounted objects as base class of
31+
SGObject [Thoralf Klein]
32+
33+
134
2013-10-28 Soeren Sonnenburg <sonne@debian.org>
235

336
* SHOGUN Release version 3.0.0 (libshogun 14.0, data 0.6, parameter 1)

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ Quick links to this file:
1212
* [Introduction](#introduction)
1313
* [Interfaces](#interfaces)
1414
* [Platforms](#platforms)
15-
* [Directory Contents](#contents)
15+
* [Contents](#contents)
1616
* [Applications](#applications)
1717
* [License](#license)
1818
* [Download](#download)
1919
* [References](#references)
2020

2121
Other links that may be useful:
2222

23-
* See [INSTALL](INSTALL.md) for first steps on installation and running SHOGUN.
24-
* See [README.developer](README_developer.md) for the developer documentation.
25-
* See [README.data](README_data.md) for how to download example data sets accompanying SHOGUN.
26-
* See [README.cmake](README_cmake.md) for setting particular build options with SHOGUN and cmake.
23+
* See [INSTALL](doc/md/INSTALL.md) for first steps on installation and running SHOGUN.
24+
* See [README.developer](doc/md/README_developer.md) for the developer documentation.
25+
* See [README.data](doc/md/README_data.md) for how to download example data sets accompanying SHOGUN.
26+
* See [README.cmake](doc/md/README_cmake.md) for setting particular build options with SHOGUN and cmake.
2727

2828
## Introduction
2929
---------------
@@ -53,9 +53,9 @@ each feature object allowing for on-the-fly pre-processing.
5353

5454
Shogun got initiated by Soeren Sonnenburg and Gunnar Raetsch (thats where the
5555
name ShoGun originates from). It is now developed by a much larger Team
56-
cf. [AUTHORS](AUTHORS.md) and would not have been possible without the patches
56+
cf. [AUTHORS](doc/md/AUTHORS.md) and would not have been possible without the patches
5757
and bug reports by various people and by the various authors of other machine
58-
learning packages that we utilize. See [CONTRIBUTIONS](CONTRIBUTIONS.md) for
58+
learning packages that we utilize. See [CONTRIBUTIONS](doc/md/CONTRIBUTIONS.md) for
5959
a detailled list.
6060

6161
## Interfaces
@@ -91,9 +91,9 @@ Visit http://www.shogun-toolbox.org/doc/en/current for further information.
9191
------------
9292

9393
Debian GNU/Linux, Mac OSX and WIN32/CYGWIN are supported platforms (see
94-
the [INSTALL](INSTALL.md) file for generic and platform specific installation instructions).
94+
the [INSTALL](doc/md/INSTALL.md) file for generic and platform specific installation instructions).
9595

96-
## Directory Contents
96+
## Contents
9797
-----------
9898

9999
The following directories are found in the source distribution.
@@ -125,11 +125,11 @@ Except for the files classifier/svm/Optimizer.{cpp,h},
125125
classifier/svm/SVM_light.{cpp,h}, regression/svr/SVR_light.{cpp,h}
126126
and the kernel caching functions in kernel/Kernel.{cpp,h}
127127
which are (C) Torsten Joachims and follow a different
128-
licensing scheme (cf. [LICENSE\_SVMlight](LICENSE_SVMlight.md)) SHOGUN is
128+
licensing scheme (cf. [LICENSE\_SVMlight](doc/md/LICENSE_SVMlight.md)) SHOGUN is
129129
generally licensed under the GPL version 3 or any later version (cf.
130-
[LICENSE](LICENSE.md)) with code borrowed from various GPL compatible
131-
libraries from various places (cf. [CONTRIBUTIONS](CONTRIBUTIONS.md)). See also
132-
[LICENSE\_msufsort](LICENSE_msufsort.md) and [LICENSE\_tapkee](LICENSE_tapkee.md).
130+
[LICENSE](doc/md/LICENSE.md)) with code borrowed from various GPL compatible
131+
libraries from various places (cf. [CONTRIBUTIONS](doc/md/CONTRIBUTIONS.md)). See also
132+
[LICENSE\_msufsort](doc/md/LICENSE_msufsort.md) and [LICENSE\_tapkee](doc/md/LICENSE_tapkee.md).
133133

134134
## Download
135135
-----------
@@ -207,3 +207,5 @@ https://github.com/shogun-toolbox/shogun.
207207
[17] S. Sonnenburg, G. Raetsch, C.Schaefer, and B.Schoelkopf, Large Scale
208208
Multiple Kernel Learning, Journal of Machine Learning Research, 2006,
209209
K.Bennett and E.P. Hernandez Editors.
210+
211+
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/3e5ff04ff56513867eedb5b2f4261702 "githalytics.com")](http://githalytics.com/shogun-toolbox/shogun)

README_cmake.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

cmake/ShogunUtils.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ MACRO(PrintInterfaceStatus INTERFACE_NAME INTERFACE_FLAG)
3434
ENDIF()
3535
ENDMACRO()
3636

37+
MACRO(AppendToDefines MACRO)
38+
IF (${MACRO})
39+
LIST(APPEND DEFINES ${MACRO})
40+
ENDIF()
41+
ENDMACRO()
42+
3743
# based on compiz_discover_tests
3844
function (shogun_discover_tests EXECUTABLE)
3945

0 commit comments

Comments
 (0)