[PATCH] D33299: [Polly][CMake] Use the CMake Package instead of llvm-config in out-of-tree builds

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 9 10:11:58 PDT 2017


Meinersbur added a comment.

> How is Polly picking up libLLVM for you?

LLVM (script located at ~/build/llvm/release_nopolly_dylib.sh):

  #! /usr/bin/env bash
  set -e
  
  TYPENAME=`basename $0 .sh`
  BUILDPATH=`realpath --no-symlinks $(dirname $0)`
  PROJECTNAME=`basename ${BUILDPATH}`
  TYPEPATH="${BUILDPATH}/${TYPENAME}"
  SRCPATH=~/src/${PROJECTNAME}
  
  mkdir -p "${TYPEPATH}"
  cd "${TYPEPATH}"
  
  cmake "${SRCPATH}" -GNinja          \
  -DLLVM_BUILD_LLVM_DYLIB=ON          \
  -DLLVM_LINK_LLVM_DYLIB=ON           \
  -DCMAKE_BUILD_TYPE=Release          \
  -DCMAKE_INSTALL_PREFIX=${HOME}/install/${PROJECTNAME}/${TYPENAME} \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON  \
  -DLLVM_PARALLEL_LINK_JOBS=1         \
  -DLLVM_TARGETS_TO_BUILD=X86\;NVPTX  \
  -DLLVM_ENABLE_ASSERTIONS=ON         \
  -DLIBCXX_ENABLE_ASSERTIONS=ON       \
  -DLIBCXXABI_ENABLE_ASSERTIONS=ON    \
  -DLLVM_TOOL_POLLY_BUILD=OFF         \
  -DLLVM_POLLY_BUILD=OFF              \
  -DLLVM_TOOL_LLDB_BUILD=OFF          \
  -DLLVM_LLDB_BUILD=OFF               \
  -DLLVM_TOOL_LLD_BUILD=OFF           \
  -DLLVM_LLD_BUILD=OFF                \
  -DLLVM_TOOL_OPENMP_BUILD=OFF        \
  -DLLVM_OPENMP_BUILD=OFF             \
  -DLLVM_TOOL_COMPILER_RT_BUILD=OFF   \
  -DLLVM_COMPILER_RT_BUILD=OFF        \
  -DCLANG_TOOL_EXTRA_BUILD=OFF        \
  -DCLANG_EXTRA_BUILD=OFF             \
  -DLLVM_ENABLE_LIBCXX=OFF            \
  -DLLVM_TOOL_LIBCXX_BUILD=OFF        \
  -DLLVM_LIBCXX_BUILD=OFF             \
  -DLLVM_TOOL_LIBCXXABI_BUILD=OFF     \
  -DLLVM_LIBCXXABI_BUILD=OFF          \

Polly:

  #! /usr/bin/env bash
  set -e
  
  TYPENAME=`basename $0 .sh`
  BUILDPATH=`realpath --no-symlinks $(dirname $0)`
  PROJECTNAME=`basename ${BUILDPATH}`
  TYPEPATH="${BUILDPATH}/${TYPENAME}"
  SRCPATH=~/src/llvm/tools/${PROJECTNAME}
  
  mkdir -p "${TYPEPATH}"
  cd "${TYPEPATH}"
  
  cmake "${SRCPATH}" -GNinja          \
  -DLLVM_INSTALL_ROOT=${HOME}/build/llvm/release_nopolly_dylib \
  -DCMAKE_PREFIX_PATH=${HOME}/build/llvm/release_nopolly_dylib \
  -DCMAKE_BUILD_TYPE=Release          \
  -DCMAKE_INSTALL_PREFIX=${HOME}/install/${PROJECTNAME}/${TYPENAME} \
  -DCMAKE_EXPORT_COMPILE_COMMANDS=ON  \
  -DLLVM_ENABLE_ASSERTIONS=ON         \
  -DPOLLY_ENABLE_GPGPU_CODEGEN=ON

This automatically finds `FileCheck` in the build dir, which is nice, but fails with the aforementioned error.

`-DLLVM_DIR=-DLLVM_DIR=${HOME}/build/llvm/release_nopolly_dylib` doesn't work.


https://reviews.llvm.org/D33299





More information about the llvm-commits mailing list