Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libnpp recipe #22832

Merged
merged 4 commits into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]
153 changes: 153 additions & 0 deletions recipes/libnpp/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{% 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]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
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:
- arm-variant * {{ arm_variant_type }} # [aarch64]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
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:
- arm-variant * {{ arm_variant_type }} # [aarch64]
adibbley marked this conversation as resolved.
Show resolved Hide resolved
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