diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-01-12 09:48:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 09:48:03 +0100 |
commit | a2a0262f79567a309ec919c21af4f3dc8cebc999 (patch) | |
tree | 95cd822ccc845c3efb8261cd65ef7c13358b6a62 | |
parent | 60a58d89e73f2bc820812c97544ef04193b90fe2 (diff) | |
download | spack-a2a0262f79567a309ec919c21af4f3dc8cebc999.tar.gz spack-a2a0262f79567a309ec919c21af4f3dc8cebc999.tar.bz2 spack-a2a0262f79567a309ec919c21af4f3dc8cebc999.tar.xz spack-a2a0262f79567a309ec919c21af4f3dc8cebc999.zip |
hip: fix naming of libraries when installing from tarballs (#20780)
There's two issues with hip where it tries to autodetect the patch
version number from git (when installed), but it does not check if it
even is inside of a git repo. The result is we end up with a shared lib
with a trailing dash in the library suffix: `libamd64.so.x.y.z-`, which
confuses GCC. The patch tries to check if the `.git` folder exists, and
if it does not, it handles version numbering the same as when git was
not installed previously.
-rw-r--r-- | var/spack/repos/builtin/packages/hip/0003-Improve-compilation-without-git-repo.patch | 56 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/hip/package.py | 3 |
2 files changed, 59 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hip/0003-Improve-compilation-without-git-repo.patch b/var/spack/repos/builtin/packages/hip/0003-Improve-compilation-without-git-repo.patch new file mode 100644 index 0000000000..d7f1a8dff3 --- /dev/null +++ b/var/spack/repos/builtin/packages/hip/0003-Improve-compilation-without-git-repo.patch @@ -0,0 +1,56 @@ +From 3a05d9ee5af2d318d27ee4b8e81542e2c81b9d5a Mon Sep 17 00:00:00 2001 +From: Harmen Stoppels <harmenstoppels@gmail.com> +Date: Mon, 11 Jan 2021 16:38:14 +0100 +Subject: [PATCH] Improve compilation without git repo + +--- + CMakeLists.txt | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7831bb4d..c0c7a536 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -42,9 +42,17 @@ string(REPLACE "." ";" VERSION_LIST ${HIP_BASE_VERSION}) + list(GET VERSION_LIST 0 HIP_VERSION_MAJOR) + list(GET VERSION_LIST 1 HIP_VERSION_MINOR) + +-find_package(Git) ++# only look for git when we have a git repo ++if (IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git") ++ find_package(Git) ++endif() + + # FIXME: Two different version strings used. ++ ++set(HIP_PACKAGING_VERSION_PATCH "0") ++set(HIP_VERSION_GITDATE "0") ++set(HIP_VERSION_PATCH "0") ++ + if(GIT_FOUND) + # get date information based on UTC + # use the last two digits of year + week number + day in the week as HIP_VERSION_GITDATE +@@ -88,9 +96,6 @@ if(GIT_FOUND) + else() + set(HIP_PACKAGING_VERSION_PATCH ${HIP_VERSION_GITDATE}.${HIP_VERSION_GITCOUNT}-${HIP_VERSION_GITHASH}) + endif() +-else() +- # FIXME: Some parts depend on this being set. +- set(HIP_PACKAGING_VERSION_PATCH "0") + endif() + + ## Debian package specific variables +@@ -488,10 +493,6 @@ endif() + # Generate .hipVersion + file(WRITE "${PROJECT_BINARY_DIR}/.hipVersion" ${_versionInfo}) + +-if(NOT DEFINED HIP_VERSION_GITDATE) +- set(HIP_VERSION_GITDATE 0) +-endif() +- + # Build doxygen documentation + find_program(DOXYGEN_EXE doxygen) + if(DOXYGEN_EXE) +-- +2.25.1 + diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index 830ef73abf..fa09ebf7cf 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -51,6 +51,9 @@ class Hip(CMakePackage): # See https://github.com/ROCm-Developer-Tools/HIP/pull/2141 patch('0002-Fix-detection-of-HIP_CLANG_ROOT.patch', when='@:3.9.0') + # See https://github.com/ROCm-Developer-Tools/HIP/pull/2218 + patch('0003-Improve-compilation-without-git-repo.patch', when='@4.0.0:') + def get_rocm_prefix_info(self): # External packages in Spack do not currently contain dependency # information. External installations of hip therefore must compute |