Skip to content

Commit

Permalink
Merge pull request #22832 from adibbley/libnpp
Browse files Browse the repository at this point in the history
Add libnpp recipe
  • Loading branch information
jakirkham authored Jun 1, 2023
2 parents 357e8e7 + 6854bc0 commit 1343da6
Show file tree
Hide file tree
Showing 4 changed files with 200 additions and 0 deletions.
5 changes: 5 additions & 0 deletions recipes/libnpp/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
if not exist %PREFIX% mkdir %PREFIX%

move lib\x64\* %LIBRARY_LIB%
move bin\* %LIBRARY_BIN%
move include\* %LIBRARY_INC%
33 changes: 33 additions & 0 deletions recipes/libnpp/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Install to conda style directories
[[ -d lib64 ]] && mv lib64 lib
mkdir -p ${PREFIX}/lib
[[ -d pkg-config ]] && mv pkg-config ${PREFIX}/lib/pkgconfig
[[ -d "$PREFIX/lib/pkgconfig" ]] && sed -E -i "s|cudaroot=.+|cudaroot=$PREFIX|g" $PREFIX/lib/pkgconfig/npp*.pc

[[ ${target_platform} == "linux-64" ]] && targetsDir="targets/x86_64-linux"
[[ ${target_platform} == "linux-ppc64le" ]] && targetsDir="targets/ppc64le-linux"
[[ ${target_platform} == "linux-aarch64" ]] && targetsDir="targets/sbsa-linux"

for i in `ls`; do
[[ $i == "build_env_setup.sh" ]] && continue
[[ $i == "conda_build.sh" ]] && continue
[[ $i == "metadata_conda_debug.yaml" ]] && continue
if [[ $i == "lib" ]] || [[ $i == "include" ]]; then
# Headers and libraries are installed to targetsDir
mkdir -p ${PREFIX}/${targetsDir}
mkdir -p ${PREFIX}/$i
cp -rv $i ${PREFIX}/${targetsDir}
if [[ $i == "lib" ]]; then
for j in "$i"/*.so*; do
# Shared libraries are symlinked in $PREFIX/lib
ln -s ${PREFIX}/${targetsDir}/$j ${PREFIX}/$j
done
fi
else
# Put all other files in targetsDir
mkdir -p ${PREFIX}/${targetsDir}/${PKG_NAME}
cp -rv $i ${PREFIX}/${targetsDir}/${PKG_NAME}
fi
done
2 changes: 2 additions & 0 deletions recipes/libnpp/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
160 changes: 160 additions & 0 deletions recipes/libnpp/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{% set name = "libnpp" %}
{% set version = "12.0.0.30" %}
{% set cuda_version = "12.0" %}
{% set platform = "linux-x86_64" %} # [linux64]
{% set platform = "linux-ppc64le" %} # [ppc64le]
{% set platform = "linux-sbsa" %} # [aarch64]
{% set platform = "windows-x86_64" %} # [win]
{% set target_name = "x86_64-linux" %} # [linux64]
{% set target_name = "ppc64le-linux" %} # [ppc64le]
{% set target_name = "sbsa-linux" %} # [aarch64]
{% set target_name = "x64" %} # [win]
{% set extension = "tar.xz" %} # [not win]
{% set extension = "zip" %} # [win]

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://developer.download.nvidia.com/compute/cuda/redist/{{ name }}/{{ platform }}/{{ name }}-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: 003365261d69caa6219ba698b649a961ad41ae386772fe673f3b8166c1b42775 # [linux64]
sha256: 4e2b56928cfef99725931f98b5840ca35a56505d927871ce53accba6f38005e5 # [ppc64le]
sha256: 6239013db1d4badf1cc1af8acebe3fc1bc0ef167092b314721078742a2916976 # [aarch64]
sha256: a7abd59e05b326d6adfca16840071d2ed02d0cc6df092d921ed96d489a2e864e # [win]

build:
number: 0
skip: true # [osx]

test:
commands:
- test -L $PREFIX/lib/libnppc.so.{{ version }} # [linux]
- test -L $PREFIX/lib/libnppc.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libnppc.so.{{ version.split(".")[0] }} # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnppc.so.{{ version }} # [linux]
- if not exist %LIBRARY_BIN%\nppc64_{{ version.split(".")[0] }}.dll exit 1 # [win]

outputs:
- name: libnpp
files:
- lib/libnpp*.so.* # [linux]
- targets/{{ target_name }}/lib/libnpp*.so.* # [linux]
- Library\bin\npp*.dll # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
# Tests are defined at the top level, due to package/output name conflicts.
about:
home: https://developer.nvidia.com/npp
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_file: LICENSE
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NPP native runtime libraries
description: |
NPP native runtime libraries
doc_url: https://docs.nvidia.com/cuda/npp/index.html

- name: libnpp-dev
build:
run_exports:
- {{ pin_subpackage("libnpp", max_pin="x") }}
files:
- lib/libnpp*.so # [linux]
- lib/pkgconfig # [linux]
- targets/{{ target_name }}/include # [linux]
- targets/{{ target_name }}/lib/libnpp*.so # [linux]
- targets/{{ target_name }}/lib/stubs # [linux]
- Library\include # [win]
- Library\lib # [win]
requirements:
run:
- libnpp >={{ version }}
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
- {{ pin_subpackage("libnpp", exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
- libnpp-static >={{ version }} # [linux]
test:
commands:
- test -L $PREFIX/lib/libnppc.so # [linux]
- test -f $PREFIX/lib/pkgconfig/nppc*.pc # [linux]
- test -f $PREFIX/targets/{{ target_name }}/include/npp.h # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnppc.so # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/stubs/libnppc.so # [linux]
- if not exist %LIBRARY_INC%\npp.h exit 1 # [win]
- if not exist %LIBRARY_LIB%\nppc.lib exit 1 # [win]
about:
home: https://developer.nvidia.com/npp
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_file: LICENSE
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NPP native runtime libraries
description: |
NPP native runtime libraries
doc_url: https://docs.nvidia.com/cuda/npp/index.html

- name: libnpp-static
build:
skip: True # [not linux]
requirements:
run:
- libnpp-dev >={{ version }}
files:
- targets/{{ target_name }}/lib/libnpp*_static.a
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
- sysroot_{{ target_platform }} 2.17 # [linux]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -f $PREFIX/targets/{{ target_name }}/lib/libnppc_static.a
about:
home: https://developer.nvidia.com/npp
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_file: LICENSE
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NPP native runtime libraries
description: |
NPP native runtime libraries
doc_url: https://docs.nvidia.com/cuda/npp/index.html

about:
home: https://developer.nvidia.com/npp
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_file: LICENSE
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NPP native runtime libraries
description: |
NPP native runtime libraries
doc_url: https://docs.nvidia.com/cuda/npp/index.html

extra:
recipe-maintainers:
- adibbley

0 comments on commit 1343da6

Please sign in to comment.