Skip to content

Commit

Permalink
Try to apply fix that will make the image converter build.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcurtin committed Mar 22, 2024
1 parent 89003f4 commit 0598db2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/windows-arm64-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ jobs:
git clone https://github.com/mlpack/mlpack
cd mlpack
git checkout $MLPACK_VERSION
# Apply patches to install Python headers.
# Apply patches to install Python headers and fix STB detection.
cp ../ConfigureFileOnly.cmake CMake/
cp ../mlpack.pc.in src/mlpack/bindings/python/
patch -p1 < ../python-install-headers.patch
patch -p1 < ../stb-cmake-fix.patch
- name: Generate setup.py
shell: powershell
Expand Down
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pipeline
cp ../ConfigureFileOnly.cmake CMake/
cp ../mlpack.pc.in src/mlpack/bindings/python/
patch -p1 < ../python-install-headers.patch
patch -p1 < ../stb-cmake-fix.patch
mkdir build/
cd build/
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines-macos-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ steps:
sed -i.bk 's/${PACKAGE_VERSION}/${PACKAGE_VERSION}.post1/g' src/mlpack/bindings/python/setup.py.in
rm -f src/mlpack/bindings/python/setup.py.in.bk
# Apply patches to install Python headers.
# Apply patches to install Python headers and fix STB detection.
cp ../ConfigureFileOnly.cmake CMake/
cp ../mlpack.pc.in src/mlpack/bindings/python/
patch -p1 < ../python-install-headers.patch
patch -p1 < ../stb-cmake-fix.patch
displayName: Clone mlpack
- bash: |
Expand Down
3 changes: 2 additions & 1 deletion azure-pipelines-windows-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ steps:
sed -i.bk 's/${PACKAGE_VERSION}/${PACKAGE_VERSION}.post1/g' src/mlpack/bindings/python/setup.py.in
rm -f src/mlpack/bindings/python/setup.py.in.bk
# Apply patches to install Python headers.
# Apply patches to install Python headers and fix STB detection.
cp ../ConfigureFileOnly.cmake CMake/
cp ../mlpack.pc.in src/mlpack/bindings/python/
patch -p1 < ../python-install-headers.patch
patch -p1 < ../stb-cmake-fix.patch
displayName: Clone mlpack
- powershell: |
Expand Down
19 changes: 19 additions & 0 deletions stb-cmake-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- mlpack-4.3.0/CMakeLists.txt 2023-11-27 13:27:20.000000000 -0500
+++ mlpack-4.3.0-mod/CMakeLists.txt 2024-03-22 11:41:28.569175709 -0400
@@ -312,14 +312,14 @@
find_package(StbImage)
else()
find_package(StbImage)
- if (NOT STB_IMAGE_FOUND)
+ if (NOT StbImage_FOUND)
get_deps(https://mlpack.org/files/stb.tar.gz stb stb.tar.gz)
set(STB_IMAGE_INCLUDE_DIR ${GENERIC_INCLUDE_DIR})
find_package(StbImage REQUIRED)
endif()
endif()

-if (STB_IMAGE_FOUND)
+if (StbImage_FOUND)
set(STB_AVAILABLE "1")
set(MLPACK_INCLUDE_DIRS ${MLPACK_INCLUDE_DIRS} "${STB_IMAGE_INCLUDE_DIR}")

0 comments on commit 0598db2

Please sign in to comment.