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

NEW: Add libnvjpeg2k and libnvtiff #28142

Merged
merged 14 commits into from
Nov 22, 2024
Merged
17 changes: 17 additions & 0 deletions recipes/nvjpeg2k/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

:: Relocate CUDA major specific libraries to single prefix layout

for /f "tokens=1 delims=." %%a in ("%cuda_compiler_version%") do (
set "CUDA_MAJOR=%%a"
break
)

move lib lib.backup
move lib.backup\%CUDA_MAJOR% lib
del lib.backup

if not exist %PREFIX% mkdir %PREFIX%

move lib\*.lib %LIBRARY_LIB%
move lib\*.dll %LIBRARY_BIN%
move include\* %LIBRARY_INC%
20 changes: 20 additions & 0 deletions recipes/nvjpeg2k/build.sh
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is using the targetsDir layout necessary for these packages? This is generally only used by packages included in cuda. The rpms/debs for these libraries install to system standard locations, such as:

$ rpm -qpl libnvjpeg2k0-cuda-12-0.8.0.38-1.x86_64.rpm
warning: libnvjpeg2k0-cuda-12-0.8.0.38-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d42d0685: NOKEY
/usr/lib64/libnvjpeg2k
/usr/lib64/libnvjpeg2k/12
/usr/lib64/libnvjpeg2k/12/libnvjpeg2k.so.0
/usr/lib64/libnvjpeg2k/12/libnvjpeg2k.so.0.8.0.38
/usr/share/licenses/libnvjpeg2k0-cuda-12
/usr/share/licenses/libnvjpeg2k0-cuda-12/LICENSE

Note: libnvjpeg2k/12 subdir is used as those formats support side by side installs of the cuda variants, which is not needed here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume by "cuda" you mean the "cuda toolkit"?

Is using the targetsDir layout necessary for these packages?

You tell me! I believe the goal is to be consistent with layout on other platforms, so this is the feedback I'm looking for.

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

# Relocate CUDA major specific libraries to single prefix layout
export CUDA_MAJOR=${cuda_compiler_version%%.*}
mv -v lib lib.backup
mv -v lib.backup/${CUDA_MAJOR} lib
rm -rv lib.backup

# 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

for i in `ls`; do
[[ $i == "build_env_setup.sh" ]] && continue
[[ $i == "conda_build.sh" ]] && continue
[[ $i == "metadata_conda_debug.yaml" ]] && continue
cp -rv $i ${PREFIX}
done
10 changes: 10 additions & 0 deletions recipes/nvjpeg2k/conda-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build_platform:
linux_aarch64: linux_aarch64
linux_ppc64le: linux_ppc64le
provider:
linux_aarch64: default
linux_ppc64le: default
os_version:
linux_64: cos7
linux_aarch64: cos7
linux_ppc64le: cos7
4 changes: 4 additions & 0 deletions recipes/nvjpeg2k/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
- tegra # [false]

122 changes: 122 additions & 0 deletions recipes/nvjpeg2k/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{% set name = "libnvjpeg2k" %}
{% set version = "0.8.0.38" %}
{% set platform = "linux-x86_64" %} # [linux64]
{% set platform = "linux-ppc64le" %} # [ppc64le]
{% set platform = "linux-sbsa" %} # [aarch64 and arm_variant_type == "sbsa"]
{% set platform = "linux-aarch64" %} # [aarch64 and arm_variant_type == "tegra"]
{% 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 and arm_variant_type == "sbsa"]
{% set target_name = "aarch64-linux" %} # [aarch64 and arm_variant_type == "tegra"]
{% set target_name = "x64" %} # [win]
{% set extension = "tar.xz" %} # [not win]
{% set extension = "zip" %} # [win]
{% set cuda_compiler_version = cuda_compiler_version | default("None") %}

package:
name: libnvjpeg2k-split
version: {{ version }}

source:
url: https://developer.download.nvidia.com/compute/nvjpeg2000/redist/libnvjpeg_2k/{{ platform }}/libnvjpeg_2k-{{ platform }}-{{ version }}-archive.{{ extension }}
sha256: f0b4f0ab9e19579c547e96ce189c6a93731f662898751a88d62e3caa59472367 # [linux64]
sha256: 03a568305989b25be6def7d860b2519577ebef1538c703de0ad086fa2314a1e0 # [aarch64 and arm_variant_type == "sbsa"]
sha256: dac4f1d0c088c22155067b781142dc27ec1d3ced68b99d2180fcd1fcf02fe19e # [aarch64 and arm_variant_type == "tegra"]
sha256: feabb2f4108805b251f44b0561b194a24041d01207b272a3aa42a664e938e5d4 # [win]

