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

Fix STB detection when STB is manually specified #3660

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

rcurtin
Copy link
Member

@rcurtin rcurtin commented Mar 22, 2024

I discovered while debugging #3641 that CMake was not actually configuring mlpack as though STB was available, even though STB's location was being specified in the CMake call! Digging into this, I found that our CMake code was using the STB_IMAGE_FOUND variable, but the script CMake/FindStbImage.cmake doesn't always set that variable.

The correct variable to use is actually StbImage_FOUND, which is set by the find_package_handle_standard_args() CMake function. So, I adapted our CMake configuration to use that instead, and removed the manually-set STB_IMAGE_FOUND variable, which actually will not be set when a user manually specifies the STB include directory.

@conradsnicta
Copy link
Contributor

Sidenote. It may be worthwhile to consider removing STB integration from mlpack, in order to reduce the maintenance burden. Having a dependency is an invitation for that dependency (and the associated handling of that dependency) to break things. It can be argued that mlpack's primary domain is machine learning on user supplied data, and handling of non-trivial image formats (eg. jpeg, png) should be handled by the user before passing the data to mlpack.

Copy link

@mlpack-bot mlpack-bot bot left a comment

Choose a reason for hiding this comment

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

Second approval provided automatically after 24 hours. 👍

@conradsnicta conradsnicta merged commit 4f92ca7 into mlpack:master Mar 25, 2024
18 of 20 checks passed
@rcurtin rcurtin deleted the cmake-stb-fix-2 branch April 1, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants