Hello community, here is the log from the commit of package octave-forge-nan for openSUSE:Factory checked in at 2017-08-28 15:13:16 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/octave-forge-nan (Old) and /work/SRC/openSUSE:Factory/.octave-forge-nan.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "octave-forge-nan" Mon Aug 28 15:13:16 2017 rev:7 rq:518454 version:3.1.4 Changes: -------- --- /work/SRC/openSUSE:Factory/octave-forge-nan/octave-forge-nan.changes 2016-09-21 18:48:43.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.octave-forge-nan.new/octave-forge-nan.changes 2017-08-28 15:14:57.379348621 +0200 @@ -1,0 +2,9 @@ +Wed Aug 23 15:34:29 UTC 2017 - [email protected] + +- Update to version 3.1.4 + * Minor changes and fixes, see `news nan` for details +- Drop oblosete: + * nan-cpp11.patch + * nan_xpt2d_add_return_for_BE.patch + +------------------------------------------------------------------- Old: ---- nan-3.0.3.tar.gz nan-cpp11.patch nan_xpt2d_add_return_for_BE.patch New: ---- nan-3.1.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ octave-forge-nan.spec ++++++ --- /var/tmp/diff_new_pack.RrHZHJ/_old 2017-08-28 15:14:59.059112606 +0200 +++ /var/tmp/diff_new_pack.RrHZHJ/_new 2017-08-28 15:14:59.063112044 +0200 @@ -1,7 +1,7 @@ # # spec file for package octave-forge-nan # -# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,18 +18,13 @@ %define octpkg nan Name: octave-forge-%{octpkg} -Version: 3.0.3 +Version: 3.1.4 Release: 0 Summary: A statistics and machine learning toolbox License: GPL-3.0+ Group: Productivity/Scientific/Math Url: http://octave.sourceforge.net Source0: http://downloads.sourceforge.net/octave/%{octpkg}-%{version}.tar.gz -Patch1: nan_xpt2d_add_return_for_BE.patch -# PATCH-FIX-OPENSUSE nan-cpp11.patch -- Fix build with GCC 4.8 -Patch2: nan-cpp11.patch -BuildRequires: blas-devel -BuildRequires: gcc-c++ BuildRequires: octave-devel Requires: octave-cli >= 3.2.0 @@ -39,10 +34,7 @@ %prep %setup -q -c %{name}-%{version} -%patch1 -p0 -%if 0%{?suse_version} <= 1320 -%patch2 -p0 -%endif +sed -i 's/-lblas/-l%{octave_blas}/g' %{octpkg}-%{version}/src/Makefile %octave_pkg_src %build ++++++ nan-3.0.3.tar.gz -> nan-3.1.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/DESCRIPTION new/nan-3.1.4/DESCRIPTION --- old/nan-3.0.3/DESCRIPTION 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/DESCRIPTION 2017-08-23 11:01:57.685205054 +0200 @@ -1,6 +1,6 @@ Name: NaN -Version: 3.0.3 -Date: 2016-08-10 +Version: 3.1.4 +Date: 2017-08-23 Author: Alois Schloegl <[email protected]> Maintainer: Alois Schloegl Title: The NaN-toolbox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/Makefile new/nan-3.1.4/Makefile --- old/nan-3.0.3/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ new/nan-3.1.4/Makefile 2017-08-23 11:01:57.685205054 +0200 @@ -0,0 +1,235 @@ +## Copyright 2015-2016 Carnë Draug +## Copyright 2015-2016 Oliver Heimlich +## Copyright 2017 Julien Bect <[email protected]> +## Copyright 2017 Olaf Till <[email protected]> +## +## Copying and distribution of this file, with or without modification, +## are permitted in any medium without royalty provided the copyright +## notice and this notice are preserved. This file is offered as-is, +## without any warranty. + +## Some basic tools (can be overriden using environment variables) +SED ?= sed +TAR ?= tar +GREP ?= grep +CUT ?= cut +TR ?= tr + +## Note the use of ':=' (immediate set) and not just '=' (lazy set). +## http://stackoverflow.com/a/448939/1609556 +package := $(shell $(GREP) "^Name: " DESCRIPTION | $(CUT) -f2 -d" " | \ +$(TR) '[:upper:]' '[:lower:]') +version := $(shell $(GREP) "^Version: " DESCRIPTION | $(CUT) -f2 -d" ") + +## This are the paths that will be created for the releases. Using +## $(realpath ...) avoids problems with symlinks. +target_dir := $(realpath .)/target +release_dir := $(target_dir)/$(package)-$(version) +release_tarball := $(target_dir)/$(package)-$(version).tar.gz +html_dir := $(target_dir)/$(package)-html +html_tarball := $(target_dir)/$(package)-html.tar.gz +installation_dir := $(target_dir)/.installation +package_list := $(installation_dir)/.octave_packages +install_stamp := $(installation_dir)/.install_stamp + +## These can be set by environment variables which allow to easily +## test with different Octave versions. +ifndef OCTAVE +OCTAVE := octave +endif +OCTAVE := $(OCTAVE) --no-gui --silent --no-history --norc +MKOCTFILE ?= mkoctfile + +## Command used to set permissions before creating tarballs +FIX_PERMISSIONS ?= chmod -R a+rX,u+w,go-w,ug-s + +## Detect which VCS is used +vcs := $(if $(wildcard .hg),hg,$(if $(wildcard .git),git,unknown)) +ifeq ($(vcs),hg) +release_dir_dep := .hg/dirstate +endif +ifeq ($(vcs),git) +release_dir_dep := .git/index +endif + + +## .PHONY indicates targets that are not filenames +## (https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html) +.PHONY: help + +## make will display the command before runnning them. Use @command +## to not display it (makes specially sense for echo). +help: + @echo "Targets:" + @echo " dist - Create $(release_tarball) for release." + @echo " html - Create $(html_tarball) for release." + @echo " release - Create both of the above and show md5sums." + @echo " install - Install the package in $(installation_dir), where it is not visible in a normal Octave session." + @echo " check - Execute package tests." + @echo " doctest - Test the help texts with the doctest package." + @echo " run - Run Octave with the package installed in $(installation_dir) in the path." + @echo " clean - Remove everything made with this Makefile." + + +## +## Recipes for release tarballs (package + html) +## + +.PHONY: release dist html clean-tarballs clean-unpacked-release + +## To make a release, build the distribution and html tarballs. +release: dist html + md5sum $(release_tarball) $(html_tarball) + @echo "Upload @ https://sourceforge.net/p/octave/package-releases/new/" + @echo " and note the changeset the release corresponds to" + +## dist and html targets are only PHONY/alias targets to the release +## and html tarballs. +dist: $(release_tarball) +html: $(html_tarball) + +## An implicit rule with a recipe to build the tarballs correctly. +%.tar.gz: % + $(TAR) -c -f - --posix -C "$(target_dir)/" "$(notdir $<)" | gzip -9n > "$@" + +clean-tarballs: + @echo "## Cleaning release tarballs (package + html)..." + -$(RM) $(release_tarball) $(html_tarball) + @echo + +## Create the unpacked package. +## +## Notes: +## * having ".hg/dirstate" (or ".git/index") as a prerequesite means it is +## only rebuilt if we are at a different commit. +## * the variable RM usually defaults to "rm -f" +## * having this recipe separate from the one that makes the tarball +## makes it easy to have packages in alternative formats (such as zip) +## * note that if a commands needs to be run in a specific directory, +## the command to "cd" needs to be on the same line. Each line restores +## the original working directory. +$(release_dir): $(release_dir_dep) + -$(RM) -r "$@" +ifeq (${vcs},hg) + hg archive --exclude ".hg*" --type files "$@" +endif +ifeq (${vcs},git) + git archive --format=tar --prefix="$@/" HEAD | $(TAR) -x + $(RM) "$@/.gitignore" +endif +## Don't fall back to run the supposed necessary contents of +## 'bootstrap' here. Users are better off if they provide +## 'bootstrap'. Administrators, checking build reproducibility, can +## put in the missing 'bootstrap' file if they feel they know its +## necessary contents. +ifneq (,$(wildcard src/bootstrap)) + cd "$@/src" && ./bootstrap && $(RM) -r "autom4te.cache" +endif +## Uncomment this if your src/Makefile.in has these targets for +## pre-building something for the release (e.g. documentation). +# cd "$@/src" && ./configure && $(MAKE) prebuild && \ +# $(MAKE) distclean && $(RM) Makefile +## + ${FIX_PERMISSIONS} "$@" + +run_in_place = $(OCTAVE) --eval ' pkg ("local_list", "$(package_list)"); ' \ + --eval ' pkg ("load", "$(package)"); ' + +html_options = --eval 'options = get_html_options ("octave-forge");' +## Uncomment this for package documentation. +# html_options = --eval 'options = get_html_options ("octave-forge");' \ +# --eval 'options.package_doc = "$(package).texi";' +$(html_dir): $(install_stamp) + $(RM) -r "$@"; + $(run_in_place) \ + --eval ' pkg load generate_html; ' \ + $(html_options) \ + --eval ' generate_package_html ("$(package)", "$@", options); '; + $(FIX_PERMISSIONS) "$@"; + +clean-unpacked-release: + @echo "## Cleaning unpacked release tarballs (package + html)..." + -$(RM) -r $(release_dir) $(html_dir) + @echo + +## +## Recipes for installing the package. +## + +.PHONY: install clean-install + +octave_install_commands = \ +' llist_path = pkg ("local_list"); \ + mkdir ("$(installation_dir)"); \ + load (llist_path); \ + local_packages(cellfun (@ (x) strcmp ("$(package)", x.name), local_packages)) = []; \ + save ("$(package_list)", "local_packages"); \ + pkg ("local_list", "$(package_list)"); \ + pkg ("prefix", "$(installation_dir)", "$(installation_dir)"); \ + pkg ("install", "-local", "-verbose", "$(release_tarball)"); ' + +## Install unconditionally. Maybe useful for testing installation with +## different versions of Octave. +install: $(release_tarball) + @echo "Installing package under $(installation_dir) ..." + $(OCTAVE) --eval $(octave_install_commands) + touch $(install_stamp) + +## Install only if installation (under target/...) is not current. +$(install_stamp): $(release_tarball) + @echo "Installing package under $(installation_dir) ..." + $(OCTAVE) --eval $(octave_install_commands) + touch $(install_stamp) + +clean-install: + @echo "## Cleaning installation under $(installation_dir) ..." + -$(RM) -r $(installation_dir) + @echo + + +## +## Recipes for testing purposes +## + +.PHONY: run doctest check + +## Start an Octave session with the package directories on the path for +## interactice test of development sources. +run: $(install_stamp) + $(run_in_place) --persist + +## Test example blocks in the documentation. Needs doctest package +## https://octave.sourceforge.io/doctest/index.html +doctest: $(install_stamp) + $(run_in_place) --eval 'pkg load doctest;' \ + --eval "targets = '$(shell (ls inst; ls src | $(GREP) .oct) | $(CUT) -f2 -d@ | $(CUT) -f1 -d.)';" \ + --eval "targets = strsplit (targets, ' '); doctest (targets);" + + +## Test package. +octave_test_commands = \ +' dirs = {"inst", "src"}; \ + dirs(cellfun (@ (x) ! isdir (x), dirs)) = []; \ + if (isempty (dirs)) error ("no \"inst\" or \"src\" directory"); exit (1); \ + else __run_test_suite__ (dirs, {}); endif ' +## the following works, too, but provides no overall summary output as +## __run_test_suite__ does: +## +## else cellfun (@runtests, horzcat (cellfun (@ (dir) ostrsplit (([~, dirs] = system (sprintf ("find %s -type d", dir))), "\n\r", true), dirs, "UniformOutput", false){:})); endif ' +check: $(install_stamp) + $(run_in_place) --eval $(octave_test_commands) + + +## +## CLEAN +## + +.PHONY: clean + +clean: clean-tarballs clean-unpacked-release clean-install + @echo "## Removing target directory (if empty)..." + -rmdir $(target_dir) + @echo + @echo "## Cleaning done" + @echo + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/NEWS new/nan-3.1.4/NEWS --- old/nan-3.0.3/NEWS 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/NEWS 2017-08-23 11:01:57.685205054 +0200 @@ -1,3 +1,36 @@ +2017-08-23: Release of NaN-Tb v3.1.4 + +- minor fixes: + license text, file permissions, + remove dependency on -lcholmod + + +2017-08-14: Release of NaN-Tb v3.1.3 + +- fix bug #43931: bug in help of corrcoef.m + reported by: locker@vp... +- fix bug #47673: build failure for ppc64 architecture + reported by: Michel Normand +- bug #48771 "Link against the shared library libsvm" + had been fixed previously in Nov 2017 + +- tiedrank: increase matlab compatibility by allowing + third input argument + + +2017-01-10: Release of NaN-tb v3.1.2 + +- fix build when Octave does not support openmp + +2017-01-03: Release of NaN-tb v3.1.1 + +- add Makefile to built release + +2016-11-30: Release of NaN-tb v3.1.0 + +- fix bug 48426: built for Octave 4.2.0 +- prepare for using external libsvm and liblinear +- fix typos, address compiler warnings and improve docu 2016-08-10: Release of NaN-tb v3.0.3 - tcdf: fix bug #48731 (thanks to Nir Krakauer) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/inst/corrcoef.m new/nan-3.1.4/inst/corrcoef.m --- old/nan-3.0.3/inst/corrcoef.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/inst/corrcoef.m 2017-08-23 11:01:57.689205132 +0200 @@ -37,7 +37,7 @@ % 'pairwise': [default] % 'alpha' 0.01 : significance level to compute confidence interval % -% [R,p,ci1,ci2,nansig] = CORRCOEF(...); +% [R,p,ci1,ci2,nan_sig] = CORRCOEF(...); % R is the correlation matrix % R(i,j) is the correlation coefficient r between X(:,i) and Y(:,j) % p gives the significance of R diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/inst/range.m new/nan-3.1.4/inst/range.m --- old/nan-3.0.3/inst/range.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/inst/range.m 2017-08-23 11:01:57.705205448 +0200 @@ -12,13 +12,11 @@ % % see also: IQR, MAD, HISTO2, HISTO3, PERCENTILE, QUANTILE +% Copyright (C) 2009,2010,2011 by Alois Schloegl <[email protected]> +% This function is part of the NaN-toolbox +% http://pub.ist.ac.at/~schloegl/matlab/NaN/ -% $Id$ -% Copyright (C) 2009,2010,2011 by Alois Schloegl <[email protected]> -% This function is part of the NaN-toolbox -% http://pub.ist.ac.at/~schloegl/matlab/NaN/ - - +% This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 3 of the License, or % (at your option) any later version. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/inst/test_sc.m new/nan-3.1.4/inst/test_sc.m --- old/nan-3.0.3/inst/test_sc.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/inst/test_sc.m 2017-08-23 11:01:57.713205603 +0200 @@ -30,8 +30,7 @@ % [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed. % John Wiley & Sons, 2001. -% $Id$ -% Copyright (C) 2005,2006,2008,2009,2010 by Alois Schloegl <[email protected]> +% Copyright (C) 2005,2006,2008,2009,2010,2016 by Alois Schloegl <[email protected]> % This function is part of the NaN-toolbox % http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -107,7 +106,7 @@ D = [ones(size(D,1),1),D]; % add 1-column lambda = CC.hyperparameter.lambda; gamma = CC.hyperparameter.gamma; - d = repmat(NaN,size(D,1),size(CC.MD,1)); + d = repmat(NaN,size(D,1),size(CC.MD,3)); ECM = CC.MD./CC.NN; NC = size(ECM); ECM0 = squeeze(sum(ECM,3)); %decompose ECM @@ -153,11 +152,15 @@ elseif strcmp(t2,'statistical'); - if isempty(mode) - mode.TYPE = upper(t3); - end; - D = [ones(size(D,1),1),D]; % add 1-column - W = repmat(NaN, size(D,2), size(CC.MD,3)); + if isempty(mode) + mode.TYPE = upper(t3); + else + tmp=mode; + clear mode; + mode.TYPE=tmp; + end; + D = [ones(size(D,1),1),D]; % add 1-column + W = repmat(NaN, size(D,2), size(CC.MD,3)); if 0, elseif strcmpi(mode.TYPE,'LD2'), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/inst/tiedrank.m new/nan-3.1.4/inst/tiedrank.m --- old/nan-3.0.3/inst/tiedrank.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/inst/tiedrank.m 2017-08-23 11:01:57.713205603 +0200 @@ -1,4 +1,4 @@ -function R=tiedrank(X,DIM) +function R=tiedrank(X,flag1,flag2) % TIEDRANK compute rank of samples, the mean value is used in case of ties % this function is just a wrapper for RANKS, and provided for compatibility % with the statistics toolbox of matlab(tm) @@ -9,8 +9,7 @@ % see also: RANKS -% $Id$ -% Copyright (C) 2009,2010 by Alois Schloegl <[email protected]> +% Copyright (C) 2009,2010,2017 by Alois Schloegl <[email protected]> % This function is part of the NaN-toolbox % http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -28,12 +27,18 @@ % along with this program; If not, see <http://www.gnu.org/licenses/>. -if nargin>1, - error('more than 1 input argument is currently not supported ') +if nargin>3, + error('more than 3 input argument is currently not supported ') end; +if nargin<2, + flag1=0; +end; +if nargin<3, + flag2=0; +end; -if nargout>1, - error('more than 1 output argument is currently not supported ') +if nargout>2, + warning('more than 1 output argument is currently not supported ') end; if nargin<2, @@ -47,4 +52,3 @@ R = ranks(X,DIM); - \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/inst/xval.m new/nan-3.1.4/inst/xval.m --- old/nan-3.0.3/inst/xval.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/inst/xval.m 2017-08-23 11:01:57.717205681 +0200 @@ -62,13 +62,12 @@ % References: % [1] R. Duda, P. Hart, and D. Stork, Pattern Classification, second ed. % John Wiley & Sons, 2001. -% [2] A. Schl�gl, J. Kronegg, J.E. Huggins, S. G. Mason; +% [2] A. Schlögl, J. Kronegg, J.E. Huggins, S. G. Mason; % Evaluation criteria in BCI research. % (Eds.) G. Dornhege, J.R. Millan, T. Hinterberger, D.J. McFarland, K.-R.Müller; % Towards Brain-Computer Interfacing, MIT Press, 2007, p.327-342 -% $Id$ -% Copyright (C) 2008,2009,2010 by Alois Schloegl <[email protected]> +% Copyright (C) 2008,2009,2010,2016 by Alois Schloegl % This function is part of the NaN-toolbox % http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -102,7 +101,11 @@ W = []; if iscell(classlabel) - [b,i,C] = unique(classlabel{:,1}); + % hack to handle NaN's in unique(...) + c = classlabel{:,1}; + ix = find(~isnan(c)); + C = c; + [b,i,C(ix)] = unique(c(ix)); if size(classlabel,2)>1, W = [classlabel{:,2}]; end; @@ -126,8 +129,6 @@ error('length of data and classlabel does not fit'); end; -% use only valid samples -ix0 = find(~any(isnan(C),2)); if isempty(NG) if (nargin<4) || strcmpi(arg4,'LOOM') @@ -153,23 +154,27 @@ MODE.hyperparameter = []; end -cl = repmat(NaN,size(classlabel,1),1); +cl = repmat(NaN,size(classlabel,1),1); +output = repmat(NaN,size(classlabel,1),max(C)); for k = 1:max(NG), - ix = ix0(NG(ix0)~=k); + ix = find(~any(isnan(C),2) & (NG~=k)); if isempty(W), CC = train_sc(D(ix,:), C(ix), MODE); else CC = train_sc(D(ix,:), C(ix), MODE, W(ix)); end; - ix = ix0(NG(ix0)==k); + ix = find(NG==k); r = test_sc(CC, D(ix,:)); - cl(ix,1) = r.classlabel; + cl(ix,1) = r.classlabel; + output(ix,:) = r.output; end; %R = kappa(C,cl,'notIgnoreNAN',W); R = kappa(C,cl,[],W); %R2 = kappa(R.H); +R.OUTPUT=output; +R.CL=cl; R.ERR = 1-R.ACC; if isnumeric(R.Label) R.Label = cellstr(int2str(R.Label)); @@ -177,10 +182,11 @@ if nargout>1, % final classifier + ix = find(~any(isnan(C),2)); if isempty(W), - CC = train_sc(D,C,MODE); + CC = train_sc(D(ix,:), C(ix), MODE); else - CC = train_sc(D,C,MODE,W); + CC = train_sc(D(ix,:), C(ix), MODE,W); end; CC.Labels = 1:max(C); %CC.Labels = unique(C); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/Makefile new/nan-3.1.4/src/Makefile --- old/nan-3.0.3/src/Makefile 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/Makefile 2017-08-23 11:01:57.721205761 +0200 @@ -1,14 +1,14 @@ #################################################### -# Copyright 2010,2011,2012,2015 Alois Schloegl -# This is part of the NaN-toolbox - a statistics and machine learning toolbox for data with and without missing values. +# Copyright 2010,2011,2012,2015 Alois Schloegl +# This is part of the NaN-toolbox - a statistics and machine learning toolbox for data with and without missing values. # http://pub.ist.ac.at/~schloegl/matlab/NaN/ #################################################### -### modify directories according to your needs +### modify directories according to your needs -# Define non-default octave-version +# Define non-default octave-version # Octave - global install (e.g. from debian package) -# OCTAVE_VERSION= +# OCTAVE_VERSION= # Better alternative: define an OCTAVE_VERSION bash variable (or in .bashrc or .profile) # OCTAVE_VERSION=-3.6.3 @@ -26,9 +26,9 @@ # path to GNUMEX libraries, available from here http://sourceforge.net/projects/gnumex/ GNUMEX = $(HOME)/bin/win32/gnumex GNUMEX64 = $(HOME)/bin/win64/gnumex -# building gnumex64 was difficult, these hints were quite useful: +# building gnumex64 was difficult, these hints were quite useful: # http://sourceforge.net/mailarchive/forum.php?thread_name=AANLkTinZvxgC9ezp2P3UCX_a7TAUYuVsp2U40MQUV6qr%40mail.gmail.com&forum_name=gnumex-users -# Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin; +# Instead of building "mex shortpath.c" and "mex uigetpath.c", I used empty m-functions within argout=argin; #################################################### MKOCTFILE ?= mkoctfile$(OCTAVE_VERSION) CC ?= gcc @@ -37,6 +37,13 @@ OCTMEX = $(MKOCTFILE) --mex RM = rm + +### in case libsvm is installed and should be used +# CFLAGS += -DHAVE_EXTERNAL_LIBSVM +### in case liblinear is installed and should be used +# CFLAGS += -DHAVE_EXTERNAL_LIBLINEAR + + # Support Debian Hardening flags # https://wiki.debian.org/HardeningWalkthrough#Handling_dpkg-buildflags_in_your_upstream_build_system CFLAGS += $(CPPFLAGS) @@ -56,7 +63,7 @@ MATMEX = $(MATLABDIR)/bin/mex $(MEX_OPTION) -PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex +PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex ### per default only the mex-files for octave are built mex4o octave: $(PROGS) @@ -65,13 +72,13 @@ ### Matlab configuration - search for a matlab directory if not defined above ifeq (,$(MATLABDIR)) ifneq (,$(shell ls -1 /usr/local/ |grep MATLAB)) - # use oldest, typically mex-files are compatible with newer Matlab versions + # use oldest, typically mex-files are compatible with newer Matlab versions MATLABDIR=/usr/local/MATLAB/$(shell ls -1rt /usr/local/MATLAB/ |grep "^R20*" |head -1) endif endif -### if MATLABDIR has been found or defined +### if MATLABDIR has been found or defined ifneq (,$(MATLABDIR)) ifneq (,$(shell ls -1 $(MATLABDIR)/bin/mexext)) MEX_EXT=$(shell $(MATLABDIR)/bin/mexext) @@ -85,35 +92,52 @@ all: octave win32 win64 mex4m clean: - -$(RM) *.o *.obj *.o64 core octave-core *.oct *~ *.mex* + -$(RM) *.o *.obj *.o64 core octave-core *.oct *~ *.mex* #$(PROGS): Makefile ######################################################### -# Octave, MATLAB on Linux +# Octave, MATLAB on Linux ######################################################### -svm%_mex.mex: svm%_mex.cpp svm.o svm_model_octave.o - env CC=$(CXX) $(OCTMEX) "$<" svm.o svm_model_octave.o -svm%_mex.$(MEX_EXT): svm%_mex.cpp svm.o svm_model_matlab.o - $(MATMEX) "$<" svm.o svm_model_matlab.o +ifneq (,$(findstring HAVE_EXTERNAL_LIBSVM,$(CFLAGS))) +svm%_mex.mex: svm%_mex.cpp svm_model_octave.o + $(OCTMEX) $(CFLAGS) $< svm_model_octave.o -lsvm -o $@ +svm%_mex.$(MEX_EXT): svm%_mex.cpp svm_model_matlab.o + $(MATMEX) $< svm_model_matlab.o -lsvm -o $@ +else +svm.o: svm.cpp + $(CC) $(CFLAGS) -c svm.cpp +svm%_mex.mex: svm%_mex.cpp svm_model_octave.o svm.o + $(OCTMEX) $^ -o $@ +svm%_mex.$(MEX_EXT): svm%_mex.cpp svm_model_matlab.o svm.o + $(MATMEX) $^ -o $@ +endif + %.$(MEX_EXT): %.cpp $(MATMEX) "$<" -svm_model_octave.o: svm_model_matlab.c - env CC=$(CC) $(MKOCTFILE) -o "$@" -c "$<" -svm_model_matlab.o: svm_model_matlab.c - $(CXX) $(CFLAGS) -I $(MATLABDIR)/extern/include -o "$@" -c "$<" -svm.o: svm.cpp - $(CC) $(CFLAGS) -c svm.cpp +svm_model_octave.o: svm_model_matlab.c + $(MKOCTFILE) -o "$@" -c "$<" +svm_model_matlab.o: svm_model_matlab.c + $(CXX) $(CFLAGS) -I $(MATLABDIR)/extern/include -o "$@" -c "$<" +ifneq (,$(findstring HAVE_EXTERNAL_LIBLINEAR,$(CFLAGS))) +train.$(MEX_EXT) predict.$(MEX_EXT): train.c tron.o linear_model_matlab.c + $(CXX) $(CFLAGS) -I $(MATLABDIR)/extern/include -c linear_model_matlab.c + $(MATMEX) -lblas train.c tron.o -llinear linear_model_matlab.o + #$(MATMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o +train.mex predict.mex: train.c tron.o linear_model_matlab.c + $(OCTMEX) -lblas train.c tron.o -llinear linear_model_matlab.c +else train.$(MEX_EXT) predict.$(MEX_EXT): train.c tron.o linear.o linear_model_matlab.c $(CXX) $(CFLAGS) -I $(MATLABDIR)/extern/include -c linear_model_matlab.c - $(MATMEX) -lblas train.c tron.o linear.o linear_model_matlab.o + $(MATMEX) -lblas train.c tron.o linear.o linear_model_matlab.o #$(MATMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o train.mex predict.mex: train.c tron.o linear.o linear_model_matlab.c - env CC=$(CXX) $(OCTMEX) -lblas train.c tron.o linear.o linear_model_matlab.c + $(OCTMEX) -lblas train.c tron.o linear.o linear_model_matlab.c linear.o: linear.cpp $(CXX) $(CFLAGS) -c linear.cpp +endif tron.o: tron.cpp tron.h $(CXX) $(CFLAGS) -c tron.cpp @@ -129,18 +153,18 @@ %.obj: %.cpp $(CROSS)$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<" %.obj: %.c - $(CROSS)$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<" + $(CROSS)$(CXX) -fopenmp -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W32MAT_INC) -O2 -DMX_COMPAT_32 "$<" train.mexw32 predict.mexw32: train.obj linear.obj linear_model_matlab.obj tron.obj - $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" linear_model_matlab.obj linear.obj tron.obj -llibmx -llibmex -llibmat -lcholmod -lblas + $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" linear_model_matlab.obj linear.obj tron.obj -llibmx -llibmex -llibmat -lblas -svmpredict_mex.mexw32 : svmpredict_mex.obj svm.obj svm_model_matlab.obj - $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat -lcholmod +svmpredict_mex.mexw32 : svmpredict_mex.obj svm.obj svm_model_matlab.obj + $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat svmtrain_mex.mexw32 : svmtrain_mex.obj svm.obj svm_model_matlab.obj - $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat -lcholmod + $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" svm_model_matlab.obj svm.obj -llibmx -llibmex -llibmat %.mexw32: %.obj - $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread + $(CROSS)$(CXX) -shared $(GNUMEX)/mex.def -o "$@" -L$(GNUMEX) -s "$<" -llibmx -llibmex -llibmat -lgomp -lpthread @@ -155,13 +179,13 @@ $(CROSS64)$(CXX) -c -DMATLAB_MEX_FILE -x c++ -o "$@" -I$(W64MAT_INC) -O2 "$<" train.mexw64 predict.mexw64: train.o64 linear.o64 linear_model_matlab.o64 tron.o64 - $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" linear_model_matlab.o64 linear.o64 tron.o64 -llibmx -llibmex -llibmat -lcholmod -lblas + $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" linear_model_matlab.o64 linear.o64 tron.o64 -llibmx -llibmex -llibmat -lblas svmpredict_mex.mexw64 : svmpredict_mex.o64 svm.o64 svm_model_matlab.o64 - $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat -lcholmod + $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat svmtrain_mex.mexw64 : svmtrain_mex.o64 svm.o64 svm_model_matlab.o64 - $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat -lcholmod + $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" svm_model_matlab.o64 svm.o64 -llibmx -llibmex -llibmat %.mexw64: %.o64 - $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" -llibmx -llibmex -llibmat -lcholmod -lgomp -lpthread + $(CROSS64)$(CXX) -shared $(GNUMEX64)/mex.def -o "$@" -L$(GNUMEX64) -s "$<" -llibmx -llibmex -llibmat -lgomp -lpthread diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/linear.cpp new/nan-3.1.4/src/linear.cpp --- old/nan-3.0.3/src/linear.cpp 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/linear.cpp 2017-08-23 11:01:57.721205761 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2007-2009 The LIBLINEAR Project. -Copyright (c) 2010 Alois Schloegl <[email protected]> +Copyright (c) 2010,2016 Alois Schloegl This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -1875,16 +1874,16 @@ int save_model(const char *model_file_name, const struct model *model_) { - int i; + unsigned i; int nr_feature=model_->nr_feature; - int n; + unsigned n; const parameter& param = model_->param; if(model_->bias>=0) n=nr_feature+1; else n=nr_feature; - int w_size = n; + unsigned w_size = n; FILE *fp = fopen(model_file_name,"w"); if(fp==NULL) return -1; @@ -2198,7 +2197,7 @@ void get_labels(const model *model_, int* label) { if (model_->label != NULL) - for(int i=0;i<model_->nr_class;i++) + for(unsigned i=0;i<model_->nr_class;i++) label[i] = model_->label[i]; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/linear.h new/nan-3.1.4/src/linear.h --- old/nan-3.0.3/src/linear.h 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/linear.h 2017-08-23 11:01:57.721205761 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2007-2009 The LIBLINEAR Project. -Copyright (c) 2010 Alois Schloegl <[email protected]> +Copyright (c) 2010,2016 Alois Schloegl This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/linear_model_matlab.c new/nan-3.1.4/src/linear_model_matlab.c --- old/nan-3.0.3/src/linear_model_matlab.c 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/linear_model_matlab.c 2017-08-23 11:01:57.721205761 +0200 @@ -27,8 +27,11 @@ #include <stdlib.h> #include <string.h> -#include "linear.h" - +#if defined(HAVE_EXTERNAL_LIBLINEAR) + #include <linear.h> +#else + #include "linear.h" +#endif #include "mex.h" #ifdef tmwtypes_h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/linear_model_matlab.h new/nan-3.1.4/src/linear_model_matlab.h --- old/nan-3.0.3/src/linear_model_matlab.h 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/linear_model_matlab.h 2017-08-23 11:01:57.721205761 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2007-2009 The LIBLINEAR Project. -Copyright (c) 2010 Alois Schloegl <[email protected]> +Copyright (c) 2010,2106 Alois Schloegl This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/make.m new/nan-3.1.4/src/make.m --- old/nan-3.0.3/src/make.m 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/make.m 2017-08-23 11:01:57.725205841 +0200 @@ -1,11 +1,24 @@ function make(arg1) % This make.m is used for Matlab under Windows -% $Id$ % Copyright (C) 2010,2011 by Alois Schloegl <[email protected]> % This function is part of the NaN-toolbox % http://pub.ist.ac.at/~schloegl/matlab/NaN/ + +% This program is free software; you can redistribute it and/or modify +% it under the terms of the GNU General Public License as published by +% the Free Software Foundation; either version 3 of the License, or +% (at your option) any later version. +% +% This program is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program; If not, see <http://www.gnu.org/licenses/>. + % add -largeArrayDims on 64-bit machines if (nargin>0 && strcmp(arg1,'clean')), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/predict.c new/nan-3.1.4/src/predict.c --- old/nan-3.0.3/src/predict.c 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/predict.c 2017-08-23 11:01:57.725205841 +0200 @@ -27,7 +27,11 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "linear.h" +#if defined(HAVE_EXTERNAL_LIBLINEAR) + #include <linear.h> +#else + #include "linear.h" +#endif #include "mex.h" #include "linear_model_matlab.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/svm_model_matlab.c new/nan-3.1.4/src/svm_model_matlab.c --- old/nan-3.0.3/src/svm_model_matlab.c 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/svm_model_matlab.c 2017-08-23 11:01:57.725205841 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2000-2009 Chih-Chung Chang and Chih-Jen Lin -Copyright (c) 2010 Alois Schloegl <[email protected]> +Copyright (c) 2010,2016 Alois Schloegl <[email protected]> This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -59,7 +58,11 @@ #include <stdlib.h> #include <string.h> -#include "svm.h" +#if defined(HAVE_EXTERNAL_LIBSVM) + #include <libsvm/svm.h> +#else + #include "svm.h" +#endif #include "mex.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/svmpredict_mex.cpp new/nan-3.1.4/src/svmpredict_mex.cpp --- old/nan-3.0.3/src/svmpredict_mex.cpp 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/svmpredict_mex.cpp 2017-08-23 11:01:57.729205920 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin -Copyright (c) 2010,2011,2015 Alois Schloegl <[email protected]> +Copyright (c) 2010,2011,2015,2016 Alois Schloegl This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -28,7 +27,11 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "svm.h" +#if defined(HAVE_EXTERNAL_LIBSVM) + #include <libsvm/svm.h> +#else + #include "svm.h" +#endif #include "mex.h" #include "svm_model_matlab.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/svmtrain_mex.cpp new/nan-3.1.4/src/svmtrain_mex.cpp --- old/nan-3.0.3/src/svmtrain_mex.cpp 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/svmtrain_mex.cpp 2017-08-23 11:01:57.729205920 +0200 @@ -1,8 +1,7 @@ /* -$Id$ Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin -Copyright (c) 2010,2015 Alois Schloegl <[email protected]> +Copyright (c) 2010,2015,2016 Alois Schloegl This function is part of the NaN-toolbox http://pub.ist.ac.at/~schloegl/matlab/NaN/ @@ -29,7 +28,11 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#include "svm.h" +#if defined(HAVE_EXTERNAL_LIBSVM) + #include <libsvm/svm.h> +#else + #include "svm.h" +#endif #include "mex.h" #include "svm_model_matlab.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/train.c new/nan-3.1.4/src/train.c --- old/nan-3.0.3/src/train.c 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/train.c 2017-08-23 11:01:57.729205920 +0200 @@ -29,7 +29,11 @@ #include <stdlib.h> #include <string.h> #include <ctype.h> -#include "linear.h" +#if defined(HAVE_EXTERNAL_LIBLINEAR) + #include <linear.h> +#else + #include "linear.h" +#endif #include "mex.h" #include "linear_model_matlab.h" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/nan-3.0.3/src/xptopen.cpp new/nan-3.1.4/src/xptopen.cpp --- old/nan-3.0.3/src/xptopen.cpp 2016-08-10 00:16:09.000000000 +0200 +++ new/nan-3.1.4/src/xptopen.cpp 2017-08-23 11:01:57.729205920 +0200 @@ -1031,15 +1031,16 @@ double xpt2d(uint64_t x) { // x is little-endian 64bit IBM floating point format - char c = *((char*)&x+7) & 0x7f; - uint64_t u = x; - *((char*)&u+7)=0; - #if __BYTE_ORDER == __BIG_ENDIAN mexErrMsgTxt("IEEE-to-IBM conversion on big-endian platform not supported, yet"); + return(NaN); #elif __BYTE_ORDER==__LITTLE_ENDIAN + char c = *((char*)&x+7) & 0x7f; + uint64_t u = x; + *((char*)&u+7)=0; + #if DEBUG mexPrintf("xpt2d(%016Lx): [0x%x]\n",x,c); @@ -1071,15 +1072,15 @@ */ uint64_t d2xpt(double x) { - uint64_t s,m; - int e; - #if __BYTE_ORDER == __BIG_ENDIAN mexErrMsgTxt("IEEE-to-IBM conversion on big-endian platform not supported, yet"); - + return(0x2eLL << 56); // NaN - not a number #elif __BYTE_ORDER==__LITTLE_ENDIAN + uint64_t s,m; + int e; + if (x != x) return(0x2eLL << 56); // NaN - not a number
