-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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 #28142
Draft
carterbox
wants to merge
4
commits into
conda-forge:main
Choose a base branch
from
carterbox:nvjpeg2k
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+228
−0
Draft
NEW: Add libnvjpeg2k #28142
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_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% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
|
||
# Relocate CUDA major specific libraries to single prefix layout | ||
export CUDA_MAJOR=${cuda_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 | ||
|
||
[[ ${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" | ||
# [[ ${target_platform} == "linux-aarch64" ]] && targetsDir="targets/aarch64-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 | ||
|
||
if [[ $j =~ \.so\. ]]; then | ||
patchelf --set-rpath '$ORIGIN' --force-rpath ${PREFIX}/${targetsDir}/$j | ||
fi | ||
done | ||
fi | ||
else | ||
# Put all other files in targetsDir | ||
mkdir -p ${PREFIX}/${targetsDir}/${PKG_NAME} | ||
cp -rv $i ${PREFIX}/${targetsDir}/${PKG_NAME} | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
arm_variant_type: # [aarch64] | ||
- sbsa # [aarch64] | ||
- tegra # [false] | ||
cuda_version: | ||
- 11.8 | ||
- 12.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
{% 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] | ||
|
||
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] | ||
|
||
requirements: | ||
build: | ||
- patchelf <0.18.0 # [linux] | ||
|
||
outputs: | ||
|
||
- name: libnvjpeg2k{{ version.split(".")[0] }} | ||
build: | ||
binary_relocation: false | ||
run_exports: | ||
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0]) }} | ||
files: | ||
- lib/libnvjpeg2k.so.* # [linux] | ||
- targets/{{ target_name }}/lib/libnvjpeg2k.so.* # [linux] | ||
- Library\bin\nvjpeg2k*.dll # [win] | ||
requirements: | ||
build: | ||
- {{ compiler("c") }} | ||
- {{ compiler("cxx") }} | ||
- {{ stdlib("c") }} | ||
- arm-variant * {{ arm_variant_type }} # [aarch64] | ||
host: | ||
- cuda-version {{ cuda_version }} | ||
run: | ||
- {{ pin_compatible("cuda-version") }} | ||
run_constrained: | ||
- arm-variant * {{ arm_variant_type }} # [aarch64] | ||
test: | ||
requires: | ||
- patchelf # [linux] | ||
files: | ||
- test-rpath.sh | ||
commands: | ||
- test -L $PREFIX/lib/libnvjpeg2k.so.{{ version.split(".")[0] }} # [linux] | ||
- test -L $PREFIX/lib/libnvjpeg2k.so.{{ version }} # [linux] | ||
- test -L $PREFIX/targets/{{ target_name }}/lib/libnvjpeg2k.so.{{ version.split(".")[0] }} # [linux] | ||
- test -f $PREFIX/targets/{{ target_name }}/lib/libnvjpeg2k.so.{{ version }} # [linux] | ||
- bash test-rpath.sh # [linux] | ||
- if not exist %LIBRARY_BIN%\nvjpeg2k_{{ version.split(".")[0] }}.dll exit 1 # [win] | ||
|
||
- name: libnvjpeg2k-dev | ||
build: | ||
run_exports: | ||
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0]) }} | ||
files: | ||
- lib/libnvjpeg2k.so # [linux] | ||
# - lib/pkgconfig/nvjpeg*.pc # [linux] | ||
- targets/{{ target_name }}/lib/libnvjpeg2k.so # [linux] | ||
# - targets/{{ target_name }}/lib/stubs/libnvjpeg2k.so # [linux] | ||
- targets/{{ target_name }}/include/nvjpeg* # [linux] | ||
- Library\include # [win] | ||
- Library\lib\nvjpeg.lib # [win] | ||
requirements: | ||
build: | ||
- arm-variant * {{ arm_variant_type }} # [aarch64] | ||
host: | ||
- cuda-version {{ cuda_version }} | ||
- {{ pin_subpackage("libnvjpeg2k" ~ version.split(".")[0], exact=True) }} | ||
run: | ||
- {{ pin_compatible("cuda-version") }} | ||
- {{ 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/targets/{{ target_name }}/include/nvjpeg2k_version.h # [linux] | ||
- test -f $PREFIX/targets/{{ target_name }}/include/nvjpeg2k.h # [linux] | ||
- test -L $PREFIX/targets/{{ target_name }}/lib/libnvjpeg2k.so # [linux] | ||
# - test -f $PREFIX/targets/{{ target_name }}/lib/stubs/libnvjpeg2k.so # [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: | ||
- targets/{{ target_name }}/lib/libnvjpeg2k_static.a # [linux] | ||
requirements: | ||
build: | ||
- arm-variant * {{ arm_variant_type }} # [aarch64] | ||
host: | ||
- cuda-version {{ cuda_version }} | ||
run: | ||
- {{ pin_compatible("cuda-version") }} | ||
- {{ pin_subpackage("libnvjpeg2k-dev", exact=True) }} | ||
run_constrained: | ||
- arm-variant * {{ arm_variant_type }} # [aarch64] | ||
test: | ||
commands: | ||
- test -f $PREFIX/targets/{{ target_name }}/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
[[ ${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" | ||
|
||
errors="" | ||
|
||
for lib in `find ${PREFIX}/${targetsDir}/lib -type f`; do | ||
[[ $lib =~ \.so ]] || continue | ||
|
||
rpath=$(patchelf --print-rpath $lib) | ||
echo "$lib rpath: $rpath" | ||
if [[ $rpath != "\$ORIGIN" ]]; then | ||
errors+="$lib\n" | ||
elif [[ $(objdump -x ${lib} | grep "PATH") == *"RUNPATH"* ]]; then | ||
errors+="$lib\n" | ||
fi | ||
done | ||
|
||
if [[ $errors ]]; then | ||
echo "The following libraries were found with an unexpected RPATH:" | ||
echo -e "$errors" | ||
|
||
exit 1 | ||
else | ||
exit 0 | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear to me if we have hard dependency on the cudart.