diff options
author | Teodor Nikolov <teodor.nikolov22@gmail.com> | 2019-12-06 19:41:55 +0100 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2019-12-06 12:41:55 -0600 |
commit | 65a292fbbf90c89c27a6e253c7e85651451c8c6c (patch) | |
tree | 38e73186a22beb74686419ff77b2fa21eafb0224 | |
parent | 06042ec7ec481721c59772aa33e8110acf5d076d (diff) | |
download | spack-65a292fbbf90c89c27a6e253c7e85651451c8c6c.tar.gz spack-65a292fbbf90c89c27a6e253c7e85651451c8c6c.tar.bz2 spack-65a292fbbf90c89c27a6e253c7e85651451c8c6c.tar.xz spack-65a292fbbf90c89c27a6e253c7e85651451c8c6c.zip |
[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')
-rw-r--r-- | var/spack/repos/builtin/packages/hpx/git_external.patch | 81 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/hpx/package.py | 9 |
2 files changed, 89 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/hpx/git_external.patch b/var/spack/repos/builtin/packages/hpx/git_external.patch new file mode 100644 index 0000000000..72d203e7fa --- /dev/null +++ b/var/spack/repos/builtin/packages/hpx/git_external.patch @@ -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() diff --git a/var/spack/repos/builtin/packages/hpx/package.py b/var/spack/repos/builtin/packages/hpx/package.py index 7d78de081c..606323f76a 100644 --- a/var/spack/repos/builtin/packages/hpx/package.py +++ b/var/spack/repos/builtin/packages/hpx/package.py @@ -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 @@ class Hpx(CMakePackage, CudaPackage): # 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' |