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

build wheels on CI #619

Merged
merged 69 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
a4e2160
add wheel building scripts and workflow entries
grlee77 Oct 25, 2023
29f5e9d
update pr-builder entries
grlee77 Oct 26, 2023
cdbb0b2
make wheel build/test scripts executable
grlee77 Oct 26, 2023
3ec1147
call pip directly
grlee77 Oct 26, 2023
fd29f8e
temporarily disable install step of cucim bindings build
grlee77 Oct 26, 2023
f2c6323
apply the new patch
grlee77 Oct 26, 2023
c2b7e82
remove patches and install YASM and openslide dev libs via system pac…
grlee77 Oct 26, 2023
6d453ee
add missing apt update call
grlee77 Oct 26, 2023
1794824
update build_wheel.sh
grlee77 Oct 26, 2023
bcb3e19
restore previously commented line
grlee77 Oct 27, 2023
6036955
fix copy command (don't add -r and use *.so so cmake subfolder isn't …
grlee77 Oct 27, 2023
94c0e93
omit build of cuslide_benchmarks and cuslide_tests on arm64
grlee77 Oct 27, 2023
e381d11
omit building cucim_benchmarks, cucim_tests on arm64
grlee77 Oct 27, 2023
d932e98
fix patch
grlee77 Oct 27, 2023
edec7a0
omit copying bin folder
grlee77 Oct 27, 2023
9f371cf
update dependencies.yaml to remove non-pypi files from pyproject test…
grlee77 Oct 27, 2023
b70fce1
remove imagecodecs and openslide-python test dependencies
grlee77 Oct 27, 2023
4a1d09e
add missing fi in if/else statement
grlee77 Oct 27, 2023
4c4f4a0
modify CuPy package name as needed based on the CUDA version
grlee77 Oct 27, 2023
977f672
allow test suite to run even if imagecodecs was not installed
grlee77 Oct 27, 2023
5f87e2a
fix path for libopenslide on Ubuntu+aarch64
grlee77 Oct 27, 2023
6153d1b
remove unused patch
grlee77 Oct 27, 2023
cf2ca0e
install imagecodecs and openslide-python on x86_64 to enable more tes…
grlee77 Oct 27, 2023
e872185
try installing libopenslide-dev during wheel tests as well
grlee77 Oct 28, 2023
9c4d5ce
skip single test case requiring libopenslide
grlee77 Oct 28, 2023
46254bc
add additional requirements used by a small number of test cases
grlee77 Oct 29, 2023
076964a
check if clara test cases are causing the segfault observed on CUDA 1…
grlee77 Oct 29, 2023
f22f45c
revert unintentional workflow file change
grlee77 Oct 30, 2023
1d088c7
make sure which is installed on rockylinux8
grlee77 Oct 30, 2023
7ce3653
bumpy pybind11 version
grlee77 Oct 30, 2023
6a2d6fc
Merge branch 'branch-23.12' into grelee/build-wheel-on-ci
jakirkham Oct 30, 2023
3b058c7
which was added to the container, so can remove it from the build script
grlee77 Oct 30, 2023
a353e6a
Merge remote-tracking branch 'upstream/branch-23.12' into grelee/buil…
grlee77 Oct 31, 2023
2791228
move existing apply_wheel_modifications.sh logic into build_wheel.sh
grlee77 Oct 31, 2023
dff57f8
refactor VERSION management following example in rapidsai/rmm#1347
grlee77 Oct 31, 2023
aba929e
fix package_src_dir in build_wheel.sh
grlee77 Oct 31, 2023
80225dc
restore python/cucim/VERSION
grlee77 Oct 31, 2023
6ad0883
change python/cucim/VERSION used by CMake back to prior method
grlee77 Oct 31, 2023
8937ab1
revert to old version folder C++ VERSION files
grlee77 Oct 31, 2023
9bb33ab
temporarily use separate VERSION_CPP for CMake
grlee77 Oct 31, 2023
75cd8e8
version in python/cucim/VERSION also needs to be the C++ version with…
grlee77 Oct 31, 2023
6a4518d
reduce number of separate VERSION files being used by CMake (CMakeLis…
grlee77 Oct 31, 2023
82a29a6
remove outdated debug commands
grlee77 Oct 31, 2023
4d6a369
Merge remote-tracking branch 'upstream/branch-23.12' into grelee/buil…
grlee77 Oct 31, 2023
a76f858
use same test cases across CUDA versions
grlee77 Oct 31, 2023
488dfc6
fix linting issue
grlee77 Oct 31, 2023
922c5db
change matplotlib to matplotlib-base
grlee77 Oct 31, 2023
44e9847
don't install imagecodecs/openslide for wheel tests (check if skippin…
grlee77 Oct 31, 2023
661c188
Update ci/build_wheel.sh
grlee77 Oct 31, 2023
5d7bbd9
Merge branch 'grelee/build-wheel-on-ci' of github.com:grlee77/cucim i…
grlee77 Oct 31, 2023
025a455
Merge branch 'branch-23.12' into grelee/build-wheel-on-ci
grlee77 Oct 31, 2023
c9e8af3
remove outdated/broken test skips. CuPy<9.0 is no longer supported
grlee77 Oct 31, 2023
76d858b
fix bad importorskip checks
grlee77 Oct 31, 2023
ca5059d
run rapids-dependency-file-generator
grlee77 Oct 31, 2023
9cc4987
update comment
grlee77 Oct 31, 2023
33edec4
matplotlib-base on conda, matplotlib for requirements/pyproject
grlee77 Oct 31, 2023
3daf9ad
run rapids-dependency-file-generator
grlee77 Nov 1, 2023
5d9645e
simplify the build_wheel.sh by using 'run build_local all'
grlee77 Nov 1, 2023
4277ae7
skip openslide-based test if the package is not installed
grlee77 Nov 1, 2023
588cd24
update CONTRIBUTING.md
grlee77 Nov 1, 2023
fe2ebd9
apply black globally
grlee77 Nov 1, 2023
6ebfccf
cleanup test_python section of dependencies.yaml
grlee77 Nov 1, 2023
01dcff6
Update CONTRIBUTING.md
grlee77 Nov 1, 2023
20df41f
just use NEXT_FULL_TAG directly for VERSION_CPP
grlee77 Nov 3, 2023
4ca9eff
Update ci/build_wheel.sh
grlee77 Nov 3, 2023
f65b052
remove unnecessary 'needs' condition
grlee77 Nov 3, 2023
02b8918
Merge branch 'branch-23.12' into grelee/build-wheel-on-ci
jakirkham Nov 6, 2023
c8f0968
minor cleanup to build_wheel.sh
grlee77 Nov 6, 2023
c05219f
handle stripping of alpha from VERSION string in CMake to simplify CI…
grlee77 Nov 6, 2023
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
19 changes: 19 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,22 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-build:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
script: ci/build_wheel.sh
wheel-publish:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: ${{ inputs.build_type || 'branch' }}
branch: ${{ inputs.branch }}
sha: ${{ inputs.sha }}
date: ${{ inputs.date }}
package-name: cucim
16 changes: 16 additions & 0 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
- conda-python-build
- conda-python-tests
- docs-build
- wheel-build
- wheel-tests
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
checks:
Expand Down Expand Up @@ -50,3 +52,17 @@ jobs:
arch: "amd64"
container_image: "rapidsai/ci-conda:latest"
run_script: "ci/build_docs.sh"
wheel-build:
needs: checks
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/build_wheel.sh
wheel-tests:
needs: wheel-build
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: pull-request
script: ci/test_wheel.sh
9 changes: 9 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ jobs:
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
wheel-tests:
secrets: inherit
uses: rapidsai/shared-workflows/.github/workflows/[email protected]
with:
build_type: nightly
branch: ${{ inputs.branch }}
date: ${{ inputs.date }}
sha: ${{ inputs.sha }}
script: ci/test_wheel.sh
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ repos:
rev: 23.10.1
hooks:
- id: black
files: (python|legate)/.*
args: ["--config", "python/cucim/pyproject.toml"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.18)

# Set VERSION and BUILD
unset(VERSION CACHE)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION VERSION)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION_CPP VERSION)
set(PROJECT_VERSION_BUILD dev)