build:
number: 0
skip: true # [osx or ppc64le]
skip: true # [cuda_compiler_version in (None, "None")]

outputs:

- name: libnvjpeg2k{{ version.split(".")[0] }}
build:
run_exports:
# FIXME: Pin to patch version until 1.0
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0], max_pin="x.x.x") }}
ignore_run_exports:
- cudatoolkit
files:
- lib/libnvjpeg2k.so.* # [linux]
- Library\bin\nvjpeg2k*.dll # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cuda") }}
- {{ stdlib("c") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libnvjpeg2k.so.{{ version.split(".")[0] }} # [linux]
- test -f $PREFIX/lib/libnvjpeg2k.so.{{ version }} # [linux]
- if not exist %LIBRARY_BIN%\nvjpeg2k_{{ version.split(".")[0] }}.dll exit 1 # [win]

- name: libnvjpeg2k-dev
build:
run_exports:
# FIXME: Pin to patch version until 1.0
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0], max_pin="x.x.x") }}
files:
- lib/libnvjpeg2k.so # [linux]
# - lib/pkgconfig/nvjpeg*.pc # [linux]
- include/nvjpeg* # [linux]
- Library\include # [win]
- Library\lib\nvjpeg.lib # [win]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0], exact=True) }}
run:
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0], exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libnvjpeg2k.so # [linux]
# - test -f $PREFIX/lib/pkgconfig/nvjpeg*.pc # [linux]
- test -f $PREFIX/include/nvjpeg2k_version.h # [linux]
- test -f $PREFIX/include/nvjpeg2k.h # [linux]
- if not exist %LIBRARY_INC%\nvjpeg2k_version.h exit 1 # [win]
- if not exist %LIBRARY_INC%\nvjpeg2k.h exit 1 # [win]
- if not exist %LIBRARY_LIB%\nvjpeg2k.lib exit 1 # [win]

