Commit 4bd9be9c authored by Christian Kastner's avatar Christian Kastner

Initial packaging

parent 057db67a
libmpikmeans (1.5-1) unstable; urgency=low
* Initial release (Closes: #622275)
* debian/patches:
- 0001-Properly-build-shared-and-static-libraries-programs
- 0002-Drop-unused-option
- 0003-Correct-command-name-in-help
-- Christian Kastner <debian@kvr.at> Wed, 13 Apr 2011 00:07:57 +0200
Source: libmpikmeans
Section: libs
Priority: extra
Maintainer: Christian Kastner <debian@kvr.at>
Build-Depends:
debhelper (>= 7.0.50~),
python-support (>= 0.90),
python-all-dev,
cython,
python-numpy,
libboost-dev,
libboost-filesystem-dev,
libboost-program-options-dev
Standards-Version: 3.9.2
Homepage: http://mloss.org/software/view/48/
Vcs-Git: git://scm.kvr.at/git/pkg-libmpikmeans.git
Vcs-Browser: http://scm.kvr.at/git//?p=pkg-libmpikmeans.git;a=summary
Package: libmpikmeans-dev
Section: libdevel
Architecture: any
Depends:
${misc:Depends},
libmpikmeans1 (= ${binary:Version})
Description: Development libraries and header files for MPIKmeans
This library uses an algorithm that yields the very same solution as standard
k-means, even after each iteration. However, it uses triangle inequalities, and
is much faster.
.
Note: MPI here does not refer to the Message Passing Interface; rather, it is
an acronym for Max Planck Institute, where this algorithm was developed.
.
This package contains the header files and static libraries.
Package: libmpikmeans1
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends}
Description: Fast Library for k-means Clustering
This library uses an algorithm that yields the very same solution as standard
k-means, even after each iteration. However, it uses triangle inequalities, and
is much faster.
.
Note: MPI here does not refer to the Message Passing Interface; rather, it is
an acronym for Max Planck Institute, where this algorithm was developed.
.
This package contains the shared libraries.
Package: libmpikmeans-dbg
Section: debug
Architecture: any
Depends:
${misc:Depends},
libmpikmeans1 (= ${binary:Version})
Description: Debugging symbols for MPIKmeans
This library uses an algorithm that yields the very same solution as standard
k-means, even after each iteration. However, it uses triangle inequalities, and
is much faster.
.
Note: MPI here does not refer to the Message Passing Interface; rather, it is
an acronym for Max Planck Institute, where this algorithm was developed.
.
This package contains the debugging symbols.
Package: mpikmeans-tools
Architecture: any
Depends:
${shlibs:Depends},
${misc:Depends},
libmpikmeans1 (= ${binary:Version})
Description: Standalone applications for MPIKmeans
This library uses an algorithm that yields the very same solution as standard
k-means, even after each iteration. However, it uses triangle inequalities, and
is much faster.
.
Note: MPI here does not refer to the Message Passing Interface; rather, it is
an acronym for Max Planck Institute, where this algorithm was developed.
.
This package contains the standalone applications.
Package: python-mpikmeans
Section: python
Architecture: any
Depends:
${python:Depends},
${shlibs:Depends},
${misc:Depends},
libmpikmeans1 (= ${binary:Version}),
python-numpy
Description: Python bindings for MPIKmeans
This library uses an algorithm that yields the very same solution as standard
k-means, even after each iteration. However, it uses triangle inequalities, and
is much faster.
.
Note: MPI here does not refer to the Message Passing Interface; rather, it is
an acronym for Max Planck Institute, where this algorithm was developed.
.
This package contains the Python bindings. Both the old, ctypes-based and the
new, Cython-based interfaces are provided.
Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166
Upstream-Name: MPIKmeans
Upstream-Contact: Peter Gehler <pgehler@tuebingen.mpg.de>
Source: http://mloss.org/software/view/48/
Disclaimer:
For DFSG purposes, some of the files have been removed from the upstream
source. Specifically, those files were:
Precompiled binaries: *.o, *.so, *.mexa64, *.mexglx, mpi_kmeans,
mpi_kmeans64, mpi_assign, mpi_assign64
Cython auto-generated code: py_kmeans.pyx
Files: *
Copyright: 2008-2009, Peter Gehler <pgehler@tuebingen.mpg.de>
License: Apache-2
Files: py_kmeans.pyx
Copyright: 2008, Thomas Wiecki <wiecki@tuebingen.mpg.de>
2008, Christoph Lampert <christoph.lampert@tuebingen.mpg.de>
License: GPL-2+
Files: debian/*
Copyright: 2011, Christian Kastner <debian@kvr.at>
License: GPL-2+
Files: debian/patches/*
Copyright: 2011, Christian Kastner <debian@kvr.at>
License: Apache-2
License: Apache-2
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
.
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
License: GPL-2+
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 2 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, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
.
On Debian systems, the full text of the GNU General Public
License version 2 can be found in the file
"/usr/share/common-licenses/GPL-2".
mpi_kmeans.h usr/include
lib*.a usr/lib
lib*.so usr/lib
libmpikmeans.so.1 libmpikmeans1 #MINVER#
(c++)"kmeans_run(double*, double const*, unsigned int*, unsigned int, unsigned int, unsigned int, unsigned int)@Base" 1.5
(c++)"kmeans_error(char*)@Base" 1.5
(c++)"comp_randperm(void const*, void const*)@Base" 1.5
(c++)"compute_sserror(double const*, double const*, unsigned int const*, unsigned int, unsigned int)@Base" 1.5
(c++)"compute_distance(double const*, double const*, unsigned int)@Base" 1.5
(c++)"add_point_to_cluster(unsigned int, double*, double const*, unsigned int*, unsigned int)@Base" 1.5
(c++)"init_point_to_cluster(unsigned int, double const*, double const*, unsigned int, unsigned int, double*, float*, float const*)@Base" 1.5
(c++)"assign_point_to_cluster(unsigned int, double const*, double const*, unsigned int, unsigned int, unsigned int, double*, float*, float*, float*)@Base" 1.5
(c++)"compute_cluster_distances(float*, float*, double const*, unsigned int, unsigned int, bool const*)@Base" 1.5
(c++)"remove_identical_clusters(double*, float*, double const*, unsigned int*, unsigned int*, unsigned int, unsigned int, unsigned int)@Base" 1.5
(c++)"remove_point_from_cluster(unsigned int, double*, double const*, unsigned int*, unsigned int)@Base" 1.5
(c++)"assign_point_to_cluster_ordinary(double const*, double const*, unsigned int, unsigned int)@Base" 1.5
(c++)"randperm(unsigned int*, unsigned int)@Base" 1.5
kmeans@Base 1.5
.TH MPI_ASSIGN 1 "April 11, 2011"
.SH NAME
mpi_assign \- Assign points to cluster centers produced by mpi_kmeans
.SH SYNOPSIS
.B mpi_assign
.RI [ options ]
.SH DESCRIPTION
\fBmpi_assign\fP is a program that assigns points to a list of cluster centers
as generated by \fBmpi_kmeans\fR(1).
.SH OPTIONS
A summary of options is included below.
.SS "Generic Options"
.TP
\fB\-\-help\fR
Produce help message
.SS "Input/Output Options"
.TP
\fB\-\-data\fR file
Data file, one datum per line (default: "data.txt")
.TP
\fB\-\-cluster\fR file
Cluster file, one cluster center per line (default: clustercenter.txt)
.TP
\fB\-\-assignment\fR file
Output file, one cluster center per line (default: assignment.txt)
.SS "Example:"
.IP
mpi_assign \fB\-\-data\fR example.txt \fB\-\-cluster\fR clusters.txt \fB\-\-assignment\fR assignment.txt
.SH SEE ALSO
.BR mpi_kmeans (1)
.SH AUTHOR
\fBmpi_assign\fR was written by Peter Gehler <pgehler@tuebingen.mpg.de>.
.PP
This manual page was written by Christian Kastner <debian@kvr.at>,
for the Debian project (and may be used by others).
.\" Hey, EMACS: -*- nroff -*-
.TH MPI_KMEANS 1 "April 11, 2011"
.SH NAME
mpi_kmeans \- K-Means clustering tool
.SH SYNOPSIS
.B mpi_kmeans
.RI [ options ]
.SH DESCRIPTION
\fBmpi_kmeans\fP is a program that uses k-means clustering to produce a list of
cluster centers. The resulting data can be used by \fBmpi_assign\fR(1) to assign
points to those cluster centers.
.SH OPTIONS
A summary of options is included below.
.SS "Generic Options:"
.TP
\fB\-\-help\fR
Produce help message
.SS "Input/Output Options:"
.TP
\fB\-\-data\fR \fIfile\fR
Training file, one datum per line (default: "data.txt")
.TP
\fB\-\-output\fR \fIfile\fR
Output file, one cluster center per line (default: "output.txt")
.SS "K-Means Options:"
.TP
\fB\-\-k\fR \fInum\fR
Number of clusters to generate (default: 100)
.TP
\fB\-\-restarts\fR \fInum\fR
Number of k\-means restarts (default: 0 = single run)
.TP
\fB\-\-maxiter\fR \fInum\fR
Maximum number of k\-means iterations (default: 0 = infinity)
.SH EXAMPLES
.IP
mpi_kmeans \-\-k 2 \-\-data example.txt \-\-output clusters.txt
.SH SEE ALSO
.BR mpi_assign (1)
.SH AUTHOR
\fBmpi_kmeans\fR was written by Peter Gehler <peter.gehler@tuebingen.mpg.de>.
.PP
This manual page was written by Christian Kastner <debian@kvr.at>,
for the Debian project (and may be used by others).
mpi_kmeans usr/bin
mpi_assign usr/bin
debian/mpi_kmeans.1
debian/mpi_assign.1
From: Christian Kastner <debian@kvr.at>
Date: Mon, 11 Apr 2011 19:26:09 +0200
Subject: [PATCH] Properly build shared and static libraries, programs
Modify upstream's Makefile to 1) properly build shared and static libraries,
2) link upstream's programs to the shared libraries and 3) build Python
extensions for all supported Python versions.
Forwarded: not-needed
Last-Update: 2011-04-11
Index: mpikmeans-1.5/Makefile
===================================================================
--- mpikmeans-1.5.orig/Makefile 2011-04-11 19:49:33.004001563 +0200
+++ mpikmeans-1.5/Makefile 2011-04-11 19:57:56.312002046 +0200
@@ -1,16 +1,33 @@
-#
-# Choose your compiler
-#
-#
+#!/usr/bin/make -f
+
+CC = gcc
+CXX = g++
+PYTHON = python
+
+CFLAGS +=
+LDFLAGS +=
+LIBS +=
-#CC = gcc-4.2
-#CPP = g++-4.2
-#CFLAGS=-O3 -ffast-math -fomit-frame-pointer -fPIC -mtune=k8 -march=k8 -Werror
-CC = gcc-4.1
-CPP = g++-4.1
-CFLAGS=-O3 -ffast-math -fomit-frame-pointer -fPIC -Werror
-#CC=/agbs/share/sw/icc/bin/icc
-#CFLAGS= -fast -DCOMPILE_WITH_ICC -Werror
+LIB_CFLAGS = $(CFLAGS) -fPIC
+LIB_LDFLAGS = $(LDFLAGS)
+LIB_LIBS = $(LIBS)
+
+PROG_CFLAGS = $(CFLAGS)
+PROG_LDFLAGS = $(LDFLAGS) -L. -Wl,--as-needed
+PROG_LIBS = $(LIBS) -lmpikmeans -lboost_system -lboost_program_options -lboost_filesystem
+
+
+# The real LVER/LSUBVER should be passed on by debian/rules
+LVER ?= 0
+LSUBVER ?= 0
+LIBFILE = libmpikmeans.so.$(LVER).$(LSUBVER)
+
+# Without PYVER present, use the default Python version.
+#
+# It is expected that the 'python' target -- where this var is used -- will be
+# called once for every supported Python version. IOW, we don't iterated here,
+# we assume our caller (usually: debian/rules) is iterating.
+PYVER ?= $(shell pyversions -d -v)
#
# MPI KMEANS FLAGS
@@ -25,19 +42,6 @@
MATLAB_INCLUDE=-I$(MATLABDIR)/extern/include
#
-# BOOST LIBS (for standalone only)
-#
-BOOST_LIB=-L/kyb/agbs/pgehler/lib -lboost_program_options-gcc41-mt -lboost_filesystem-gcc41-mt -lboost_system-gcc41-mt
-BOOST_INCLUDE=-I/kyb/agbs/pgehler/include/boost-1_36/
-
-#
-# PYTHON
-#
-PYTHON_INCLUDE=-I/usr/include/python2.5
-PYTHON_LIB=-lpython2.5
-NUMPY_INCLUDE=-I/usr/lib/python2.5/site-packages/numpy/core/include
-
-#
# ARCHITECURE
#
@@ -49,34 +53,31 @@
#SUFFIX=mexa64
#MATLAB_LIB=-L$(MATLABDIR)/bin/glnxa64 -lmex
-LIBS=/usr/lib/gcc/i486-linux-gnu/4.1/libstdc++.a /usr/lib/libm.a
-all: standalone matlab libmpikmeans python
+all: lib standalone python
+lib: $(LIBFILE) libmpikmeans.a
+standalone: mpi_kmeans mpi_assign
+python: cython_wrapper
+
matlab: mpi_kmeans_mex.$(SUFFIX) mpi_assign_mex.$(SUFFIX)
-standalone: mpi_kmeans_main mpi_assign_main
-python: cython_wrapper
-mpi_kmeans.o: mpi_kmeans.cxx mpi_kmeans.h
- $(CC) $(CFLAGS) $(VERBOSEFLAG) $(PRECISION) -c -o $@ mpi_kmeans.cxx
+libmpikmeans.a:
+ $(CXX) $(CFLAGS) $(LDFLAGS) -c -o libmpikmeans-static.o mpi_kmeans.cxx
+ ar cru libmpikmeans.a libmpikmeans-static.o
+
+$(LIBFILE): mpi_kmeans.cxx mpi_kmeans.h
+ $(CXX) $(LIB_CFLAGS) $(LIB_LDFLAGS) -shared \
+ -Wl,-soname=libmpikmeans.so.$(LVER) \
+ -o $@ $(VERBOSEFLAGS) $(PRECISION) \
+ mpi_kmeans.cxx $(LIB_LIBS)
+ ln -s $@ libmpikmeans.so.$(LVER)
+ ln -s libmpikmeans.so.$(LVER) libmpikmeans.so
-libmpikmeans: mpi_kmeans.o
- ar rc libmpikmeans.a mpi_kmeans.o
- ranlib libmpikmeans.a
- $(CC) -shared -Wl,-soname=libmpikmeans.so -fPIC $(CFLAGS) -o libmpikmeans.so $(VERBOSEFLAGS) $(PRECISION) mpi_kmeans.cxx
-
-mpi_kmeans_main.o: mpi_kmeans_main.cxx
- $(CC) $(CFLAGS) $(BOOST_INCLUDE) -c -o mpi_kmeans_main.o mpi_kmeans_main.cxx
-
-mpi_assign_main.o: mpi_assign_main.cxx
- $(CC) $(CFLAGS) $(BOOST_INCLUDE) -c -o mpi_assign_main.o mpi_assign_main.cxx
-
-mpi_kmeans_main: libmpikmeans mpi_kmeans_main.o
- $(CC) mpi_kmeans_main.o $(CFLAGS) -L/usr/lib/ -static -o mpi_kmeans -lm libmpikmeans.a \
- $(BOOST_LIB) $(LIBS)
-
-mpi_assign_main: libmpikmeans mpi_assign_main.o
- $(CC) mpi_assign_main.o $(CFLAGS) -L/usr/lib/ -static -o mpi_assign -lm libmpikmeans.a \
- $(BOOST_LIB) $(LIBS)
+mpi_kmeans: mpi_kmeans_main.cxx $(LIBFILE)
+ $(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ mpi_kmeans_main.cxx $(PROG_LIBS)
+
+mpi_assign: mpi_assign_main.cxx $(LIBFILE)
+ $(CXX) $(PROG_CFLAGS) $(PROG_LDFLAGS) -o $@ mpi_assign_main.cxx $(PROG_LIBS)
%_mex.o: %_mex.cxx
$(CC) $(CFLAGS) $(MATLAB_INCLUDE) $(VERBOSEFLAG) $(PRECISION) -c $^ -o $@
@@ -87,18 +88,27 @@
mpi_assign_mex.$(SUFFIX): libmpikmeans mpi_assign_mex.o
$(CC) mpi_assign_mex.o -shared -o mpi_assign_mex.$(SUFFIX) libmpikmeans.a $(MATLAB_LIB)
-cython_wrapper: py_kmeans.c mpi_kmeans.o
- $(CPP) $(CFLAGS) $(PYTHON_INCLUDE) $(NUMPY_INCLUDE) -c -o py_kmeans.o py_kmeans.c
- $(CPP) $(CFLAGS) $(PYTHON_LIB) -lm -pthread -shared py_kmeans.o mpi_kmeans.o -o py_kmeans.so
+py_kmeans.c: py_kmeans.pyx
+ cython py_kmeans.pyx
+
+# See note regarding PYVER above
+cython_wrapper: py_kmeans.c
+ mkdir -p python-build/python$(PYVER)
+ $(CXX) $(CFLAGS) -c -I/usr/include/python$(PYVER) \
+ -pthread -fPIC -o py_kmeans.o py_kmeans.c
+ $(CXX) $(CFLAGS) $(PYTHON_LDFLAGS) -pthread -shared -Wl,--as-needed \
+ -lpython$(PYVER) -L. -lmpikmeans \
+ -o python-build/python$(PYVER)/py_kmeans.so py_kmeans.o
-test:
+matlab-test:
matlab -nojvm -r "test_code;exit"
clean:
rm -f *.o
rm -f *.mexglx
rm -f *.mexa64
- rm -f libmpikmeans.so
+ rm -f libmpikmeans.so*
rm -f libmpikmeans.a
+ rm -rf py_kmeans.c python-build
rm -f mpi_assign mpi_kmeans
From: Christian Kastner <debian@kvr.at>
Date: Mon, 11 Apr 2011 19:31:14 +0200
Subject: [PATCH] Drop unused option
Upstream's binaries say they support a run-time "verbose" option, but they
don't -- it's a compile-time option. Drop these to avoid confusion.
Forwarded: no
Last-Update: 2011-04-11
Index: mpikmeans-1.5/mpi_assign_main.cxx
===================================================================
--- mpikmeans-1.5.orig/mpi_assign_main.cxx 2011-04-11 19:49:28.420001563 +0200
+++ mpikmeans-1.5/mpi_assign_main.cxx 2011-04-11 19:49:36.180001563 +0200
@@ -102,7 +102,6 @@
po::options_description generic("Generic Options");
generic.add_options()
("help","Produce help message")
- ("verbose","Verbose output")
;
po::options_description input_options("Input/Output Options");
@@ -124,8 +123,6 @@
po::store(po::command_line_parser(argc,argv).options(all_options).run(), vm);
po::notify(vm);
- bool verbose = vm.count("verbose");
-
if (vm.count("help")) {
std::cerr << "Assigning points to cluster center" << std::endl;
std::cerr << all_options << std::endl;
Index: mpikmeans-1.5/mpi_kmeans_main.cxx
===================================================================
--- mpikmeans-1.5.orig/mpi_kmeans_main.cxx 2011-04-11 19:49:28.468001563 +0200
+++ mpikmeans-1.5/mpi_kmeans_main.cxx 2011-04-11 19:49:36.180001563 +0200
@@ -212,7 +212,6 @@
po::options_description generic("Generic Options");
generic.add_options()
("help","Produce help message")
- ("verbose","Verbose output")
;
po::options_description input_options("Input/Output Options");
@@ -241,8 +240,6 @@
po::store(po::command_line_parser(argc,argv).options(all_options).run(), vm);
po::notify(vm);
- bool verbose = vm.count("verbose");
-
if (vm.count("help")) {
std::cerr << "K-Means clustering" << std::endl;
std::cerr << all_options << std::endl;
From: Christian Kastner <debian@kvr.at>
Date: Mon, 11 Apr 2011 21:04:23 +0200
Subject: [PATCH] Correct command name in help
mpi_kmeans accidentally speaks about mpi_assign a few times
Forwarded: no
Last-Update: 2011-04-11
Index: mpikmeans-1.5/mpi_kmeans_main.cxx
===================================================================
--- mpikmeans-1.5.orig/mpi_kmeans_main.cxx 2011-04-11 21:02:39.596001579 +0200
+++ mpikmeans-1.5/mpi_kmeans_main.cxx 2011-04-11 21:03:22.824011767 +0200
@@ -101,7 +101,7 @@
if (in.fail()) {
std::cerr << "Failed to open file \""
<< train_filename << "\" for reading." << std::endl;
- std::cerr << "Try mpi_assign --help" << std::endl;
+ std::cerr << "Try mpi_kmeans --help" << std::endl;
exit(EXIT_FAILURE);
}
@@ -134,7 +134,7 @@
if (data_X.size() == 0) {
std::cerr << "No points read from file \"" << train_filename
<< "\"" << std::endl;
- std::cerr << "Try mpi_assign --help" << std::endl;
+ std::cerr << "Try mpi_kmeans --help" << std::endl;
exit(EXIT_FAILURE);
}
@@ -149,7 +149,7 @@
if (in.fail()) {
std::cerr << "Failed to open file \""
<< train_filename << "\" for reading." << std::endl;
- std::cerr << "Try mpi_assign --help" << std::endl;
+ std::cerr << "Try mpi_kmeans --help" << std::endl;
exit(EXIT_FAILURE);
}
@@ -157,7 +157,7 @@
if (nof_points == 0) {
std::cerr << "No points read from file \"" << train_filename
<< "\"" << std::endl;
- std::cerr << "Try mpi_assign --help" << std::endl;
+ std::cerr << "Try mpi_kmeans --help" << std::endl;
exit(EXIT_FAILURE);
}
0001-Properly-build-shared-and-static-libraries-programs.patch
0002-Drop-unused-option.patch
0003-Correct-command-name-in-help.patch
python-build/* usr/lib/pyshared
mpi_kmeans.py usr/share/pyshared
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# Get version numbers for SONAME from changelog
DVER = $(shell dpkg-parsechangelog | grep '^Version')
LVER = $(shell echo $(DVER) | sed -e 's/Version: \([0-9]*\)\..*/\1/')
LSUBVER = $(shell echo $(DVER) | sed -e 's/Version: .*\.\([0-9]*\).*/\1/')
export LVER
export LSUBVER
# Python versions supported by this package
PYVERS = $(shell pyversions -r -v)
export PYVERS
CFLAGS += -Wall -Wno-unused
%:
dh $@
override_dh_auto_build:
make lib
make standalone
for py in $(PYVERS); do \
PYVER=$$py make python; \
done
override_dh_strip:
dh_strip --dbg-package=libmpikmeans-dbg
# Rename pyshared to pymodules
cd debian/libmpikmeans-dbg/usr/lib/debug/usr/lib && mv pyshared pymodules
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment