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

Correctly link with -lm in Python bindings #3309

Merged
merged 1 commit into from Nov 14, 2022
Merged

Conversation

rcurtin
Copy link
Member

@rcurtin rcurtin commented Nov 11, 2022

In certain situations (OS X is where I encountered it), one of the libraries in the CMake MLPACK_LIBRARIES variable is "m", to indicate that we should link with -lm. However, every other library in MLPACK_LIBRARIES is a direct path to a library to link against. This means that when compiling Cython bindings, we get command-lines like

g++ ... /usr/lib/libarmadillo.dylib /usr/lib/libopenblas.dylib m

but that m isn't very helpful---it needs to be -lm. This patch adds a workaround specifically for this case to the Cython build configuration.

Copy link
Member

@shrit shrit left a comment

Choose a reason for hiding this comment

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

LGTM

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. 👍

@rcurtin rcurtin merged commit 8d29301 into mlpack:master Nov 14, 2022
@rcurtin rcurtin deleted the osx_link_m branch November 14, 2022 13:52
@rcurtin rcurtin mentioned this pull request Dec 23, 2022
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