summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMark W. Krentel <krentel@rice.edu>2020-11-26 02:32:24 -0600
committerGitHub <noreply@github.com>2020-11-26 09:32:24 +0100
commit7e2ce24060e86e738e0d1f2a65d07d6f675453bb (patch)
tree0dc9e0063793eac79173f05fd7d4b716b6e591a3 /var
parent8991cc4632eec4bae68cf04cb26af610aa2e5181 (diff)
downloadspack-7e2ce24060e86e738e0d1f2a65d07d6f675453bb.tar.gz
spack-7e2ce24060e86e738e0d1f2a65d07d6f675453bb.tar.bz2
spack-7e2ce24060e86e738e0d1f2a65d07d6f675453bb.tar.xz
spack-7e2ce24060e86e738e0d1f2a65d07d6f675453bb.zip
llvm-amdgpu: fix the build for version 3.9.0 (#20029)
* llvm-amdgpu: fix the build for version 3.9.0 Adapt the fix-system-zlib-ncurses.patch for version 3.9.0. Without the patch, llvm-amdgpu builds, but then rocm-device-libs fails with "cannot find -ltinfo." Tighten the version requirements for cmake according to the llvm/CMakeLists.txt file. * Add a conflict for cmake 3.19.0.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm-amdgpu/fix-ncurses-3.9.0.patch25
-rw-r--r--var/spack/repos/builtin/packages/llvm-amdgpu/package.py6
2 files changed, 30 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/llvm-amdgpu/fix-ncurses-3.9.0.patch b/var/spack/repos/builtin/packages/llvm-amdgpu/fix-ncurses-3.9.0.patch
new file mode 100644
index 0000000000..24be1ecf31
--- /dev/null
+++ b/var/spack/repos/builtin/packages/llvm-amdgpu/fix-ncurses-3.9.0.patch
@@ -0,0 +1,25 @@
+Adapt the fix-system-zlib-ncurses.patch for version 3.9.0.
+
+--- llvm-project-rocm-3.9.0/llvm/cmake/config-ix.cmake.orig 2020-11-20 21:41:10.498772540 -0600
++++ llvm-project-rocm-3.9.0/llvm/cmake/config-ix.cmake 2020-11-20 22:27:57.242391054 -0600
+@@ -126,15 +126,11 @@
+ endif()
+ if(LLVM_ENABLE_TERMINFO)
+ set(HAVE_TERMINFO 0)
+- foreach(library terminfo tinfo curses ncurses ncursesw)
+- string(TOUPPER ${library} library_suffix)
+- check_library_exists(${library} setupterm "" HAVE_TERMINFO_${library_suffix})
+- if(HAVE_TERMINFO_${library_suffix})
+- set(HAVE_TERMINFO 1)
+- set(TERMINFO_LIBS "${library}")
+- break()
+- endif()
+- endforeach()
++ find_library(FIND_TERMINFO NAMES terminfo tinfo curses ncurses ncursesw)
++ if(FIND_TERMINFO)
++ set(HAVE_TERMINFO 1)
++ set(TERMINFO_LIBS "${FIND_TERMINFO}")
++ endif()
+ else()
+ set(HAVE_TERMINFO 0)
+ endif()
diff --git a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py
index 8e616dffb4..a9a69487c9 100644
--- a/var/spack/repos/builtin/packages/llvm-amdgpu/package.py
+++ b/var/spack/repos/builtin/packages/llvm-amdgpu/package.py
@@ -23,7 +23,8 @@ class LlvmAmdgpu(CMakePackage):
variant('build_type', default='Release', values=("Release", "Debug"), description='CMake build type')
- depends_on('cmake@3:', type='build')
+ depends_on('cmake@3.4.3:', type='build', when='@:3.8.99')
+ depends_on('cmake@3.13.4:', type='build', when='@3.9.0:')
depends_on('python', type='build')
depends_on('z3', type='link')
depends_on('zlib', type='link')
@@ -31,6 +32,9 @@ class LlvmAmdgpu(CMakePackage):
# Will likely only be fixed in LLVM 12 upstream
patch('fix-system-zlib-ncurses.patch', when='@3.5.0:3.8.0')
+ patch('fix-ncurses-3.9.0.patch', when='@3.9.0:')
+
+ conflicts('^cmake@3.19.0')
root_cmakelists_dir = 'llvm'