# Append local cmake module path
Expand Down
16 changes: 9 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,19 +263,21 @@ conda install -y -c ${CONDA_BLD_DIR} -c conda-forge \

## Building a package (for distribution. Including a wheel package for pip)

**Build**

You can execute the following command to build a wheel file for pip.
**Wheel Build**

If you are using CUDA 12.x, please update pyproject.toml as follows before building the wheel
```bash
./run build_package
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" python/cucim/pyproject.toml
```
This will switch the CuPy dependency to one based on CUDA 12.x instead of 11.x.

The command would use `./temp` folder as a local build folder and build a distribution package into `dist` folder using [dockcross](https://github.com/dockcross/dockcross)'s manylinux2014 docker image.
The wheel can then be built using:

`./run build_package` will reuse local `./temp` folder to reduce the build time.
```bash
python -m pip wheel python/cucim/ -w dist -vvv --no-deps --disable-pip-version-check
```

If C++ code or dependent packages are updated so the build is failing somehow, please retry it after deleting the `temp` folder under the repository root.
**Note:** It is possible to build the wheel in this way even without compiling the C++ library first, but in that case the `cucim.clara` module will not be importable.

**Install**

Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

version=$(rapids-generate-version)

rapids-logger "Begin cpp build"

rapids-conda-retry mambabuild conda/recipes/libcucim
RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild conda/recipes/libcucim

rapids-upload-conda-to-s3 cpp
16 changes: 15 additions & 1 deletion ci/build_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ export CMAKE_GENERATOR=Ninja

rapids-print-env

package_name="cucim"
package_dir="python/cucim/src"

version=$(rapids-generate-version)
# for CMake VERSION need to truncate any trailing 'a'
version_cpp=${version%a*}
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (non-blocking): The alternative would be maintaining a single file and then stripping out the alpha in CMake. Now that it's done this way I don't know if it's worth changing, but it would let you carry around one less file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed. I did it this way because I am not familiar with the proper CMake syntax to do it. Happy to update it if you have suggestions on how the CMake code would look.

Copy link
Contributor

Choose a reason for hiding this comment

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

This would probably do it (after the existing file(STRING...) command):

string(REGEX REPLACE "a.*$" "" VERSION ${VERSION})                                                                                                                                                        

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, @vyasr, that seems to work! I pushed a commit to remove VERSION_CPP as well as simplify the CI scripts a bit (there was still writing of some unused VERSION file).

There should now be only a single top-level VERSION file (as well as symlink to it from python/cucim/src/cucim/VERSION)


commit=$(git rev-parse HEAD)

echo "${version}" > VERSION
echo "${version_cpp}" > "${package_dir}/VERSION"
echo "${version_cpp}" > VERSION_CPP
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_dir}/${package_name}/_version.py"

