-
Notifications
You must be signed in to change notification settings - Fork 6
Replace FindKLU with FindSuiteSparse #206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| .vscode/ | ||
| .DS_Store | ||
| build/* | ||
| _build | ||
| install/* | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| #[[ | ||
|
|
||
| Finds Sutiesparse include directory and libraries and exports target `Suitesparse` | ||
|
|
||
| User may set: | ||
| - SUITESPARSE_ROOT_DIR | ||
|
|
||
| Author(s): | ||
| - Cameron Rutherford <[email protected]> | ||
|
|
||
| ]] | ||
| set(SUITESPARSE_MODULES | ||
| amd | ||
| colamd | ||
| klu | ||
| suitesparseconfig) | ||
|
|
||
| find_library(SUITESPARSE_LIBRARY | ||
| NAMES | ||
| ${SUITESPARSE_MODULES} | ||
| PATHS | ||
| ${SUITESPARSE_DIR} $ENV{SUITESPARSE_DIR} ${SUITESPARSE_ROOT_DIR} | ||
| ENV LD_LIBRARY_PATH ENV DYLD_LIBRARY_PATH | ||
| PATH_SUFFIXES | ||
| lib64 lib) | ||
|
|
||
| if(SUITESPARSE_LIBRARY) | ||
| set(SUITESPARSE_LIBRARY CACHE FILEPATH "Path to Suitesparse library") | ||
| get_filename_component(SUITESPARSE_LIBRARY_DIR ${SUITESPARSE_LIBRARY} DIRECTORY CACHE "Suitesparse library directory") | ||
| message(STATUS "Found Suitesparse libraries in: " ${SUITESPARSE_LIBRARY_DIR}) | ||
| mark_as_advanced(SUITESPARSE_LIBRARY SUITESPARSE_LIBRARY_DIR) | ||
| if(NOT SUITESPARSE_DIR) | ||
| get_filename_component(SUITESPARSE_DIR ${SUITESPARSE_LIBRARY_DIR} DIRECTORY CACHE) | ||
| endif() | ||
| endif() | ||
|
|
||
| # Find SUITESPARSE header path and ensure all needed files are there | ||
| find_path(SUITESPARSE_INCLUDE_DIR | ||
| NAMES | ||
| amd.h | ||
| colamd.h | ||
| klu.h | ||
| SuiteSparse_config.h | ||
| PATHS | ||
| ${SUITESPARSE_DIR} $ENV{SUITESPARSE_DIR} ${SUITESPARSE_ROOT_DIR} ${SUITESPARSE_LIBRARY_DIR}/.. | ||
| PATH_SUFFIXES | ||
| include) | ||
|
|
||
| if(SUITESPARSE_LIBRARY) | ||
| message(STATUS "Found Suitesparse include: ${SUITESPARSE_INCLUDE_DIR}") | ||
| mark_as_advanced(SUITESPARSE_INCLUDE_DIR) | ||
| unset(SUITESPARSE_LIBRARY) | ||
| add_library(SUITESPARSE INTERFACE IMPORTED) | ||
| target_include_directories(SUITESPARSE INTERFACE ${SUITESPARSE_INCLUDE_DIR}) | ||
| foreach(mod ${SUITESPARSE_MODULES}) | ||
| find_library(suitesparse_${mod} | ||
| NAMES ${mod} | ||
| HINTS ${SUITESPARSE_LIBRARY_DIR}) | ||
| if(suitesparse_${mod}) | ||
| message(STATUS "Found suitesparse internal library " ${mod}) | ||
| target_link_libraries(SUITESPARSE INTERFACE ${suitesparse_${mod}}) | ||
| mark_as_advanced(suitesparse_${mod}) | ||
| else() | ||
| message(SEND_ERROR "Suitesparse internal library " ${mod} " not found") | ||
| endif() | ||
| endforeach(mod) | ||
| else() | ||
| if(NOT SUITESPARSE_ROOT_DIR) | ||
| message(STATUS "Suitesparse dir not found! Please provide correct filepath.") | ||
| set(SUITESPARSE_DIR ${SUITESPARSE_DIR} CACHE PATH "Path to Suitesparse installation root.") | ||
| unset(SUITESPARSE_LIBRARY CACHE) | ||
| unset(SUITESPARSE_INCLUDE_DIR CACHE) | ||
| unset(SUITESPARSE_LIBRARY_DIR CACHE) | ||
| elseif(NOT SUITESPARSE_LIBRARY) | ||
| message(STATUS "Suitesparse library not found! Please provide correct filepath.") | ||
| endif() | ||
| if(SUITESPARSE_ROOT_DIR AND NOT SUITESPARSE_INCLUDE_DIR) | ||
| message(STATUS "Suitesparse include dir not found! Please provide correct filepath.") | ||
| endif() | ||
| endif() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.