spack/var/spack/repos/builtin/packages/llvm-amdgpu/fix-system-zlib-ncurses.patch
srekolam ad060c7870
Spack recipes for ROCm software components-Phase1 (#17422)
* Spack recipes for ROCm Stage 1 Build components

* fix flake8 errors

* fixes for flake8 errors

* Add a patch for cmake 3.x suport

* Fix rpath issue where hsa-rocr-dev does not allow it to be filled in by spack

* Remove inherited cmake args from comgr

* Make hsakmt-roct compile: no -Werror because with const cast in numa, and actually add the numa dependency

* Remove redundant cmake args which is inherited

* Fix some dependencies

* Fix some python 2.x compatibilities

* Add amd gpu targets to rocfft

* Make comgr a link dep of rocm-dbgapi and remove redundant cmake args

* Remove redundant cmake args

* Remove more redundant cmake args

* Final redundant args

* Use cmake 3.x instead of a fixed version

* Remove random variable

* Use installed rocclr instead of nonexisting directory

* Don't build outside the staging folder

* Deploy some missing cmake target file

* Formatting

* Fix target list

* Properly handle the rocclr dependency

* Formatting

* Fix vermin test

* Make all 3.5.0 package depend exactly on eachother

* Add a few missing link dependencies

* Fix flake8

* Remove some other redundant flags

* Add gcc install prefix for gcc builds of llvm-amdgpu

* review changes for the spack recipes

* Do not hard-code versions

* Fix atmi install

- no more relative rpaths outside of install directory (required patch)
- fix build -> link dependencies
- remove unused build dependency

* Fix flake8 errors

* Remove unused variable and make things python 2.x compatible

* Fix flake8

* Move compiler config from rocfft -> hipcc

* Remove redundant dependency on fftw-api

* Remove redundant import

* Avoid hitting the ROCM_PATH variable altogether with a patch; also just fill in all variables

* Add missing deps z3, zlib and ncurses+termlib to llvm-amdgpu

* Fix perl shebang and add dep

* Fix typo and patch HIP_CLANG_ROOT detection in hip's cmake files

* fixing build failure due z3 and adding zlib for rocgdb

* new changes to add z3,curses dependency for llvm-amdgpu

* fix flake8 error

Co-authored-by: root <root@localhost.localdomain>
Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2020-08-12 19:36:35 -05:00

61 lines
2.0 KiB
Diff

From 0f5e8e4368199ab993470dc4e7df5d91b806c557 Mon Sep 17 00:00:00 2001
From: Harmen Stoppels <harmenstoppels@gmail.com>
Date: Tue, 11 Aug 2020 15:06:24 +0200
Subject: [PATCH] Use find_library for zlib and ncurses
find_library makes it easier to use a non-system version of zlib and
ncurses, since it respects *_ROOT and CMAKE_PREFIX_PATH.
---
llvm/cmake/config-ix.cmake | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/llvm/cmake/config-ix.cmake b/llvm/cmake/config-ix.cmake
index 612ce5bdbcb..e748e5ef8c1 100644
--- a/llvm/cmake/config-ix.cmake
+++ b/llvm/cmake/config-ix.cmake
@@ -120,15 +120,11 @@ endif()
if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
set(HAVE_LIBZ 0)
if(LLVM_ENABLE_ZLIB)
- foreach(library z zlib_static zlib)
- string(TOUPPER ${library} library_suffix)
- check_library_exists(${library} compress2 "" HAVE_LIBZ_${library_suffix})
- if(HAVE_LIBZ_${library_suffix})
- set(HAVE_LIBZ 1)
- set(ZLIB_LIBRARIES "${library}")
- break()
- endif()
- endforeach()
+ find_library(FIND_ZLIB NAMES z zlib_static zlib)
+ if(FIND_ZLIB)
+ set(HAVE_LIBZ 1)
+ set(ZLIB_LIBRARIES "${FIND_ZLIB}")
+ endif()
endif()
# Don't look for these libraries on Windows.
@@ -141,15 +137,11 @@ if(NOT LLVM_USE_SANITIZER MATCHES "Memory.*")
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()
--
2.25.1