diff --git a/recipes/libnvjpeg/bld.bat b/recipes/libnvjpeg/bld.bat new file mode 100644 index 0000000000000..57ba00afb97f9 --- /dev/null +++ b/recipes/libnvjpeg/bld.bat @@ -0,0 +1,5 @@ +if not exist %PREFIX% mkdir %PREFIX% + +move lib\x64\* %LIBRARY_LIB% +move bin\* %LIBRARY_BIN% +move include\* %LIBRARY_INC% diff --git a/recipes/libnvjpeg/build.sh b/recipes/libnvjpeg/build.sh new file mode 100644 index 0000000000000..e913421b4cf06 --- /dev/null +++ b/recipes/libnvjpeg/build.sh @@ -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 diff --git a/recipes/libnvjpeg/conda_build_config.yaml b/recipes/libnvjpeg/conda_build_config.yaml new file mode 100644 index 0000000000000..52229a8424e52 --- /dev/null +++ b/recipes/libnvjpeg/conda_build_config.yaml @@ -0,0 +1,2 @@ +arm_variant_type: # [aarch64] + - sbsa # [aarch64] diff --git a/recipes/libnvjpeg/meta.yaml b/recipes/libnvjpeg/meta.yaml new file mode 100644 index 0000000000000..c6c68d4631b2b --- /dev/null +++ b/recipes/libnvjpeg/meta.yaml @@ -0,0 +1,148 @@ +{% set name = "libnvjpeg" %} +{% set version = "12.0.0.28" %} +{% 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 or win] + +test: + commands: + - test -L $PREFIX/lib/libnvjpeg.so.{{ version.split(".")[0] }} # [linux] + - test -L $PREFIX/lib/libnvjpeg.so.{{ version }} # [linux] + - test -L $PREFIX/targets/{{ target_name }}/lib/libnvjpeg.so.{{ version.split(".")[0] }} # [linux] + - test -f $PREFIX/targets/{{ target_name }}/lib/libnvjpeg.so.{{ version }} # [linux] + - if not exist %LIBRARY_BIN%\nvjpeg64_{{ version.split(".")[0] }}.dll exit 1 # [win] + +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") }} + - 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] + # Tests are defined at the top level, due to package/output name conflicts. + about: + home: https://developer.nvidia.com/nvjpeg + 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/nvjpeg/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: + 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) }} + - cuda-cudart-dev + 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/nvjpeg/index.html + + - 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: + 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/nvjpeg/index.html + +about: + home: https://developer.nvidia.com/nvjpeg + 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/nvjpeg/index.html + +extra: + recipe-maintainers: + - adibbley