rapids-logger "Begin py build"

CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp)

# TODO: Remove `--no-test` flag once importing on a CPU
# node works correctly
rapids-conda-retry mambabuild \
RAPIDS_PACKAGE_VERSION=${version} rapids-conda-retry mambabuild \
--no-test \
--channel "${CPP_CHANNEL}" \
conda/recipes/cucim
Expand Down
63 changes: 63 additions & 0 deletions ci/build_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -euo pipefail

package_name="cucim"
package_dir="python/cucim"
package_src_dir="${package_dir}/src/${package_name}"

CMAKE_BUILD_TYPE="release"
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: I was going to ask if this was really necessary since it's CMake's default, but now I see that this is for the build_local script. It's out of scope for this PR, but maybe that script should support a default since CMake does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a default, but it is "debug" rather than release! Could potentially change it if there is no objection from @gigony

    local subcommand="${1:-all}"
    local build_type="${2:-debug}"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll leave that up to you two decide. It does seem odd to me that the default would be a debug build though.

Copy link
Member

Choose a reason for hiding this comment

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

Raised as issue: #629


source rapids-configure-sccache
source rapids-date-string

version=$(rapids-generate-version)
commit=$(git rev-parse HEAD)

# for CMake VERSION_CPP need to truncate any trailing 'a'
version_cpp=${version%a*}

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"

