Skip to content

Commit

Permalink
r-nam (#12327)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris-Lowe-Integrity authored Nov 25, 2018
1 parent 8d6f86b commit 0b3cadd
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
34 changes: 34 additions & 0 deletions recipes/r-nam/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash
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/NAM
mv * $PREFIX/lib/R/library/NAM
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
for SHARED_LIB in $(find . -type f -iname "*.dylib" -or -iname "*.so" -or -iname "R"); 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
popd
done
popd
fi
fi
69 changes: 69 additions & 0 deletions recipes/r-nam/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{% set version = '1.6.4' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
name: r-nam
version: {{ version|replace("-", "_") }}

source:
url:
- {{ cran_mirror }}/src/contrib/NAM_{{ version }}.tar.gz
- {{ cran_mirror }}/src/contrib/Archive/NAM/NAM_{{ version }}.tar.gz
sha256: a45ecf3286f7c17028d38a8389b7173b1ec38047768cec64a5e961649964ad2c

build:
merge_build_host: True # [win]
number: 0

rpaths:
- lib/R/lib/
- lib/

requirements:
build:
- {{ compiler('c') }} # [not win]
- {{ compiler('cxx') }} # [not win]
- {{native}}toolchain # [win]
- {{posix}}filesystem # [win]
- {{posix}}make
- {{posix}}sed # [win]
- {{posix}}coreutils # [win]
- {{posix}}zip # [win]

host:
- r-base
- r-rcpp
- r-randomforest

run:
- r-base
- {{native}}gcc-libs # [win]
- r-rcpp
- r-randomforest

test:
commands:
- $R -e "library('NAM')" # [not win]
- "\"%R%\" -e \"library('NAM')\"" # [win]

about:
home: https://CRAN.R-project.org/package=NAM
license: GPL-3
summary: Designed for association studies in nested association mapping (NAM) panels, experimental
and random panels. The method is described by Xavier et al. (2015) <doi:10.1093/bioinformatics/btv448>.
It includes tools for genome-wide associations of multiple populations, marker quality
control, population genetics analysis, genome-wide prediction, solving mixed models
and finding variance components through likelihood and Bayesian methods.
license_family: GPL3
license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
recipe-maintainers:
- johanneskoester
- bgruening
- daler
- jdblischak
- cbrueffer
- dbast
- Chris-Lowe-Integrity

0 comments on commit 0b3cadd

Please sign in to comment.