-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move check for ParMETS version for Zoltan2 to Zoltan2 (#63)
When ParMEITS is found by an upstream cmake project (e.g. KokkosKerenls), the value of HAVE_PARMETIS_VERSION_4_0_3l does not get written into the ParMETISConfig.cmake file so Zoltan2 was configuring with an error. But this is a check for Zoltan2, not other Trilinos packages anyway so this check should be in Zoltan2, not in the FindTPLParMETIS.cmake NOTE: If we want to support exporting various variables into the generated <tplName>Config.cmake files for TriBITS TPLs generated using tribits_tpl_find_include_dirs_and_libraries(), then we will need to do some refactoring in TriBITS to make that possible. But that should not be too hard. This was just not needed in this case.
- Loading branch information
1 parent
b7c3118
commit fd8b701
Showing
3 changed files
with
32 additions
and
35 deletions.
There are no files selected for viewing
This file contains 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 contains 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
25 changes: 25 additions & 0 deletions
25
packages/zoltan2/core/cmake/Zoltan2CheckParMETISVersion.cmake
This file contains 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,25 @@ | ||
include(CheckCSourceCompiles) | ||
|
||
FUNCTION(ZOLTAN2_CHECK_PARMETIS_HAS_VERSION_4_0_3 VARNAME) | ||
SET(SOURCE | ||
" | ||
#include <stdio.h> | ||
#include <parmetis.h> | ||
int main() | ||
{ | ||
#if PARMETIS_MAJOR_VERSION > 4 | ||
return 0; | ||
#elif PARMETIS_MAJOR_VERSION == 4 && PARMETIS_MINOR_VERSION > 0 | ||
return 0; | ||
#elif PARMETIS_MAJOR_VERSION == 4 && PARMETIS_MINOR_VERSION == 0 && PARMETIS_SUBMINOR_VERSION >= 3 | ||
return 0; | ||
#else | ||
parmetis_version_failure | ||
#endif | ||
} | ||
" | ||
) | ||
SET(CMAKE_REQUIRED_LIBRARIES ParMETIS::all_libs) | ||
CHECK_C_SOURCE_COMPILES("${SOURCE}" ${VARNAME}) | ||
ENDFUNCTION() |