# Patch project metadata files to include the CUDA version suffix and version override.
pyproject_file="${package_dir}/pyproject.toml"

PACKAGE_CUDA_SUFFIX="-${RAPIDS_PY_CUDA_SUFFIX}"
# update package name to have the cuda suffix
sed -i "s/name = \"${package_name}\"/name = \"${package_name}${PACKAGE_CUDA_SUFFIX}\"/g" ${pyproject_file}
echo "${version}" > VERSION
echo "${version_cpp}" > VERSION_CPP
echo "${version_cpp}" > "${package_dir}/VERSION"
sed -i "/^__git_commit__/ s/= .*/= \"${commit}\"/g" "${package_src_dir}/_version.py"

if [[ ${PACKAGE_CUDA_SUFFIX} == "-cu12" ]]; then
# change pyproject.toml to use CUDA 12.x version of cupy
sed -i "s/cupy-cuda11x/cupy-cuda12x/g" ${pyproject_file}
fi

echo "The package name and/or version was modified in the package source. The git diff is:"
git diff
Copy link
Contributor

Choose a reason for hiding this comment

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

note: JFYI we've removed this from every other repo at this point but you're welcome to keep it if you find it useful for debugging. It's been a long time since we got much use out of it.

Copy link
Contributor Author

@grlee77 grlee77 Nov 6, 2023

Choose a reason for hiding this comment

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

I have now removed it


pip install --upgrade pip
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (blocking): This shouldn't be necessary. Were you running into specific problems? If so, do we need to address them somewhere?

Copy link
Contributor Author

@grlee77 grlee77 Nov 6, 2023

Choose a reason for hiding this comment

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

No, I was originally also installing a newer CMake etc here and was updating pip before doing that. I have now removed this line.


# Install pip build dependencies (not yet using pyproject.toml)
rapids-dependency-file-generator \
--file_key "py_build" \
--output "requirements" \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee build_requirements.txt
pip install -r build_requirements.txt
Comment on lines +34 to +39
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (blocking): Is this still true? Now that #617 is merged you should be using pyproject.toml. That said, I don't know how the C++ build works when you do build_local. Are these dependencies somehow used there? That would be strange and require some gymnastics for library paths, but I suppose it's possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it still needs to be this way as from the pyproject.toml perspective this is a pure Python package. The pyproject build relies on an external build step (build_local script in this file) having already built and copied the corresponding C++ .so files into the python/cucim/src/cucim/clara folder.

I agree that this is a bit non-standard and we can potentially look into moving to a scikit-build based approach in the future. I don't have time to focus on that at the moment, though.

One benefit of the approach as it is now is that even Windows users can build the pure Python package using pip without having to have CMake and compile the C++ library (which supports linux only). They would be able to use all of cucim.skimage and part of cucim.core, but just would not have the I/O functions in cucim.clara available.

Copy link
Contributor

Choose a reason for hiding this comment

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

I get that there's a separate build_local run, what I'm confused about is what dependencies are being installed by pip that are used in that step? Is it just for CMake/ninja? If so, are these really "py_build" requirements?

Copy link
Member

Choose a reason for hiding this comment

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

Here's what I see on CI:

# To make changes, edit dependencies.yaml and run `rapids-dependency-file-generator`.
cmake>=3.23.1,!=3.25.0
ninja
setuptools>=24.2.0
wheel

Copy link
Member

Choose a reason for hiding this comment

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

Trying deleting these lines in PR: #628



