Skip to content

Commit

Permalink
Merge branch 'release/3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jan 4, 2014
2 parents d94ab1b + ac94b20 commit 8a97355
Show file tree
Hide file tree
Showing 365 changed files with 5,047 additions and 1,406 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,6 @@ examples/undocumented/python_modular/*
CMakeCache.txt
/build
/third_party

# protobuf
src/shogun/io/protobuf/*.pb.*
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[submodule "data"]
path = data
url = git://github.com/shogun-toolbox/shogun-data.git
branch = master
[submodule "doc/tutorial"]
path = doc/tutorial
url = git://github.com/shogun-toolbox/shogun-tutorial.git
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ matrix:
virtualenv:
system_site_packages: true
before_install:
- if [ -z $OSX ] ; then sudo apt-add-repository -y ppa:kubuntu-ppa/backports ; sudo apt-get update -qq ; fi
- 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
- 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
- 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
Expand Down
102 changes: 85 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# $ make

project(shogun)
cmake_minimum_required(VERSION 2.8.4)
cmake_minimum_required(VERSION 2.8.8)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
include(ShogunUtils)

Expand Down Expand Up @@ -69,11 +69,7 @@ ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
ENDIF()

# Get processor type, sets MACHINE macro
IF(NOT WIN32)
execute_process(COMMAND uname -m
OUTPUT_VARIABLE MACHINE_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
SET(MACHINE ${MACHINE_OUTPUT})
ENDIF()
SET(MACHINE ${CMAKE_SYSTEM_PROCESSOR})

SET(EXT_LIB_SWIG_RUBY_MODULAR ".so")
if(DARWIN)
Expand Down Expand Up @@ -186,8 +182,16 @@ ENDIF()
# check for supported c++11 features
#
# clang with -std=c++11 and -stdlib=libc++ does not work
# well with swig generated cxx
# hence disable c++11 for this case.
# well with swig generated cxx hence disable c++11 for this case.

# TODO: until swig 2.0.11 does not support compilation with libc++
# There are PRs against SWIG HEAD to fix this hence it needs to be checked
# which later version can support compilation with libc++
IF (COMPILE_MODULAR_INTERFACE AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") AND NOT SWIG_VERSION VERSION_GREATER "2.0.11")
SET(CMAKE_CXX_FLAGS "-stdlib=libstdc++ ${CMAKE_CXX_FLAGS}")
SET(SWIG_CXX_COMPILER_FLAGS "-stdlib=libstdc++ ${SWIG_CXX_COMPILER_FLAGS}")
ENDIF()

IF (NOT ((CYGWIN AND ENABLE_TESTING) OR (DARWIN AND COMPILE_MODULAR_INTERFACE)))
INCLUDE(CheckCXX11Features)

Expand All @@ -210,6 +214,12 @@ IF (NOT ((CYGWIN AND ENABLE_TESTING) OR (DARWIN AND COMPILE_MODULAR_INTERFACE)))
ENDIF()
ENDIF()

include(CheckIncludeFileCXX)
CHECK_INCLUDE_FILE_CXX("unordered_map" HAVE_STD_UNORDERED_MAP)
IF (HAVE_STD_UNORDERED_MAP)
LIST(APPEND DEFINES HAVE_STD_UNORDERED_MAP)
ENDIF()

IF(CMAKE_BUILD_TYPE MATCHES "Release")
# there's a bug on FreeBSD -march=native.
# for some CPU types it does not detect the right flags
Expand Down Expand Up @@ -396,6 +406,20 @@ ENDIF()

######################### LIBRARIES #########################

#check for symbols
include (CheckCXXSymbolExists)
CHECK_CXX_SYMBOL_EXISTS(isfinite "cmath" HAVE_DECL_ISFINITE)
AppendToDefines(HAVE_DECL_ISFINITE)

CHECK_CXX_SYMBOL_EXISTS(isinf "cmath" HAVE_DECL_ISINF)
AppendToDefines(HAVE_DECL_ISINF)

CHECK_CXX_SYMBOL_EXISTS(isnan "cmath" HAVE_DECL_ISNAN)
AppendToDefines(HAVE_DECL_ISNAN)

CHECK_CXX_SYMBOL_EXISTS(signgam "cmath" HAVE_DECL_SIGNGAM)
AppendToDefines(HAVE_DECL_SIGNGAM)

# check for math functions
include(CheckFunctionExists)
IF(UNIX)
Expand All @@ -421,6 +445,37 @@ IF(HAVE_SQRTL)
LIST(APPEND DEFINES HAVE_SQRTL)
ENDIF()

CHECK_FUNCTION_EXISTS(finite HAVE_FPCLASS)
AppendToDefines(HAVE_FPCLASS)

CHECK_FUNCTION_EXISTS(fpclass HAVE_FPCLASS)
AppendToDefines(HAVE_FPCLASS)

CHECK_FUNCTION_EXISTS(isfinite HAVE_ISFINITE)
AppendToDefines(HAVE_ISFINITE)

CHECK_FUNCTION_EXISTS(isinf HAVE_ISINF)
AppendToDefines(HAVE_ISINF)

CHECK_FUNCTION_EXISTS(isnan HAVE_ISNAN)
AppendToDefines(HAVE_ISNAN)

include(CheckCXXSourceCompiles)
CHECK_CXX_SOURCE_COMPILES(
"#include <cmath>\nint main() { return std::isinf( 0 ); }\n"
HAVE_STD_ISINF )
AppendToDefines(HAVE_STD_ISINF)

CHECK_CXX_SOURCE_COMPILES(
"#include <cmath>\nint main() { return std::isfinite( 0 ); }\n"
HAVE_STD_ISFINITE )
AppendToDefines(HAVE_STD_ISFINITE)

CHECK_CXX_SOURCE_COMPILES(
"#include <cmath>\nint main() { return std::isnan( 0 ); }\n"
HAVE_STD_ISNAN )
AppendToDefines(HAVE_STD_ISNAN)

# check SSE and SSE2 intrinsics header
IF(NOT CYGWIN)
include(CheckIncludeFile)
Expand All @@ -431,6 +486,17 @@ IF(HAVE_SSE2)
ENDIF(HAVE_SSE2)
ENDIF(NOT CYGWIN)

###### checks for random
CHECK_FUNCTION_EXISTS(arc4random HAVE_ARC4RANDOM)
IF(NOT HAVE_ARC4RANDOM)
# assume that /dev/random is non-blocking if /dev/urandom does not exist
if(EXISTS /dev/urandom)
set(DEV_RANDOM "/dev/urandom" CACHE INTERNAL "" FORCE)
elseif( EXISTS /dev/random )
set(DEV_RANDOM "/dev/random" CACHE INTERNAL "" FORCE)
endif()
ENDIF()

FIND_PACKAGE(GDB)
IF (GDB_FOUND)
SET(GDB_DEFAULT_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/src/.gdb)
Expand Down Expand Up @@ -667,7 +733,6 @@ IF (HDF5_FOUND)
SET(HAVE_HDF5 1)
LIST(APPEND DEFINES HAVE_HDF5)
LIST(APPEND INCLUDES ${HDF5_INCLUDE_DIRS})
SET(HDF5_LIBRARIES "${HDF5_LIBRARIES_RELEASE}")
SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${HDF5_LIBRARIES})
ENDIF()

Expand Down Expand Up @@ -725,18 +790,21 @@ IF (SPINLOCK_FOUND)
LIST(APPEND DEFINES USE_SPINLOCKS)
ENDIF()

#FIND_PACKAGE(Protobuf)
#IF (PROTOBUF_FOUND)
# SET(HAVE_PROTOBUF 1)
# LIST(APPEND DEFINES HAVE_PROTOBUF)
# LIST(APPEND INCUDES ${PROTOBUF_INCLUDE_DIRS})
# SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${PROTOBUF_LIBRARIES})
#ENDIF()
FIND_PACKAGE(Protobuf)
IF (PROTOBUF_FOUND)
SET(HAVE_PROTOBUF 1)
LIST(APPEND DEFINES HAVE_PROTOBUF)
LIST(APPEND INCUDES ${PROTOBUF_INCLUDE_DIRS})
SET(POSTLINKFLAGS ${POSTLINKFLAGS} ${PROTOBUF_LIBRARIES})
ENDIF()

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

OPTION(USE_SWIG_DIRECTORS "" OFF)
OPTION(USE_SWIG_DIRECTORS "Enable SWIG director classes" OFF)
IF(USE_SWIG_DIRECTORS)
LIST(APPEND DEFINES USE_SWIG_DIRECTORS)
ENDIF()

# python modular
IF (PythonModular OR PythonStatic)
Expand Down
26 changes: 20 additions & 6 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
2013-11-28 Soeren Sonnenburg <[email protected]>
2014-01-05 Soeren Sonnenburg <[email protected]>

* SHOGUN Release version 3.0.1 (libshogun 14.0, data 0.6, parameter 1)
* This release also contains several enhancements, cleanups and bugfixes:
* SHOGUN Release version 3.1.0 (libshogun 15.0, data 0.6, parameter 1)
* This release also contains several cleanups and bugfixes:
* Features:
- Todo
- Add option to set k-means cluster centers [Parijat Mazumdar]
- Add leave one out crossvalidation scheme [Saurabh Mahindre]
- Add multiclass ipython notebook tutorials [Chiyuan Zhang]
- Add learning of StreamingSparseFeatures in OnlineLibLinear [Thoralf Klein]
* Bugfixes:
- Todo
- Decrease memory footprint of SGObject
- Fix protobuf detection
- Fix doxygen files and various doxygen errors
- Fix compile error with directors
- Fix memory leak in modular interfaces and apply*()
- Fix leak in KNN::store_model_features
- Notebook fixes
- Allow custom kernel matrices of size 2^31-1 x 2^31-1 [Koen van de Sande]
- Fix Protobuf cmake detection
- Fix LabelsFactory methods' object ownership in SWIG interfaces with the %newobject directive.
* Cleanup and API Changes:
- Todo
- Introduce slim SGRefObject for refcounted objects as base class of
SGObject [Thoralf Klein]


2013-10-28 Soeren Sonnenburg <[email protected]>

Expand Down
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ Quick links to this file:
* [Introduction](#introduction)
* [Interfaces](#interfaces)
* [Platforms](#platforms)
* [Directory Contents](#contents)
* [Contents](#contents)
* [Applications](#applications)
* [License](#license)
* [Download](#download)
* [References](#references)

Other links that may be useful:

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

## Introduction
---------------
Expand Down Expand Up @@ -53,9 +53,9 @@ each feature object allowing for on-the-fly pre-processing.

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

## Interfaces
Expand Down Expand Up @@ -91,9 +91,9 @@ Visit http://www.shogun-toolbox.org/doc/en/current for further information.
------------

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

## Directory Contents
## Contents
-----------

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

## Download
-----------
Expand Down Expand Up @@ -207,3 +207,5 @@ https://github.com/shogun-toolbox/shogun.
[17] S. Sonnenburg, G. Raetsch, C.Schaefer, and B.Schoelkopf, Large Scale
Multiple Kernel Learning, Journal of Machine Learning Research, 2006,
K.Bennett and E.P. Hernandez Editors.

[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/3e5ff04ff56513867eedb5b2f4261702 "githalytics.com")](http://githalytics.com/shogun-toolbox/shogun)
49 changes: 0 additions & 49 deletions README_cmake.md

This file was deleted.

6 changes: 6 additions & 0 deletions cmake/ShogunUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ MACRO(PrintInterfaceStatus INTERFACE_NAME INTERFACE_FLAG)
ENDIF()
ENDMACRO()

MACRO(AppendToDefines MACRO)
IF (${MACRO})
LIST(APPEND DEFINES ${MACRO})
ENDIF()
ENDMACRO()

# based on compiz_discover_tests
function (shogun_discover_tests EXECUTABLE)

Expand Down
Loading

0 comments on commit 8a97355

Please sign in to comment.