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 libnvjpeg recipe #22128

Merged
merged 14 commits into from
Apr 15, 2023
5 changes: 5 additions & 0 deletions recipes/libnvjpeg/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/libnvjpeg/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/nvjpeg*.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/libnvjpeg/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
145 changes: 145 additions & 0 deletions recipes/libnvjpeg/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{% set name = "libnvjpeg" %}
{% set version = "12.0.0.28" %}
adibbley marked this conversation as resolved.
Show resolved Hide resolved
{% 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: ad3380591a4d5b97ab57d10e9bf05e23dee6429ff91ea939423a3b35ee0e35de # [linux64]
sha256: f7136bb691d794c680d77376b306bedb80eeebf687bfa4dc74355fdae5adcebb # [ppc64le]
sha256: 31fd6ee0dccc72f0d583e25b849543551eb4bc49d3285628bf3b17929e09bac1 # [aarch64]
sha256: b7cb56ab2c69e055a4b1ea41653df917153a568ab23fb0d8121e0739011989a8 # [win]

build:
number: 0
skip: true # [osx]
adibbley marked this conversation as resolved.
Show resolved Hide resolved

outputs:
- name: libnvjpeg
files:
- lib/libnvjpeg.so.* # [linux]
- targets/{{ target_name }}/lib/libnvjpeg.so.* # [linux]
- Library\bin\nvjpeg*.dll # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
adibbley marked this conversation as resolved.
Show resolved Hide resolved
- arm-variant * {{ arm_variant_type }} # [aarch64]
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 -L $PREFIX/lib/libnvjpeg.so.{{ version }} # [linux]
- test -L $PREFIX/lib/libnvjpeg.so.{{ version.split(".")[0] }} # [linux]
- test -L $PREFIX/targets/{{ target_name }}/lib/libnvjpeg.so.{{ version }} # [linux]
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvjpeg.so.{{ version.split(".")[0] }} # [linux]
- if not exist %LIBRARY_BIN%\nvjpeg64_{{ version.split(".")[0] }}.dll exit 1 # [win]
about:
home: https://developer.nvidia.com/cuda-toolkit
adibbley marked this conversation as resolved.
Show resolved Hide resolved
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NVJPEG native runtime libraries
jakirkham marked this conversation as resolved.
Show resolved Hide resolved
description: |
NVJPEG native runtime libraries
doc_url: https://docs.nvidia.com/cuda/index.html

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

- name: libnvjpeg-static
build:
skip: True # [not linux]
files:
- targets/{{ target_name }}/lib/libnvjpeg_static.a # [linux]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_version }}
run:
- {{ pin_compatible("cuda-version", max_pin="x.x") }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
adibbley marked this conversation as resolved.
Show resolved Hide resolved
commands:
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvjpeg_static.a # [linux]
about:
home: https://developer.nvidia.com/cuda-toolkit
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NVJPEG native runtime libraries
description: |
NVJPEG native runtime libraries
doc_url: https://docs.nvidia.com/cuda/index.html

about:
home: https://developer.nvidia.com/cuda-toolkit
adibbley marked this conversation as resolved.
Show resolved Hide resolved
license_file: LICENSE
license: LicenseRef-NVIDIA-End-User-License-Agreement
license_url: https://docs.nvidia.com/cuda/eula/index.html
summary: NVJPEG native runtime libraries
description: |
NVJPEG native runtime libraries
doc_url: https://docs.nvidia.com/cuda/index.html

extra:
recipe-maintainers:
- adibbley