# First build the C++ lib using CMake via the run script
echo "libcucim version: `cat VERSION_CPP`"
./run build_local all ${CMAKE_BUILD_TYPE}

cd "${package_dir}"

python -m pip wheel . -w dist -vvv --no-deps --disable-pip-version-check

mkdir -p final_dist
python -m auditwheel repair -w final_dist dist/*

RAPIDS_PY_WHEEL_NAME="${package_name}_${RAPIDS_PY_CUDA_SUFFIX}" rapids-upload-wheels-to-s3 final_dist
10 changes: 4 additions & 6 deletions ci/release/update-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,10 @@ function sed_runner() {
sed_runner 's/version = .*/version = '"'${NEXT_SHORT_TAG}'"'/g' docs/source/conf.py
sed_runner 's/release = .*/release = '"'${NEXT_FULL_TAG}'"'/g' docs/source/conf.py

sed_runner "s/^version = .*/version = \"${NEXT_FULL_TAG}\"/g" python/cucim/pyproject.toml
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_FULL_TAG}/g" VERSION
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_FULL_TAG}/g" python/cucim/VERSION
sed_runner "s/__version__ = .*/__version__ = \"${NEXT_FULL_TAG}\"/g" python/cucim/src/cucim/__init__.pyi
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_FULL_TAG}/g" cpp/plugins/cucim.kit.cuslide/VERSION
sed_runner "s/${CURRENT_LONG_TAG}/${NEXT_FULL_TAG}/g" cpp/plugins/cucim.kit.cumed/VERSION
# Centralized version file update
echo "${NEXT_FULL_TAG}" > VERSION
echo "${NEXT_FULL_TAG}" > VERSION_CPP

sed_runner "s#\[Version ${CURRENT_LONG_TAG}\](release_notes/v${CURRENT_LONG_TAG}.md)#\[Version ${NEXT_FULL_TAG}\](release_notes/v${NEXT_FULL_TAG}.md)#g" python/cucim/docs/index.md
sed_runner "s/v${CURRENT_LONG_TAG}/v${NEXT_FULL_TAG}/g" python/cucim/docs/getting_started/index.md
sed_runner "s#cucim.kit.cuslide@${CURRENT_LONG_TAG}.so#cucim.kit.cuslide@${NEXT_FULL_TAG}.so#g" python/cucim/docs/getting_started/index.md
Expand Down
18 changes: 18 additions & 0 deletions ci/test_wheel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.

set -eou pipefail

RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})"
RAPIDS_PY_WHEEL_NAME="cucim_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 ./dist

# echo to expand wildcard before adding `[extra]` requires for pip
python -m pip install $(echo ./dist/cucim*.whl)[test]

# Run smoke tests for aarch64 pull requests
if [[ "$(arch)" == "aarch64" && ${RAPIDS_BUILD_TYPE} == "pull-request" ]]; then
python ./ci/wheel_smoke_test.py
else
# TODO: revisit enabling imagecodecs package during testing
python -m pytest ./python/cucim
fi
21 changes: 21 additions & 0 deletions ci/wheel_smoke_test.py
grlee77 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import cupy as cp

import cucim
import cucim.skimage


if __name__ == "__main__":
# verify that all top-level modules are available
assert cucim.is_available("clara")
assert cucim.is_available("core")
assert cucim.is_available("skimage")

# generate a synthetic image and apply a filter
img = cucim.skimage.data.binary_blobs(length=512, n_dim=2)
assert isinstance(img, cp.ndarray)
assert img.dtype.kind == "b"
assert img.shape == (512, 512)

