-
Notifications
You must be signed in to change notification settings - Fork 6
Follow standard CMake layout #214
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
base: main
Are you sure you want to change the base?
Changes from all commits
7eb9e54
ed53411
ec909eb
1351a29
18a3cbe
4e46726
08d6ffb
ed80423
bdd3cd2
7d43a70
a01d03e
7392ea6
7a1850f
6e94e02
2106436
edaf7d4
adaca6d
4ee7dbb
c2da216
3678f5c
0bacedc
063b52c
f33f81d
b101c71
e1ca3ba
0ba4a9e
6971888
924e13f
626bd01
6a9c5da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
|
|
||
| if(DEFINED ENV{LIKWID_DIR} AND NOT LIKWID_DIR) | ||
| set(LIKWID_DIR "$ENV{LIKWID_DIR}" CACHE PATH "LIKWID installation directory") | ||
| endif() | ||
|
|
||
| find_package(PkgConfig QUIET) | ||
| if(PKG_CONFIG_FOUND) | ||
| pkg_check_modules(LIKWID_PC QUIET likwid) | ||
| endif() | ||
|
|
||
| find_path(LIKWID_INCLUDE_DIR | ||
| NAMES likwid.h | ||
| HINTS ${LIKWID_DIR}/include ${LIKWID_PC_INCLUDE_DIRS} | ||
| ) | ||
|
|
||
| find_library(LIKWID_LIBRARY | ||
| NAMES likwid | ||
| HINTS ${LIKWID_DIR}/lib ${LIKWID_DIR}/lib64 ${LIKWID_PC_LIBRARY_DIRS} | ||
| ) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(LIKWID | ||
| REQUIRED_VARS LIKWID_INCLUDE_DIR LIKWID_LIBRARY | ||
| ) | ||
|
|
||
| if(LIKWID_FOUND AND NOT TARGET LIKWID::LIKWID) | ||
| add_library(LIKWID::LIKWID INTERFACE IMPORTED) | ||
| set_target_properties(LIKWID::LIKWID PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${LIKWID_INCLUDE_DIR}" | ||
| INTERFACE_LINK_LIBRARIES "${LIKWID_LIBRARY}" | ||
| INTERFACE_COMPILE_DEFINITIONS "LIKWID_PERFMON" | ||
| ) | ||
| endif() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
|
|
||
| # Stage 1: prefer an installed MUMPS CMake config (supports COMPONENTS properly) | ||
| find_package(MUMPS CONFIG QUIET COMPONENTS ${MUMPS_FIND_COMPONENTS}) | ||
| if(MUMPS_FOUND) | ||
| return() | ||
| endif() | ||
|
|
||
| # Stage 2: manual discovery via MUMPS_DIR hint | ||
| if(DEFINED ENV{MUMPS_DIR} AND NOT MUMPS_DIR) | ||
| set(MUMPS_DIR "$ENV{MUMPS_DIR}" CACHE PATH "MUMPS installation directory") | ||
| endif() | ||
|
|
||
| find_path(MUMPS_INCLUDE_DIR | ||
| NAMES dmumps_c.h | ||
| HINTS ${MUMPS_DIR}/include | ||
| ) | ||
|
|
||
| foreach(_lib dmumps smumps mumps_common) | ||
| find_library(MUMPS_${_lib}_LIBRARY | ||
| NAMES ${_lib} | ||
| HINTS ${MUMPS_DIR}/lib ${MUMPS_DIR}/lib64 | ||
| ) | ||
| list(APPEND _MUMPS_REQUIRED_VARS MUMPS_${_lib}_LIBRARY) | ||
| endforeach() | ||
|
|
||
| # mpiseq is the sequential MPI stub — only present in sequential builds | ||
| find_library(MUMPS_mpiseq_LIBRARY | ||
| NAMES mpiseq | ||
| HINTS ${MUMPS_DIR}/lib ${MUMPS_DIR}/lib64 | ||
| ${MUMPS_DIR}/libseq ${MUMPS_DIR}/lib/SEQ | ||
| ) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(MUMPS | ||
| REQUIRED_VARS MUMPS_INCLUDE_DIR ${_MUMPS_REQUIRED_VARS} | ||
| ) | ||
|
|
||
| if(MUMPS_FOUND AND NOT TARGET MUMPS::MUMPS) | ||
| find_package(Metis REQUIRED) | ||
|
|
||
| set(_mumps_libs | ||
| ${MUMPS_dmumps_LIBRARY} | ||
| ${MUMPS_smumps_LIBRARY} | ||
| ${MUMPS_mumps_common_LIBRARY} | ||
| metis::metis | ||
| ) | ||
| if(MUMPS_mpiseq_LIBRARY) | ||
| list(APPEND _mumps_libs ${MUMPS_mpiseq_LIBRARY}) | ||
| endif() | ||
|
|
||
| add_library(MUMPS::MUMPS INTERFACE IMPORTED) | ||
| set_target_properties(MUMPS::MUMPS PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${MUMPS_INCLUDE_DIR}" | ||
| INTERFACE_LINK_LIBRARIES "${_mumps_libs}" | ||
| ) | ||
| endif() |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this METIS from https://github.com/KarypisLab/METIS ? I see it is based on CMake, it does not generate its own Config files ? Does not need to be handled in the PR.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't check, I just reorganised what was already in the existing CMake files. Probably a question for @mknaranja
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. more a comment than a full answer: Yes, this is METIS from Karypis, it is used for mesh / graph partitioning which is used in direct solvers such as MUMPS. But: I couldn't tell you anything about the technical config file question, I never looked at it at that level.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I never tested Mumps without Metis, but Mumps could be used without it by setting ICNTL(7)=7. https://github.com/SciCompMod/GMGPolar/blob/main/src/LinearAlgebra/Solvers/coo_mumps_solver.cpp#L107
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think MUMPS can also use other graph partitioners such as p4est but I think that does only yield other problems. Graph partitioning is used to reduce fill-in. I would suggest to keep METIS if MUMPS is used. From my point of view, METIS is a minimal dependency as it is used in millions of numerical linear algebra (+ HPC) applications. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
|
|
||
| if(DEFINED ENV{METIS_DIR} AND NOT METIS_DIR) | ||
| set(METIS_DIR "$ENV{METIS_DIR}" CACHE PATH "METIS installation directory") | ||
| endif() | ||
|
|
||
| find_path(METIS_INCLUDE_DIR | ||
| NAMES metis.h | ||
| HINTS ${METIS_DIR}/include | ||
| ) | ||
|
|
||
| find_library(METIS_LIBRARY | ||
| NAMES metis | ||
| HINTS ${METIS_DIR}/lib ${METIS_DIR}/lib64 | ||
| ) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(Metis | ||
| REQUIRED_VARS METIS_INCLUDE_DIR METIS_LIBRARY | ||
| ) | ||
|
|
||
| if(Metis_FOUND AND NOT TARGET metis::metis) | ||
| add_library(metis::metis INTERFACE IMPORTED) | ||
| set_target_properties(metis::metis PROPERTIES | ||
| INTERFACE_INCLUDE_DIRECTORIES "${METIS_INCLUDE_DIR}" | ||
| INTERFACE_LINK_LIBRARIES "${METIS_LIBRARY}" | ||
| ) | ||
| endif() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| @PACKAGE_INIT@ | ||
|
|
||
| list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") | ||
|
|
||
| include(CMakeFindDependencyMacro) | ||
|
|
||
| find_dependency(OpenMP COMPONENTS CXX) | ||
| find_dependency(Kokkos) | ||
|
|
||
| if(@GMGPOLAR_USE_MUMPS@) | ||
| find_dependency(MUMPS COMPONENTS OpenMP METIS) | ||
| endif() | ||
|
|
||
| if(@GMGPOLAR_USE_LIKWID@) | ||
| find_dependency(LIKWID) | ||
| endif() | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/GMGPolarTargets.cmake") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not really familiar with the structure. But these executables are built but not installed. Is this intentional? If yes, maybe add a comment :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we need feedback from the GMGPolar team. It is related to the comment above : #214 (comment)
It depends on how you see GMGPolar.
Is it a library? I.e. something designed to provide tools to other bigger tools (e.g. simulations, gyselalib++, etc)
Or is it a tool in its own right? I.e. does it make sense to have access to the executables but not the code?
My impression was that it is more of a library so I have implemented it like this for now. But that also raises the question of whether
GMGPolarInterfaceshould be included in that library or not?In any case I suspect that it does not make sense to install
convergence_order,weak_scalingandstrong_scalingas I'm not sure these are particularly useful if you can't modify the code to try different test cases?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you would export it as a library than you might need the sourceTerm.h concept definitions, but not all source term specific test case examples.
And the main.cpp etc are just for testing purposes and are probably also not part of a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current setup is:
src/ConfigParser/*andsrc/InputFunctions/*is compiled into theGMGPolarLibtargetsrc/ConfigParser/*andsrc/InputFunctions/*are compiled into aGMGPolarInterfacelibraryAs an example of end users:
GMGPolarLibto provide a solver for the equation and would be happy to not have to compileGMGPolarInterfaceGMGPolarInterfaceto avoid having to write our own test cases.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HenrZu What is your opinion?