Skip to content

Commit

Permalink
[Patch] Update 3599.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 19, 2023
1 parent 41f2066 commit c40cfdb
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 4 deletions.
70 changes: 67 additions & 3 deletions recipe/3599.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From a1accf5a6ea7468f7e223c0305cdb13c70a34fc2 Mon Sep 17 00:00:00 2001
From a553e39ef6b93c2e9a72de6b02b98ea21a4e56e3 Mon Sep 17 00:00:00 2001
From: Axel Huebl <[email protected]>
Date: Wed, 18 Oct 2023 09:58:37 -0700
Subject: [PATCH] Install Move Tools to `shared/amrex`
Expand All @@ -11,11 +11,55 @@ This moves its content in both the build directory and the
install destination to `share/amrex/` and
`<CMakePkgRoot>/AMReXCMakeModules/`, respectively.
---
Tools/CMake/AMReXBuildInfo.cmake | 29 +++++++++++++++++++------
Tools/CMake/AMReXInstallHelpers.cmake | 31 ++++++++++++++++++---------
1 file changed, 21 insertions(+), 10 deletions(-)
Tools/CMake/AMReXTypecheck.cmake | 8 +++++--
3 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/Tools/CMake/AMReXBuildInfo.cmake b/Tools/CMake/AMReXBuildInfo.cmake
index 36c7005787..77a90e4fd3 100644
--- a/Tools/CMake/AMReXBuildInfo.cmake
+++ b/Tools/CMake/AMReXBuildInfo.cmake
@@ -38,15 +38,30 @@ include(AMReXTargetHelpers)
#
# Set paths
#
-string(REPLACE "/Tools/CMake" "" AMREX_TOP_DIR ${CMAKE_CURRENT_LIST_DIR})
-set( AMREX_TOP_DIR ${AMREX_TOP_DIR} CACHE INTERNAL "Top level AMReX directory")
-
-set( AMREX_BUILDINFO_IFILE ${CMAKE_CURRENT_LIST_DIR}/AMReX_buildInfo.cpp.in
+if (AMReX_FOUND)
+ # AMReX is pre-installed and used as a library
+ string(REPLACE "/lib/cmake/AMReX/AMReXCMakeModules" "" AMREX_TOP_DIR_DEFAULT
+ ${CMAKE_CURRENT_LIST_DIR})
+else ()
+ # this is a superbuild
+ string(REPLACE "/Tools/CMake" "" AMREX_TOP_DIR_DEFAULT
+ ${CMAKE_CURRENT_LIST_DIR})
+endif ()
+set(AMREX_TOP_DIR "${AMREX_TOP_DIR_DEFAULT}" CACHE INTERNAL "Top level AMReX directory")
+
+if (AMReX_FOUND)
+ # AMReX is pre-installed and used as a library
+ set(AMREX_C_SCRIPTS_DIR "${AMREX_TOP_DIR}/share/amrex/C_scripts"
+ CACHE INTERNAL "Path to AMReX' C_scripts dir")
+else ()
+ # this is a superbuild
+ set(AMREX_C_SCRIPTS_DIR "${AMREX_TOP_DIR}/Tools/C_scripts"
+ CACHE INTERNAL "Path to AMReX' C_scripts dir")
+endif ()
+
+set(AMREX_BUILDINFO_IFILE ${CMAKE_CURRENT_LIST_DIR}/AMReX_buildInfo.cpp.in
CACHE INTERNAL "Full path and name of AMReX_buildInfo.cpp.in")

-set( AMREX_C_SCRIPTS_DIR "${AMREX_TOP_DIR}/Tools/C_scripts"
- CACHE INTERNAL "Path to AMReX' C_scripts dir")
-
set(AMREX_BUILD_DATETIME "" CACHE STRING
"User defined build date and time. Set ONLY for reproducibly built binary distributions")

diff --git a/Tools/CMake/AMReXInstallHelpers.cmake b/Tools/CMake/AMReXInstallHelpers.cmake
index 0720efb4cf9..a01cd63301d 100644
index 0720efb4cf..a01cd63301 100644
--- a/Tools/CMake/AMReXInstallHelpers.cmake
+++ b/Tools/CMake/AMReXInstallHelpers.cmake
@@ -26,7 +26,7 @@ function (install_amrex_targets)
Expand Down Expand Up @@ -79,3 +123,23 @@ index 0720efb4cf9..a01cd63301d 100644
)


diff --git a/Tools/CMake/AMReXTypecheck.cmake b/Tools/CMake/AMReXTypecheck.cmake
index 0b68fb8c27..c569eb5d9b 100644
--- a/Tools/CMake/AMReXTypecheck.cmake
+++ b/Tools/CMake/AMReXTypecheck.cmake
@@ -296,9 +296,13 @@ function( add_typecheck_target _target)
#
set(_outfile "${_typecheck_dir}/${_target}_typecheck.ou" )

- # Find typechecker
+ # Find typechecker
find_file(_typechecker "typechecker.py"
- HINTS ${AMReX_SOURCE_DIR} ${AMReX_ROOT} ENV AMReX_ROOT PATH_SUFFIXES Tools/typechecker)
+ HINTS ${AMReX_SOURCE_DIR} ${AMReX_ROOT} ENV AMReX_ROOT
+ PATH_SUFFIXES
+ Tools/typechecker # in-source
+ share/amrex/typechecker # installed
+ )

add_custom_target( typecheck_${_target}
COMMAND python3 ${_typechecker}
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ source:
- 3599.patch

build:
number: 0
number: 1

requirements:
build:
Expand Down

0 comments on commit c40cfdb

Please sign in to comment.