eroded = cucim.skimage.morphology.binary_erosion(
img, cp.ones((3, 3), dtype=bool)
)
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ dependencies:
- libnvjpeg-dev=11.6.0.55
- libnvjpeg=11.6.0.55
- libwebp-base
- matplotlib-base
- nbsphinx
- ninja
- numpy>=1.21.3
- numpydoc
- nvcc_linux-64=11.8
- openslide-python>=1.1.2
- pip
- pooch>=1.6.0
- pre-commit
- psutil>=5.8.0
- pydata-sphinx-theme
Expand Down
2 changes: 2 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ dependencies:
- libnvjpeg-dev
- libnvjpeg-static
- libwebp-base
- matplotlib-base
- nbsphinx
- ninja
- numpy>=1.21.3
- numpydoc
- openslide-python>=1.1.2
- pip
- pooch>=1.6.0
- pre-commit
- psutil>=5.8.0
- pydata-sphinx-theme
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/cucim/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set py_version = environ['CONDA_PY'] %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
Expand All @@ -12,7 +12,7 @@ package:
version: {{ version }}

source:
git_url: ../../..
path: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 2 additions & 2 deletions conda/recipes/libcucim/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %}
{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %}
{% set cuda_major = cuda_version.split('.')[0] %}
{% set date_string = environ['RAPIDS_DATE_STRING'] %}
Expand All @@ -11,7 +11,7 @@ package:
version: {{ version }}

source:
git_url: ../../..
path: ../../..

build:
number: {{ GIT_DESCRIBE_NUMBER }}
Expand Down
4 changes: 3 additions & 1 deletion cpp/cmake/deps/openslide.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if (NOT TARGET deps::openslide)
set(OPENSLIDE_LIB_PATH "$ENV{CONDA_PREFIX}/lib/libopenslide.so")
elseif (EXISTS /usr/lib/x86_64-linux-gnu/libopenslide.so)
set(OPENSLIDE_LIB_PATH /usr/lib/x86_64-linux-gnu/libopenslide.so)
else () # CentOS 6
elseif (EXISTS /usr/lib/aarch64-linux-gnu/libopenslide.so)
set(OPENSLIDE_LIB_PATH /usr/lib/aarch64-linux-gnu/libopenslide.so)
Comment on lines +25 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

question: I can see why this change was needed in general, but it doesn't seem relevant to this PR. Was it just snuck in out of convenience?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is needed here or the arm64 wheel builds fail to find libopenslide and fail during the run build_local call. The use of libopenslide is only needed for C++ lib benchmarks and test cases and it isn't directly used by the Python wheel, but it has to be found to run the C++ build stage (There is not currently a CMake flag to disable building the benchmark binary or tests).

else () # CentOS (x86_64)
set(OPENSLIDE_LIB_PATH /usr/lib64/libopenslide.so)
endif ()

Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cumed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.18)

# Set VERSION
unset(VERSION CACHE)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION VERSION)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/../../../VERSION_CPP VERSION)

# Append local cmake module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
Expand Down
2 changes: 1 addition & 1 deletion cpp/plugins/cucim.kit.cuslide/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ cmake_minimum_required(VERSION 3.18)

# Set VERSION
unset(VERSION CACHE)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/VERSION VERSION)
file(STRINGS ${CMAKE_CURRENT_LIST_DIR}/../../../VERSION_CPP VERSION)

# Append local cmake module path
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
Expand Down
1 change: 0 additions & 1 deletion cpp/plugins/cucim.kit.cuslide/VERSION

This file was deleted.

4 changes: 3 additions & 1 deletion cpp/plugins/cucim.kit.cuslide/cmake/deps/openslide.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ if (NOT TARGET deps::openslide)
set(OPENSLIDE_LIB_PATH "$ENV{CONDA_PREFIX}/lib/libopenslide.so")
elseif (EXISTS /usr/lib/x86_64-linux-gnu/libopenslide.so)
set(OPENSLIDE_LIB_PATH /usr/lib/x86_64-linux-gnu/libopenslide.so)
else () # CentOS 6
elseif (EXISTS /usr/lib/aarch64-linux-gnu/libopenslide.so)
set(OPENSLIDE_LIB_PATH /usr/lib/aarch64-linux-gnu/libopenslide.so)
else () # CentOS (x86_64)
set(OPENSLIDE_LIB_PATH /usr/lib64/libopenslide.so)
endif ()

Expand Down
Loading