diff options
Diffstat (limited to 'academic')
-rw-r--r-- | academic/flann/README | 10 | ||||
-rw-r--r-- | academic/flann/flann.SlackBuild | 119 | ||||
-rw-r--r-- | academic/flann/flann.info | 10 | ||||
-rw-r--r-- | academic/flann/slack-desc | 19 |
4 files changed, 158 insertions, 0 deletions
diff --git a/academic/flann/README b/academic/flann/README new file mode 100644 index 0000000000000..9ac890b57ff9d --- /dev/null +++ b/academic/flann/README @@ -0,0 +1,10 @@ +FLANN is a library for performing fast approximate nearest neighbor searches +in high dimensional spaces. It contains a collection of algorithms we found +to work best for nearest neighbor search and a system for automatically +choosing the best algorithm and optimum parameters depending on the dataset. + +FLANN is written in C++ and contains bindings for the following languages: +C, MATLAB and Python. The Python bindings will need numpy, and the MATLAB +bindings will need MATLAB installed and with its binaries directory set into +the PATH. If you want to build the MATLAB bindings, set the environment +variable WITH_MATLAB to 1. diff --git a/academic/flann/flann.SlackBuild b/academic/flann/flann.SlackBuild new file mode 100644 index 0000000000000..8f91d2afa2a56 --- /dev/null +++ b/academic/flann/flann.SlackBuild @@ -0,0 +1,119 @@ +#!/bin/sh + +# Slackware build script for flann + +# Written by João Felipe Santos <joao.eel@gmail.com> + +# Copyright (c) 2010 João Felipe Santos +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +PRGNAM=flann +VERSION=${VERSION:-1.2} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i486 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION-src +unzip $CWD/$PRGNAM-$VERSION-src.zip +cd $PRGNAM-$VERSION-src +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Hack to deactivate MATLAB bindings +if [ -z $WITH_MATLAB ]; then + sed -i '/matlab/d' src/CMakeLists.txt +fi + +sed -i '/CMAKE_INSTALL_PREFIX/d' src/CMakeLists.txt + +mkdir -p tmp +cd tmp + cmake \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DMAN_INSTALL_DIR=/usr/man \ + -DCMAKE_BUILD_TYPE=Release ../src + make + make install DESTDIR=$PKG +cd .. + +# Install Python bindings, then remove the source files from the package +cd $PKG/usr/python +python setup.py install --root=$PKG +cd $TMP/$PRGNAM-$VERSION-src +rm -rf $PKG/usr/python/ + +# LIB_SUFFIX seems ignored and $prefix/lib is hardcoded +if [ "$LIBDIRSUFFIX" = "64" ]; then + mv $PKG/usr/lib/* $PKG/usr/lib64/ + rmdir $PKG/usr/lib +fi + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + doc/manual.pdf README \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/academic/flann/flann.info b/academic/flann/flann.info new file mode 100644 index 0000000000000..e0bac9624ddbe --- /dev/null +++ b/academic/flann/flann.info @@ -0,0 +1,10 @@ +PRGNAM="flann" +VERSION="1.2" +HOMEPAGE="http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN" +DOWNLOAD="http://www.cs.ubc.ca/~mariusm/uploads/FLANN/flann-1.2-src.zip" +MD5SUM="29ab1f3926d8cf95c37f30c56055c23e" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +MAINTAINER="João Felipe Santos" +EMAIL="joao.eel@gmail.com" +APPROVED="rworkman" diff --git a/academic/flann/slack-desc b/academic/flann/slack-desc new file mode 100644 index 0000000000000..1b8781d897215 --- /dev/null +++ b/academic/flann/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler------------------------------------------------------| +flann: flann (Fast Library for Approximate Nearest Neighbors) flann: +flann: +flann: FLANN is a library for performing fast approximate +flann: nearest neighbor searches in high dimensional spaces. It contains a +flann: collection of algorithms we found to work best for nearest neighbor +flann: search and a system for automatically choosing the best algorithm and +flann: optimum parameters depending on the dataset. +flann: +flann: Homepage: http://www.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN +flann: +flann: |