summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP-Ellis2021-02-03 06:01:41 +1100
committerGitHub2021-02-02 20:01:41 +0100
commit716200ee47e23fb463f921ec93fd184c40b11603 (patch)
treee88eaed43f298b1581063184a74d0f1ab6c7d187
parent959792c94e958074199f5297d9edfbe5d563b999 (diff)
downloadaur-716200ee47e23fb463f921ec93fd184c40b11603.tar.gz
Fix tensorflow include (#573)
* Fix tensorflow include When tensorflow is installed, the CMake script tries to locates `/usr/lib/libtensorflow.so`, and if found enables some additional components of LLVM. Unfortunately, it assumes that the Tensorflow headers are located in `/usr/include`, but they are in fact installed in `/usr/include/tensorflow`. * Detect python version
-rw-r--r--PKGBUILD25
1 files changed, 15 insertions, 10 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6c09c0d3356..280e2422d93 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,18 +13,23 @@ makedepends=(cmake python ninja)
source=("${pkgname}-${pkgver}.tar.gz::$url/archive/rocm-$pkgver.tar.gz")
sha256sums=('8003ede5a1462f46f0bb1b8b16c14ac6e884d322561235f7111ef7c3e74c6b07')
_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
+_pythonver=$(python --version | grep -o "[[:digit:]].[[:digit:]]")
build() {
- cmake -GNinja -Wno-dev -S "$_dirname/llvm" \
- -DCMAKE_INSTALL_PREFIX='/opt/rocm/llvm' \
- -DCMAKE_BUILD_TYPE=Release \
- -DLLVM_HOST_TRIPLE=$CHOST \
- -DLLVM_BUILD_UTILS=ON \
- -DLLVM_ENABLE_BINDINGS=OFF \
- -DLLVM_ENABLE_OCAMLDOC=OFF \
- -DLLVM_ENABLE_PROJECTS='llvm;clang;compiler-rt;lld' \
- -DLLVM_TARGETS_TO_BUILD='AMDGPU;X86' \
- -DOCAMLFIND=NO
+ cmake -GNinja \
+ -Wno-dev \
+ -S "$_dirname/llvm" \
+ -DCMAKE_INSTALL_PREFIX='/opt/rocm/llvm' \
+ -DCMAKE_BUILD_TYPE=Release \
+ -DLLVM_HOST_TRIPLE=$CHOST \
+ -DLLVM_BUILD_UTILS=ON \
+ -DLLVM_ENABLE_BINDINGS=OFF \
+ -DLLVM_ENABLE_OCAMLDOC=OFF \
+ -DLLVM_ENABLE_PROJECTS='llvm;clang;compiler-rt;lld' \
+ -DLLVM_TARGETS_TO_BUILD='AMDGPU;X86' \
+ -DOCAMLFIND=NO \
+ -DCMAKE_CXX_FLAGS='-I/usr/include/tensorflow' \
+ -DTENSORFLOW_AOT_PATH='/usr/lib/python${_pythonver}/site-packages/tensorflow'
ninja
}