Skip to content

Commit

Permalink
Merge pull request #1171 from parthenon-hpc-lab/jmm/use-system-packages
Browse files Browse the repository at this point in the history
[Trivial] Add ability to use system packages
  • Loading branch information
Yurlungur authored Sep 11, 2024
2 parents ec61c9c + ec12475 commit a0c665d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Current develop

### Added (new features/APIs/variables/...)
- [[PR 1171]](https://github.com/parthenon-hpc-lab/parthenon/pull/1171) Add PARTHENON_USE_SYSTEM_PACKAGES build option


### Changed (changing behavior/API/variables/...)


Expand Down
20 changes: 17 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright(C) 2020-2024 The Parthenon collaboration
# Licensed under the 3-clause BSD License, see LICENSE file for details
#=========================================================================================
# (C) (or copyright) 2020-2023. Triad National Security, LLC. All rights reserved.
# (C) (or copyright) 2020-2024. Triad National Security, LLC. All rights reserved.
#
# This program was produced under U.S. Government contract 89233218CNA000001 for Los
# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC
Expand Down Expand Up @@ -60,6 +60,17 @@ option(CODE_COVERAGE "Enable code coverage reporting" OFF)
option(ENABLE_ASAN "Turn on ASAN" OFF)
option(ENABLE_HWASAN "Turn on HWASAN (currently ARM-only)" OFF)

option(PARTHENON_USE_SYSTEM_PACKAGES "Enables search for system packages when available" OFF)
if (PARTHENON_USE_SYSTEM_PACKAGES)
option(PARTHENON_IMPORT_KOKKOS
"If ON, attempt to link to an external Kokkos library. If OFF, build Kokkos from source and package with Parthenon"
ON)
else()
option(PARTHENON_IMPORT_KOKKOS
"If ON, attempt to link to an external Kokkos library. If OFF, build Kokkos from source and package with Parthenon"
OFF)
endif()

include(cmake/Format.cmake)
include(cmake/Lint.cmake)

Expand Down Expand Up @@ -204,7 +215,6 @@ endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)

option(PARTHENON_IMPORT_KOKKOS "If ON, attempt to link to an external Kokkos library. If OFF, build Kokkos from source and package with Parthenon" OFF)
if (NOT TARGET Kokkos::kokkos)
if (PARTHENON_IMPORT_KOKKOS)
find_package(Kokkos 4)
Expand Down Expand Up @@ -367,7 +377,11 @@ if (PARTHENON_ENABLE_UNIT_TESTS OR PARTHENON_ENABLE_INTEGRATION_TESTS OR PARTHEN
endif()

if (PARTHENON_ENABLE_ASCENT)
find_package(Ascent REQUIRED NO_DEFAULT_PATH)
if (PARTHENON_USE_SYSTEM_PACKAGES)
find_package(Ascent REQUIRED)
else()
find_package(Ascent REQUIRED NO_DEFAULT_PATH)
endif()
endif()

# Installation configuration
Expand Down
3 changes: 2 additions & 1 deletion doc/sphinx/src/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ General list of cmake options:
|| PARTHENON\_COPYRIGHT\_CHECK\_DEFAULT || OFF || Option || Check copyright as part of the default target (otherwise use the `check-copyright` target) |
|| CMAKE\_INSTALL\_PREFIX || machine specific || String || Optional path for library installation |
|| Kokkos\_ROOT || unset || String || Path to a Kokkos source directory (containing CMakeLists.txt) |
|| PARTHENON\_IMPORT\_KOKKOS || ON/OFF || Option || If ON, attempt to link to an external Kokkos library. If OFF, build Kokkos from source and package with Parthenon |
|| PARTHENON\_USE\_SYSTEM\_PACKAGES || OFF || Option || If ON, attempt to link to system dependencies for Kokkos and Ascent if possible. If OFF, will avoid doing so by default. |
|| PARTHENON\_IMPORT\_KOKKOS || OFF/ON || Option || If ON, attempt to link to an external Kokkos library. Else build from source. Default is ON if PARTHENON\_USE\_SYSTEM\_PACKAGES and OFF otherwise. |
|| BUILD\_SHARED\_LIBS || OFF || Option || If installing Parthenon, whether to build as shared rather than static |
+-------------------------------------------+--------------------------------+---------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+

Expand Down

0 comments on commit a0c665d

Please sign in to comment.