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

When USE_LAPACK is false, do not link against LAPACK #263

Merged

Conversation

nmusolino
Copy link
Contributor

@nmusolino nmusolino commented Apr 30, 2024

In a recent pull request (#257), we added USE_LAPACK as a CMake-level variable controlling whetherUSE_LAPACK is defined during C compilation.

Unfortunately, that pull request failed to update the link-time dependencies of the libscsdir and libscsindir targets. This PR fixes the target_link_libraries() declarations to link against blas and lapack if and only if USE_LAPACK is true.

@nmusolino
Copy link
Contributor Author

nmusolino commented Apr 30, 2024

To test this, I confirmed that, when configuring with USE_LAPACK=1, the build process continues to compile with -DUSE_LAPACK and link with -lm -lblas -llapack, as currently.

When configuring with USE_LAPACK=0:

cmake -S . -B ./build0 -D USE_LAPACK=0 && (cd ./build0 && make VERBOSE=1 all)

the build process does not use USE_LAPACK=1 and links with only -lm.

@nmusolino nmusolino force-pushed the fix-link-deps-when-use-lapack-false branch from 43cbf27 to 544a308 Compare April 30, 2024 17:24
@nmusolino nmusolino changed the title Draft: When USE_LAPACK is false, do not link against LAPACK When USE_LAPACK is false, do not link against LAPACK Apr 30, 2024
@nmusolino
Copy link
Contributor Author

@bodono , I contributed #257 in October 2023, but unfortunately that MR had an omission (failed to set linker options based on USE_LAPACK). This MR fixes that mistake.

@bodono
Copy link
Member

bodono commented May 2, 2024

Thanks for doing this @nmusolino !

@bodono bodono merged commit 697e647 into cvxgrp:master May 2, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants