[Package: HPX] Fix Apex and OTF2 support (#13982)
* Fix Apex and OTF2 support - Comment out apex as a dependncy: it is bundled with HPX. - Apply a patch to v1.3.0 to correctly build with APEX. - Add otf2 as a dependency when APEX is enabled. * Remove depends_on('apex')
This commit is contained in:
parent
06042ec7ec
commit
65a292fbbf
81
var/spack/repos/builtin/packages/hpx/git_external.patch
Normal file
81
var/spack/repos/builtin/packages/hpx/git_external.patch
Normal file
@ -0,0 +1,81 @@
|
||||
--- hpx/cmake/GitExternal.cmake.orig 2019-08-16 17:27:04.856315000 +0200
|
||||
+++ hpx/cmake/GitExternal.cmake 2019-08-16 17:27:47.362709000 +0200
|
||||
@@ -19,12 +19,12 @@
|
||||
#
|
||||
# [optional] Flags which control behaviour
|
||||
# NO_UPDATE
|
||||
-# When set, GitExternal will not change a repo that has already been checked out.
|
||||
-# The purpose of this is to allow one to set a default branch to be checked out,
|
||||
-# but stop GitExternal from changing back to that branch if the user has checked
|
||||
+# When set, GitExternal will not change a repo that has already been checked out.
|
||||
+# The purpose of this is to allow one to set a default branch to be checked out,
|
||||
+# but stop GitExternal from changing back to that branch if the user has checked
|
||||
# out and is working on another.
|
||||
-# VERBOSE
|
||||
-# When set, displays information about git commands that are executed
|
||||
+# VERBOSE
|
||||
+# When set, displays information about git commands that are executed
|
||||
#
|
||||
|
||||
find_package(Git)
|
||||
@@ -55,17 +55,21 @@
|
||||
if(nok)
|
||||
message(FATAL_ERROR "${DIR} git clone failed: ${error}\n")
|
||||
endif()
|
||||
- endif()
|
||||
|
||||
- if(IS_DIRECTORY "${DIR}/.git")
|
||||
+ # checkout requested tag
|
||||
+ GIT_EXTERNAL_MESSAGE("git checkout -q ${TAG}")
|
||||
+ execute_process(
|
||||
+ COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
|
||||
+ RESULT_VARIABLE nok ERROR_VARIABLE error
|
||||
+ WORKING_DIRECTORY "${DIR}"
|
||||
+ )
|
||||
+ if(nok)
|
||||
+ message(STATUS "${DIR} git checkout ${TAG} failed: ${error}\n")
|
||||
+ endif()
|
||||
+ elseif(IS_DIRECTORY "${DIR}/.git")
|
||||
if (${GIT_EXTERNAL_NO_UPDATE})
|
||||
GIT_EXTERNAL_MESSAGE("Update branch disabled by user")
|
||||
else()
|
||||
- GIT_EXTERNAL_MESSAGE("current ref is \"${currentref}\" and tag is \"${TAG}\"")
|
||||
- if(currentref STREQUAL TAG) # nothing to do
|
||||
- return()
|
||||
- endif()
|
||||
-
|
||||
# reset generated files
|
||||
foreach(GIT_EXTERNAL_RESET_FILE ${GIT_EXTERNAL_RESET})
|
||||
GIT_EXTERNAL_MESSAGE("git reset -q ${GIT_EXTERNAL_RESET_FILE}")
|
||||
@@ -100,15 +104,24 @@
|
||||
message(STATUS "${DIR} git checkout ${TAG} failed: ${error}\n")
|
||||
endif()
|
||||
|
||||
- # update tag
|
||||
- GIT_EXTERNAL_MESSAGE("git rebase FETCH_HEAD")
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} rebase FETCH_HEAD
|
||||
- RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT
|
||||
+ # check if this is a branch
|
||||
+ GIT_EXTERNAL_MESSAGE("git symbolic-ref -q HEAD")
|
||||
+ execute_process(COMMAND "${GIT_EXECUTABLE}" symbolic-ref -q HEAD
|
||||
+ RESULT_VARIABLE nok ERROR_VARIABLE error
|
||||
WORKING_DIRECTORY "${DIR}")
|
||||
- if(RESULT)
|
||||
- message(STATUS "git rebase failed, aborting ${DIR} merge")
|
||||
- execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
|
||||
+ if(nok)
|
||||
+ message(STATUS "${TAG} is not a branch")
|
||||
+ else()
|
||||
+ # update tag
|
||||
+ GIT_EXTERNAL_MESSAGE("git rebase FETCH_HEAD")
|
||||
+ execute_process(COMMAND ${GIT_EXECUTABLE} rebase FETCH_HEAD
|
||||
+ RESULT_VARIABLE RESULT OUTPUT_VARIABLE OUTPUT ERROR_VARIABLE OUTPUT
|
||||
WORKING_DIRECTORY "${DIR}")
|
||||
+ if(RESULT)
|
||||
+ message(STATUS "git rebase failed, aborting ${DIR} merge")
|
||||
+ execute_process(COMMAND ${GIT_EXECUTABLE} rebase --abort
|
||||
+ WORKING_DIRECTORY "${DIR}")
|
||||
+ endif()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
@ -76,11 +76,14 @@ class Hpx(CMakePackage, CudaPackage):
|
||||
depends_on('mpi', when='networking=mpi')
|
||||
|
||||
# Instrumentation
|
||||
depends_on('apex', when='instrumentation=apex')
|
||||
depends_on('otf2', when='instrumentation=apex')
|
||||
depends_on('gperftools', when='instrumentation=google_perftools')
|
||||
depends_on('papi', when='instrumentation=papi')
|
||||
depends_on('valgrind', when='instrumentation=valgrind')
|
||||
|
||||
# Patches APEX
|
||||
patch('git_external.patch', when='@1.3.0 instrumentation=apex')
|
||||
|
||||
def cxx_standard(self):
|
||||
value = self.spec.variants['cxxstd'].value
|
||||
return '-DHPX_WITH_CXX{0}=ON'.format(value)
|
||||
@ -108,6 +111,10 @@ def cmake_args(self):
|
||||
# Instrumentation
|
||||
args.extend(self.instrumentation_args())
|
||||
|
||||
if 'instrumentation=apex' in spec:
|
||||
args += ['-DAPEX_WITH_OTF2=ON'
|
||||
'-DOTF2_ROOT={0}'.format(spec['otf2'].prefix)]
|
||||
|
||||
# Networking
|
||||
args.append('-DHPX_WITH_NETWORKING={0}'.format(
|
||||
'OFF' if 'networking=none' in spec else 'ON'
|
||||
|
Loading…
Reference in New Issue
Block a user