├── .gitignore ├── circle.yml ├── recipe ├── build.sh └── meta.yaml ├── conda-forge.yml ├── LICENSE ├── ci_support ├── run_docker_build.sh └── upload_or_check_non_existence.py ├── .travis.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | 3 | build_artefacts 4 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | machine: 2 | services: 3 | - docker 4 | 5 | dependencies: 6 | # Note, we used to use the naive caching of docker images, but found that it was quicker 7 | # just to pull each time. #rollondockercaching 8 | override: 9 | - docker pull pelson/obvious-ci:latest_x64 10 | # - docker pull pelson/conda32_obvious_ci 11 | 12 | test: 13 | override: 14 | # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. 15 | - ./ci_support/run_docker_build.sh 16 | -------------------------------------------------------------------------------- /recipe/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cannot build flann from within the source directory 4 | mkdir build 5 | cd build 6 | 7 | # On OSX, we need to ensure we're using conda's gcc/g++ 8 | if [[ `uname` == Darwin ]]; then 9 | export CC=gcc 10 | export LD=gcc 11 | export CXX=g++ 12 | fi 13 | 14 | cmake .. \ 15 | -DCMAKE_INSTALL_PREFIX=$PREFIX \ 16 | -DBUILD_MATLAB_BINDINGS:BOOL=OFF \ 17 | -DBUILD_PYTHON_BINDINGS:BOOL=OFF \ 18 | -DBUILD_EXAMPLES:BOOL=OFF \ 19 | -DBUILD_DOC:BOOL=OFF 20 | 21 | make 22 | make install 23 | -------------------------------------------------------------------------------- /conda-forge.yml: -------------------------------------------------------------------------------- 1 | travis: 2 | secure: 3 | BINSTAR_TOKEN: XsNBSTdSlhwP7iqCBRAqHWxrJfays+2I+c6dXrkhZpPB85Ql1UH7t3T3e/N7OkxQmwBMHV9qATh87JHxaOoDkNoelOe2BmK4nLEDQS+S1s0pfcNlCJ38e7TWmtRMBfTYDH9vB3T+vUPkPDSqDFHkmg4MJXv6RZN473fUfnIkFKXT26X7otj3OPa5a/dMkgA+jovx9yFL+lxdakyt5t/bAqI433H2zqYZhqODCTggALpPoHolcXe3t2wAZO4Z7QE7g7XIMDbwDfYtG+Ql2PRYP+yg8nFJsUYmhQTRY75fbusOGOurgejrF2E/zmh/LCeho6fvbEvaP7cjnhUWil9hZc0BJ2k475ZAY0IJ4PsEMU3QGm2aniwMbqleYujTX1UeyTr9MdjKX+5aSIUJrkh/5zpodM0WxHFgsSJnhPsRZtovJ3QyLG7LMbpxkd6N2Dqs93m+NnLjFjAgvFGRFbgaThy5YTtxcqeXFn0WcdVe4YDBa35UDtAKpicESSrcVSjSn7wizWzv2CmRRQNV/5HTvbSUWg0IkfsmOMjrc3gdXz4pmFK56zck110aTNkC2YGLGG/rkSe+XzZVYyiAvjJP0+k6wt9LslT/2RQeilTvaPY2Zh7DGWYtJ4SvcBpB5hEmPzOZHDMkyGbLQ62LbN+ACOzbxAR/pHTIu0X7MDFFvg8= 4 | appveyor: 5 | secure: 6 | BINSTAR_TOKEN: MP4hZYylDyUWEsrt3u3cod2sbFeRwUziH02mvQOdbjsTO/l1yIxDkP/76rSIjcGC 7 | -------------------------------------------------------------------------------- /recipe/meta.yaml: -------------------------------------------------------------------------------- 1 | {% set version = "1.8.4" %} 2 | 3 | package: 4 | name: flann 5 | version: {{ version }} 6 | 7 | source: 8 | fn: flann-{{ version }}.tar.gz 9 | url: https://github.com/mariusmuja/flann/archive/{{ version }}.tar.gz 10 | md5: 774b74580e3cbc5b0d45c6ec345a64ae 11 | 12 | build: 13 | number: 0 14 | skip: true # [win] 15 | 16 | requirements: 17 | build: 18 | - gcc # [osx] 19 | - hdf5 20 | - cmake 21 | run: 22 | - libgcc # [osx] 23 | - hdf5 24 | 25 | test: 26 | commands: 27 | # Verify libraries. 28 | - test -f $PREFIX/lib/libflann_s.a # [unix] 29 | - test -f $PREFIX/lib/libflann.dylib # [osx] 30 | - test -f $PREFIX/lib/libflann.so # [linux] 31 | - test -f $PREFIX/lib/libflann_cpp_s.a # [unix] 32 | - test -f $PREFIX/lib/libflann_cpp.dylib # [osx] 33 | - test -f $PREFIX/lib/libflann_cpp.so # [linux] 34 | 35 | about: 36 | home: http://www.cs.ubc.ca/research/flann/ 37 | license: BSD 3-Clause 38 | license_file: COPYING 39 | summary: "The Fast Library for Approximate Nearest Neighbors" 40 | 41 | extra: 42 | recipe-maintainers: 43 | - jakevdp 44 | - jakirkham 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-clause license 2 | Copyright (c) conda-forge 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 10 | 11 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 14 | -------------------------------------------------------------------------------- /ci_support/run_docker_build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here 4 | # will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent 5 | # changes to this script, consider a proposal to conda-smithy so that other feedstocks can also 6 | # benefit from the improvement. 7 | 8 | FEEDSTOCK_ROOT=$(cd "$(dirname "$0")/.."; pwd;) 9 | RECIPE_ROOT=$FEEDSTOCK_ROOT/recipe 10 | 11 | docker info 12 | 13 | config=$(cat < ~/.condarc 39 | # A lock sometimes occurs with incomplete builds. The lock file is stored in build_artefacts. 40 | conda clean --lock 41 | 42 | conda update --yes --all 43 | conda install --yes conda-build==1.18.2 44 | conda info 45 | 46 | # Embarking on 1 case(s). 47 | conda build /recipe_root --quiet || exit 1 48 | /feedstock_root/ci_support/upload_or_check_non_existence.py /recipe_root conda-forge --channel=main || exit 1 49 | EOF 50 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # This file was generated automatically from conda-smithy. To update this configuration, 2 | # update the conda-forge.yaml and/or the recipe/meta.yaml. 3 | 4 | language: objective-c 5 | 6 | env: 7 | global: 8 | # The BINSTAR_TOKEN secure variable. This is defined canonically in conda-forge.yml. 9 | - secure: "XsNBSTdSlhwP7iqCBRAqHWxrJfays+2I+c6dXrkhZpPB85Ql1UH7t3T3e/N7OkxQmwBMHV9qATh87JHxaOoDkNoelOe2BmK4nLEDQS+S1s0pfcNlCJ38e7TWmtRMBfTYDH9vB3T+vUPkPDSqDFHkmg4MJXv6RZN473fUfnIkFKXT26X7otj3OPa5a/dMkgA+jovx9yFL+lxdakyt5t/bAqI433H2zqYZhqODCTggALpPoHolcXe3t2wAZO4Z7QE7g7XIMDbwDfYtG+Ql2PRYP+yg8nFJsUYmhQTRY75fbusOGOurgejrF2E/zmh/LCeho6fvbEvaP7cjnhUWil9hZc0BJ2k475ZAY0IJ4PsEMU3QGm2aniwMbqleYujTX1UeyTr9MdjKX+5aSIUJrkh/5zpodM0WxHFgsSJnhPsRZtovJ3QyLG7LMbpxkd6N2Dqs93m+NnLjFjAgvFGRFbgaThy5YTtxcqeXFn0WcdVe4YDBa35UDtAKpicESSrcVSjSn7wizWzv2CmRRQNV/5HTvbSUWg0IkfsmOMjrc3gdXz4pmFK56zck110aTNkC2YGLGG/rkSe+XzZVYyiAvjJP0+k6wt9LslT/2RQeilTvaPY2Zh7DGWYtJ4SvcBpB5hEmPzOZHDMkyGbLQ62LbN+ACOzbxAR/pHTIu0X7MDFFvg8=" 10 | 11 | 12 | install: 13 | - | 14 | MINICONDA_URL="http://repo.continuum.io/miniconda" 15 | MINICONDA_FILE="Miniconda3-latest-MacOSX-x86_64.sh" 16 | wget "${MINICONDA_URL}/${MINICONDA_FILE}" 17 | bash $MINICONDA_FILE -b 18 | 19 | export PATH=/Users/travis/miniconda3/bin:$PATH 20 | 21 | conda update --yes conda 22 | conda install --yes conda-build jinja2 anaconda-client 23 | conda config --add channels conda-forge 24 | 25 | 26 | script: 27 | - conda build ./recipe 28 | 29 | after_success: 30 | 31 | - ./ci_support/upload_or_check_non_existence.py ./recipe conda-forge --channel=main 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | About flann 2 | =========== 3 | 4 | Home: http://www.cs.ubc.ca/research/flann/ 5 | 6 | Package license: BSD 3-Clause 7 | 8 | Feedstock license: BSD 9 | 10 | Summary: The Fast Library for Approximate Nearest Neighbors 11 | 12 | 13 | 14 | Installing flann 15 | ================ 16 | 17 | Installing flann from the conda-forge channel can be achieved by adding conda-forge to your channels with: 18 | 19 | ``` 20 | conda config --add channels conda-forge 21 | ``` 22 | 23 | Once the conda-forge channel has been enabled, flann can be installed with: 24 | 25 | ``` 26 | conda install flann 27 | ``` 28 | 29 | It is possible to list all of the versions of flann available on your platform with: 30 | 31 | ``` 32 | conda search flann --channel conda-forge 33 | ``` 34 | 35 | 36 | About conda-forge 37 | ================= 38 | 39 | conda-forge is a community-led conda channel of installable packages. 40 | In order to provide high-quality builds, the process has been automated into the 41 | conda-forge GitHub organization. The conda-forge organization contains one repository 42 | for each of the installable packages. Such a repository is known as a *feedstock*. 43 | 44 | A feedstock is made up of a conda recipe (the instructions on what and how to build 45 | the package) and the necessary configurations for automatic building using freely 46 | available continuous integration services. Thanks to the awesome service provided by 47 | [CircleCI](https://circleci.com/), [AppVeyor](http://www.appveyor.com/) 48 | and [TravisCI](https://travis-ci.org/) it is possible to build and upload installable 49 | packages to the [conda-forge](https://anaconda.org/conda-forge) 50 | [Anaconda-Cloud](http://docs.anaconda.org/) channel for Linux, Windows and OSX respectively. 51 | 52 | To manage the continuous integration and simplify feedstock maintenance 53 | [conda-smithy](http://github.com/conda-forge/conda-smithy) has been developed. 54 | Using the ``conda-forge.yml`` within this repository, it is possible to regenerate all of 55 | this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy regenerate``. 56 | 57 | 58 | Terminology 59 | =========== 60 | 61 | **feedstock** - the conda recipe (raw material), supporting scripts and CI configuration. 62 | 63 | **conda-smithy** - the tool which helps orchestrate the feedstock. 64 | Its primary use is in the construction of the CI ``.yml`` files 65 | and simplify the management of *many* feedstocks. 66 | 67 | **conda-forge** - the place where the feedstock and smithy live and work to 68 | produce the finished article (built conda distributions) 69 | 70 | Current build status 71 | ==================== 72 | Linux: [![Circle CI](https://circleci.com/gh/conda-forge/flann-feedstock.svg?style=svg)](https://circleci.com/gh/conda-forge/flann-feedstock) 73 | OSX: [![TravisCI](https://travis-ci.org/conda-forge/flann-feedstock.svg?branch=master)](https://travis-ci.org/conda-forge/flann-feedstock) 74 | Windows: [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/conda-forge/flann-feedstock?svg=True)](https://ci.appveyor.com/project/conda-forge/flann-feedstock/branch/master) 75 | 76 | Current release info 77 | ==================== 78 | Version: [![Anaconda-Server Badge](https://anaconda.org/conda-forge/flann/badges/version.svg)](https://anaconda.org/conda-forge/flann) 79 | Downloads: [![Anaconda-Server Badge](https://anaconda.org/conda-forge/flann/badges/downloads.svg)](https://anaconda.org/conda-forge/flann) 80 | 81 | 82 | Updating flann-feedstock 83 | ======================== 84 | 85 | If you would like to improve the flann recipe, please take the normal 86 | route of forking this repository and submitting a PR. Upon submission, your changes will 87 | be run on the appropriate platforms to give the reviewer an opportunity to confirm that the 88 | changes result in a successful build. Once merged, the recipe will be re-built and uploaded 89 | automatically to the conda-forge channel, whereupon they will be available for everybody to 90 | install and use. 91 | 92 | In order to produce a uniquely identifiable distribution: 93 | * If the version of a package **is not** being increased, please add or increase 94 | the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string). 95 | * If the version of a package **is** being increased, please remember to return 96 | the [``build/number``](http://conda.pydata.org/docs/building/meta-yaml.html#build-number-and-string) 97 | back to 0. 98 | -------------------------------------------------------------------------------- /ci_support/upload_or_check_non_existence.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from __future__ import print_function 3 | 4 | import argparse 5 | import hashlib 6 | import os 7 | import subprocess 8 | import sys 9 | 10 | from binstar_client.utils import get_binstar 11 | import binstar_client.errors 12 | import conda.config 13 | from conda_build.metadata import MetaData 14 | from conda_build.build import bldpkg_path 15 | 16 | 17 | def built_distribution_already_exists(cli, meta, owner): 18 | """ 19 | Checks to see whether the built recipe (aka distribution) already 20 | exists on the owner/user's binstar account. 21 | 22 | """ 23 | distro_name = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) 24 | fname = bldpkg_path(meta) 25 | try: 26 | dist_info = cli.distribution(owner, meta.name(), meta.version(), 27 | distro_name) 28 | except binstar_client.errors.NotFound: 29 | dist_info = {} 30 | 31 | exists = bool(dist_info) 32 | # Unfortunately, we cannot check the md5 quality of the built distribution, as 33 | # this will depend on fstat information such as modification date (because 34 | # distributions are tar files). Therefore we can only assume that the distribution 35 | # just built, and the one on anaconda.org are the same. 36 | # if exists: 37 | # md5_on_binstar = dist_info.get('md5') 38 | # with open(fname, 'rb') as fh: 39 | # md5_of_build = hashlib.md5(fh.read()).hexdigest() 40 | # 41 | # if md5_on_binstar != md5_of_build: 42 | # raise ValueError('This build ({}), and the build already on binstar ' 43 | # '({}) are different.'.format(md5_of_build, md5_on_binstar)) 44 | return exists 45 | 46 | 47 | def upload(cli, meta, owner, channels): 48 | try: 49 | with open('binstar.token', 'w') as fh: 50 | fh.write(cli.token) 51 | subprocess.check_call(['anaconda', '--quiet', '-t', 'binstar.token', 52 | 'upload', bldpkg_path(meta), 53 | '--user={}'.format(owner), 54 | '--channel={}'.format(channels)], 55 | env=os.environ) 56 | finally: 57 | os.remove('binstar.token') 58 | 59 | 60 | def distribution_exists_on_channel(binstar_cli, meta, owner, channel='main'): 61 | """ 62 | Determine whether a distribution exists on a specific channel. 63 | 64 | Note from @pelson: As far as I can see, there is no easy way to do this on binstar. 65 | 66 | """ 67 | fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) 68 | distributions_on_channel = [dist['basename'] for dist in 69 | binstar_cli.show_channel(owner=owner, channel=channel)['files']] 70 | return fname in distributions_on_channel 71 | 72 | 73 | def add_distribution_to_channel(binstar_cli, meta, owner, channel='main'): 74 | """ 75 | Add a(n already existing) distribution on binstar to another channel. 76 | 77 | Note - the addition is done based on name and version - no build strings etc. 78 | so if you have a foo-0.1-np18 and foo-0.1-np19 *both* will be added to the channel. 79 | 80 | """ 81 | package_fname = '{}/{}.tar.bz2'.format(conda.config.subdir, meta.dist()) 82 | binstar_cli.add_channel(channel, owner, meta.name(), meta.version()) 83 | 84 | 85 | def main(): 86 | token = os.environ.get('BINSTAR_TOKEN') 87 | 88 | description = ('Upload or check consistency of a built version of a ' 89 | 'conda recipe with binstar. Note: The existence of the ' 90 | 'BINSTAR_TOKEN environment variable determines ' 91 | 'whether the upload should actually take place.') 92 | parser = argparse.ArgumentParser(description=description) 93 | parser.add_argument('recipe_dir', help='the conda recipe directory') 94 | parser.add_argument('owner', help='the binstar owner/user') 95 | parser.add_argument('--channel', help='the binstar channel', default='main') 96 | args = parser.parse_args() 97 | recipe_dir, owner, channel = args.recipe_dir, args.owner, args.channel 98 | 99 | cli = get_binstar(argparse.Namespace(token=token, site=None)) 100 | meta = MetaData(recipe_dir) 101 | if meta.skip(): 102 | print("No upload to take place - this configuration was skipped in build/skip.") 103 | return 104 | exists = built_distribution_already_exists(cli, meta, owner) 105 | if token: 106 | on_channel = distribution_exists_on_channel(cli, meta, owner, channel) 107 | if not exists: 108 | upload(cli, meta, owner, channel) 109 | print('Uploaded {}'.format(bldpkg_path(meta))) 110 | elif not on_channel: 111 | print('Adding distribution {} to {}\'s {} channel' 112 | ''.format(bldpkg_path(meta), owner, channel)) 113 | add_distribution_to_channel(cli, meta, owner, channel) 114 | else: 115 | print('Distribution {} already \nexists on {}\'s {} channel.' 116 | ''.format(bldpkg_path(meta), owner, channel)) 117 | else: 118 | print("No BINSTAR_TOKEN present, so no upload is taking place. " 119 | "The distribution just built {} already available on {}'s " 120 | "{} channel.".format('is' if exists else 'is not', 121 | owner, channel)) 122 | 123 | if __name__ == '__main__': 124 | main() 125 | --------------------------------------------------------------------------------