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
bc6bf9b4
Commit
bc6bf9b4
authored
12 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Added METIS test.
[[Imported from SVN: r6945]]
parent
d17a2594
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/modules/FindMETIS.cmake
+65
-0
65 additions, 0 deletions
cmake/modules/FindMETIS.cmake
with
65 additions
and
0 deletions
cmake/modules/FindMETIS.cmake
0 → 100644
+
65
−
0
View file @
bc6bf9b4
# Accepts the following variables:
#
# METIS_DIR: Prefix where ParMETIS is installed.
# METIS_LIB_NAME: Name of the METIS library (default: metis).
# METIS_LIBRARY: Full path of the METIS library.
# Sets the following variables:
#
# METIS_LIBRARY: Full path of the METIS library.
# METIS_FOUND: True if ParMETIS was found.
# METIS_LIBRARIES: List of all libraries needed for linking with METIS,
#
# Provides the following macros:
#
# find_package(METIS)
#
# Searches for METIS (See above)
#
#
# add_dune_metis_flags(TARGETS)
#
# Adds the necessary flags to comile and link TARGETS with ParMETIS support.
#
find_path
(
METIS_INCLUDE_DIRS metis.h PATHS
${
METIS_DIR
}
PATH_SUFFIXES metis NO_DEFAULT_PATH
DOC
"Include directory of metis"
)
find_path
(
METIS_INCLUDE_DIRS metis.h PATH_SUFFIXES metis
)
set
(
METIS_LIBRARY METIS_LIBRARY-NOTFOUND CACHE FILEPATH
"Full path of the METIS library"
)
include
(
CMakePushCheckState
)
cmake_push_check_state
()
# Save variables
set
(
CMAKE_REQUIRED_INCLUDES
${
CMAKE_REQUIRED_INCLUDES
}
${
METIS_INCLUDE_DIRS
}
)
check_include_file
(
metis.h METIS_FOUND
)
if
(
NOT METIS_LIB_NAME
)
set
(
METIS_LIB_NAME metis
)
endif
(
NOT METIS_LIB_NAME
)
find_library
(
METIS_LIBRARY
${
METIS_LIB_NAME
}
PATHS
${
ParMETIS_DIR
}
PATH_SUFFIXES lib NO_DEFAULT_PATH
)
find_library
(
METIS_LIBRARY
${
METIS_LIB_NAME
}
)
if
(
METIS_LIBRARY
)
set
(
METIS_LIBRARIES
${
METIS_LIBRARY
}
)
list
(
APPEND CMAKE_REQUIRED_LIBRARIES
${
METIS_LIBRARIES
}
)
include
(
CheckSymbolExists
)
check_symbol_exists
(
METIS_PartMeshDual metis.h METIS_FOUND
)
endif
(
METIS_LIBRARY
)
cmake_pop_check_state
()
if
(
METIS_FOUND
)
message
(
STATUS
"METIS found. Include directories are
${
METIS_INCLUDE_DIRS
}
and libraries are
${
METIS_LIBRARIES
}
"
)
else
(
METIS_FOUND
)
message
(
WARNING
"No functional METIS found."
)
endif
(
METIS_FOUND
)
function
(
add_dune_metis_flags _targets
)
if
(
METIS_FOUND
)
foreach
(
_target
${
_targets
}
)
target_link_libraries
(
${
_target
}
${
METIS_LIBRARY
}
)
endforeach
(
_target
${
_targets
}
)
set_property
(
TARGET
${
_targets
}
APPEND PROPERTIES
COMPILE_DIRECTORIES
${
METIS_INCLUDE_DIRS
}
)
endif
(
METIS_FOUND
)
endfunction
(
add_dune_metis_flags _targets
)
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