- name: libnvjpeg2k-static
build:
skip: True # [not linux]
files:
- lib/libnvjpeg2k_static.a # [linux]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
run:
- {{ pin_subpackage("libnvjpeg2k-dev", exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -f $PREFIX/lib/libnvjpeg2k_static.a # [linux]

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

extra:
recipe-maintainers:
- conda-forge/cuda
6 changes: 6 additions & 0 deletions recipes/nvtiff/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

if not exist %PREFIX% mkdir %PREFIX%

move lib\*.lib %LIBRARY_LIB%
move lib\*.dll %LIBRARY_BIN%
move include\* %LIBRARY_INC%
14 changes: 14 additions & 0 deletions recipes/nvtiff/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/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/nvtiff*.pc

for i in `ls`; do
[[ $i == "build_env_setup.sh" ]] && continue
[[ $i == "conda_build.sh" ]] && continue
[[ $i == "metadata_conda_debug.yaml" ]] && continue
cp -rv $i ${PREFIX}
done
10 changes: 10 additions & 0 deletions recipes/nvtiff/conda-forge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build_platform:
linux_aarch64: linux_aarch64
linux_ppc64le: linux_ppc64le
provider:
linux_aarch64: default
linux_ppc64le: default
os_version:
linux_64: cos7
linux_aarch64: cos7
linux_ppc64le: cos7
9 changes: 9 additions & 0 deletions recipes/nvtiff/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
arm_variant_type: # [aarch64]
- sbsa # [aarch64]
- tegra # [false]
c_stdlib_version: # [linux]
- '2.28' # [linux]
docker_image: # [linux]
- quay.io/condaforge/linux-anvil-alma-aarch64:8 # [aarch64]
- quay.io/condaforge/linux-anvil-alma-x86_64:8 # [linux64]
- quay.io/condaforge/linux-anvil-alma-ppc64le:8 # [ppc64le]
130 changes: 130 additions & 0 deletions recipes/nvtiff/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{% set name = "libnvtiff" %}
{% set version = "0.4.0.62" %}
{% set platform = "linux-x86_64" %} # [linux64]
{% set platform = "linux-ppc64le" %} # [ppc64le]
{% set platform = "linux-sbsa" %} # [aarch64 and arm_variant_type == "sbsa"]
{% set platform = "linux-aarch64" %} # [aarch64 and arm_variant_type == "tegra"]
{% 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 and arm_variant_type == "sbsa"]
{% set target_name = "aarch64-linux" %} # [aarch64 and arm_variant_type == "tegra"]
{% set target_name = "x64" %} # [win]
{% set extension = "tar.xz" %} # [not win]
{% set extension = "zip" %} # [win]
{% set cuda_compiler_version = cuda_compiler_version | default("None") %}
{% set cuda_major = cuda_compiler_version.split(".")[0] %}


package:
name: libnvtiff-split
version: {{ version }}

source:
url: https://developer.download.nvidia.com/compute/nvtiff/redist/libnvtiff/{{ platform }}/libnvtiff-{{ platform }}-{{ version }}_cuda{{ cuda_major }}-archive.{{ extension }}
{% if cuda_major == "11" %}
sha256: 8a206bb5b6b6e277e7366b8f10eec44320c5c7422117d83e4bf80bbf800bed1e # [linux64]
sha256: c8904df056d8e365566cf1ee67e6dc554be2d030458e8d3c8c94240cdd9351c9 # [aarch64 and arm_variant_type == "sbsa"]
sha256: aeb6f73952294a1def649bd9e7a3203430b20f923d3e8623cda2ce13b8a42743 # [win]
sha256: 178945699ccda8ce1ac6e161782ab994bdf7f5cfaa27d705fcd3931805bca21a # [aarch64 and arm_variant_type == "tegra"]
{% endif %}
{% if cuda_major == "12" %}
sha256: 5f76b01eddfec0c2823eaa3aae1cf4709e695e8dbdfd22b2c54493ede2dabd4c # [linux64]
sha256: e66c275c2bcf69b82a0da69d29d70e754a22c8f32bb6cf75b34e4a2efd7640cb # [aarch64 and arm_variant_type == "sbsa"]
sha256: 352703d4d227253af4512c21b840e813b548831f485a5b9cb4e2195844d006e3 # [win]
sha256: 2a7cc95a2a3ae56093a0becc7f87b9726253728443840fccacb35f9fd974d4cc # [aarch64 and arm_variant_type == "tegra"]
{% endif %}

build:
number: 0
skip: true # [osx or ppc64le]
skip: true # [cuda_compiler_version in (None, "None", "11.8")]

outputs:

- name: libnvtiff{{ version.split(".")[0] }}
build:
run_exports:
# FIXME: Pin to patch version until 1.0
- {{ pin_subpackage("libnvtiff" ~ version.split(".")[0], max_pin="x.x.x") }}
files:
- lib/libnvtiff.so.* # [linux]
- Library\bin\nvtiff*.dll # [win]
requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cuda") }}
- {{ stdlib("c") }}
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libnvtiff.so.{{ version.split(".")[0] }} # [linux]
- test -f $PREFIX/lib/libnvtiff.so.{{ version }} # [linux]
- if not exist %LIBRARY_BIN%\nvtiff_{{ version.split(".")[0] }}.dll exit 1 # [win]

- name: libnvtiff-dev
build:
run_exports:
# FIXME: Pin to patch version until 1.0
- {{ pin_subpackage("libnvtiff" ~ version.split(".")[0], max_pin="x.x.x") }}
files:
- lib/libnvtiff.so # [linux]
# - lib/pkgconfig/nvtiff*.pc # [linux]
- include/nvtiff* # [linux]
- Library\include # [win]
- Library\lib\nvtiff.lib # [win]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
- {{ pin_subpackage("libnvtiff" ~ version.split(".")[0], exact=True) }}
run:
- {{ pin_subpackage("libnvtiff" ~ version.split(".")[0], exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -L $PREFIX/lib/libnvtiff.so # [linux]
# - test -f $PREFIX/lib/pkgconfig/nvtiff*.pc # [linux]
- test -f $PREFIX/include/nvtiff_version.h # [linux]
- test -f $PREFIX/include/nvtiff.h # [linux]
- if not exist %LIBRARY_INC%\nvtiff_version.h exit 1 # [win]
- if not exist %LIBRARY_INC%\nvtiff.h exit 1 # [win]
- if not exist %LIBRARY_LIB%\nvtiff.lib exit 1 # [win]

- name: libnvtiff-static
build:
skip: True # [not linux]
files:
- lib/libnvtiff_static.a # [linux]
requirements:
build:
- arm-variant * {{ arm_variant_type }} # [aarch64]
host:
- cuda-version {{ cuda_compiler_version }}
run:
- {{ pin_subpackage("libnvtiff-dev", exact=True) }}
run_constrained:
- arm-variant * {{ arm_variant_type }} # [aarch64]
test:
commands:
- test -f $PREFIX/lib/libnvtiff_static.a # [linux]

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

extra:
recipe-maintainers:
- conda-forge/cuda