diff --git a/recipes/r-nabor/bld.bat b/recipes/r-nabor/bld.bat new file mode 100644 index 0000000000000..b7e1203063141 --- /dev/null +++ b/recipes/r-nabor/bld.bat @@ -0,0 +1,2 @@ +"%R%" CMD INSTALL --build . +IF %ERRORLEVEL% NEQ 0 exit 1 diff --git a/recipes/r-nabor/build.sh b/recipes/r-nabor/build.sh new file mode 100644 index 0000000000000..b28a0e77470f0 --- /dev/null +++ b/recipes/r-nabor/build.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -o errexit -o pipefail +if [[ ${target_platform} =~ linux.* ]] || [[ ${target_platform} == win-32 ]] || [[ ${target_platform} == win-64 ]] || [[ ${target_platform} == osx-64 ]]; then + export DISABLE_AUTOBREW=1 + ${R} CMD INSTALL --build . +else + mkdir -p "${PREFIX}"/lib/R/library/nabor + mv ./* "${PREFIX}"/lib/R/library/nabor + if [[ ${target_platform} == osx-64 ]]; then + pushd "${PREFIX}" + for libdir in lib/R/lib lib/R/modules lib/R/library lib/R/bin/exec sysroot/usr/lib; do + pushd "${libdir}" || exit 1 + while IFS= read -r -d '' SHARED_LIB + do + echo "fixing SHARED_LIB ${SHARED_LIB}" + install_name_tool -change /Library/Frameworks/R.framework/Versions/3.5.0-MRO/Resources/lib/libR.dylib "${PREFIX}"/lib/R/lib/libR.dylib "${SHARED_LIB}" || true + install_name_tool -change /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libR.dylib "${PREFIX}"/lib/R/lib/libR.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/local/clang4/lib/libomp.dylib "${PREFIX}"/lib/libomp.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/local/gfortran/lib/libgfortran.3.dylib "${PREFIX}"/lib/libgfortran.3.dylib "${SHARED_LIB}" || true + install_name_tool -change /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libquadmath.0.dylib "${PREFIX}"/lib/libquadmath.0.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/local/gfortran/lib/libquadmath.0.dylib "${PREFIX}"/lib/libquadmath.0.dylib "${SHARED_LIB}" || true + install_name_tool -change /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libgfortran.3.dylib "${PREFIX}"/lib/libgfortran.3.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libgcc_s.1.dylib "${PREFIX}"/lib/libgcc_s.1.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libiconv.2.dylib "${PREFIX}"/sysroot/usr/lib/libiconv.2.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libncurses.5.4.dylib "${PREFIX}"/sysroot/usr/lib/libncurses.5.4.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libicucore.A.dylib "${PREFIX}"/sysroot/usr/lib/libicucore.A.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libexpat.1.dylib "${PREFIX}"/lib/libexpat.1.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libcurl.4.dylib "${PREFIX}"/lib/libcurl.4.dylib "${SHARED_LIB}" || true + install_name_tool -change /usr/lib/libc++.1.dylib "${PREFIX}"/lib/libc++.1.dylib "${SHARED_LIB}" || true + install_name_tool -change /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libc++.1.dylib "${PREFIX}"/lib/libc++.1.dylib "${SHARED_LIB}" || true + done < <(find . \( -type f -iname "*.dylib" -or -iname "*.so" -or -iname "R" \) -print0) + popd + done + popd + fi +fi diff --git a/recipes/r-nabor/meta.yaml b/recipes/r-nabor/meta.yaml new file mode 100644 index 0000000000000..cef4d94b41f40 --- /dev/null +++ b/recipes/r-nabor/meta.yaml @@ -0,0 +1,86 @@ +{% set version = '0.5.0' %} +{% set posix = 'm2-' if win else '' %} +{% set native = 'm2w64-' if win else '' %} + +package: + name: r-nabor + version: {{ version|replace("-", "_") }} + +source: + url: + - {{ cran_mirror }}/src/contrib/nabor_{{ version }}.tar.gz + - {{ cran_mirror }}/src/contrib/Archive/nabor/nabor_{{ version }}.tar.gz + sha256: 47938dcc987279281c13abfd667660bf1b3b76af116136a27eb066ee1a4b43da + +build: + merge_build_host: True # [win] + number: 0 + rpaths: + - lib/R/lib/ + - lib/ + +requirements: + build: + - {{ compiler('c') }} # [not win] + - {{ compiler('m2w64_c') }} # [win] + - {{ compiler('cxx') }} # [not win] + - {{ compiler('m2w64_cxx') }} # [win] + - {{ posix }}filesystem # [win] + - {{ posix }}make + - {{ posix }}sed # [win] + - {{ posix }}coreutils # [win] + - {{ posix }}zip # [win] + host: + - r-base + - r-bh >=1.54.0_4 + - r-rcpp >=0.11.2 + - r-rcppeigen >=0.3.2.2.0 + run: + - r-base + - {{ native }}gcc-libs # [win] + - r-rcpp >=0.11.2 + - r-rcppeigen >=0.3.2.2.0 + +test: + commands: + - $R -e "library('nabor')" # [not win] + - "\"%R%\" -e \"library('nabor')\"" # [win] + +about: + home: https://github.com/jefferis/nabor https://github.com/ethz-asl/libnabo + license: BSD-3-Clause + summary: An R wrapper for 'libnabo', an exact or approximate k nearest neighbour library which + is optimised for low dimensional spaces (e.g. 3D). 'libnabo' has speed and space + advantages over the 'ANN' library wrapped by package 'RANN'. 'nabor' includes a + knn function that is designed as a drop-in replacement for 'RANN' function nn2. + In addition, objects which include the k-d tree search structure can be returned + to speed up repeated queries of the same set of target points. + license_family: BSD + license_file: + - '{{ environ["PREFIX"] }}/lib/R/share/licenses/BSD_3_clause' + - LICENSE + +extra: + recipe-maintainers: + - conda-forge/r + +# Package: nabor +# Type: Package +# Title: Wraps 'libnabo', a Fast K Nearest Neighbour Library for Low Dimensions +# Version: 0.5.0 +# Author: Stephane Mangenat (for 'libnabo'), Gregory Jefferis +# Maintainer: Gregory Jefferis +# Description: An R wrapper for 'libnabo', an exact or approximate k nearest neighbour library which is optimised for low dimensional spaces (e.g. 3D). 'libnabo' has speed and space advantages over the 'ANN' library wrapped by package 'RANN'. 'nabor' includes a knn function that is designed as a drop-in replacement for 'RANN' function nn2. In addition, objects which include the k-d tree search structure can be returned to speed up repeated queries of the same set of target points. +# License: BSD_3_clause + file LICENSE +# Copyright: libnabo is copyright 2010--2011, Stephane Magnenat, ASL, ETHZ, Switzerland +# URL: https://github.com/jefferis/nabor https://github.com/ethz-asl/libnabo +# BugReports: https://github.com/jefferis/nabor/issues +# Depends: R (>= 3.0.2) +# Imports: Rcpp (>= 0.11.2), methods +# LinkingTo: Rcpp, RcppEigen (>= 0.3.2.2.0), BH (>= 1.54.0-4) +# Suggests: testthat, RANN +# RoxygenNote: 6.0.1 +# NeedsCompilation: yes +# Packaged: 2018-07-11 15:23:05 UTC; jefferis +# Repository: CRAN +# Date/Publication: 2018-07-11 16:00:02 UTC