Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Core Modules
dune-common
Commits
2a09d199
Commit
2a09d199
authored
9 years ago
by
Christoph Grüninger
Committed by
Christoph Grüninger
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[CMake] Check for SuiteSparse >= 4.3 for using SPQR
Fixes dune-istl/
#5
parent
f04ac18e
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!78
[CMake] Check for SuiteSparse >= 4.3 for using SPQR
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/FindSuiteSparse.cmake
+30
-0
30 additions, 0 deletions
cmake/modules/FindSuiteSparse.cmake
config.h.cmake
+2
-1
2 additions, 1 deletion
config.h.cmake
with
32 additions
and
1 deletion
cmake/modules/FindSuiteSparse.cmake
+
30
−
0
View file @
2a09d199
...
...
@@ -182,6 +182,35 @@ foreach(_component ${SUITESPARSE_COMPONENTS})
${
_component
}
_LIBRARY
)
endforeach
()
# check version, for SPQR we need at least SuiteSparse 4.3
if
(
SuiteSparse_SPQR_FOUND
)
include
(
CheckCSourceCompiles
)
include
(
CMakePushCheckState
)
cmake_push_check_state
()
set
(
CMAKE_REQUIRED_INCLUDES
${
CMAKE_REQUIRED_INCLUDES
}
${
SUITESPARSE_INCLUDE_DIR
}
)
set
(
CMAKE_REQUIRED_LIBRARIES
${
CMAKE_REQUIRED_LIBRARIES
}
${
SUITESPARSE_LIBRARY
}
)
# check whether version is at least 4.3
check_c_source_compiles
(
"
#include <SuiteSparse_config.h>
int main(void)
{
#ifndef SUITESPARSE_HAS_VERSION_FUNCTION
#error SuiteSparse <= 4.2.0 too old, required version 4.3 or newer for SPQR.
#endif
#if SUITESPARSE_VERSION <= 4003
#error SuiteSparse too old, required version 4.3 or newer for SPQR.
#endif
return 0;
}"
SUITESPARSE_MIN_VERSION_4_3
)
if
(
NOT SUITESPARSE_MIN_VERSION_4_3
)
set
(
SuiteSparse_SPQR_FOUND FALSE
)
set
(
HAVE_SUITESPARSE_SPQR FALSE
)
endif
()
cmake_pop_check_state
()
endif
()
list
(
APPEND SUITESPARSE_LIBRARY
${
SUITESPARSE_CONFIG_LIB
}
)
# make them unique
...
...
@@ -210,6 +239,7 @@ mark_as_advanced(
SUITESPARSE_INCLUDE_DIR
SUITESPARSE_LIBRARY
SUITESPARSE_CONFIG_LIB
SUITESPARSE_MIN_VERSION_4_3
WILL_USE_CHOLMOD
WILL_USE_UMFPACK
)
...
...
This diff is collapsed.
Click to expand it.
config.h.cmake
+
2
−
1
View file @
2a09d199
...
...
@@ -132,7 +132,8 @@
/* Define to ENABLE_SUITESPARSE if the SuiteSparse's RBIO library is available */
#cmakedefine HAVE_SUITESPARSE_RBIO ENABLE_SUITESPARSE
/* Define to ENABLE_SUITESPARSE if the SuiteSparse's SPQR library is available */
/* Define to ENABLE_SUITESPARSE if the SuiteSparse's SPQR library is available
and if it's version is at least 4.3 */
#cmakedefine HAVE_SUITESPARSE_SPQR ENABLE_SUITESPARSE
/* Define to ENABLE_SUITESPARSE if the SuiteSparse's UMFPACK library is available */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment