summaryrefslogtreecommitdiffstats
path: root/polly/CMakeLists.txt
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-02-04 20:55:43 +0000
committerTobias Grosser <tobias@grosser.es>2015-02-04 20:55:43 +0000
commit52a25237d894fd5736a90f11df2c5c9391d13fd5 (patch)
tree2b0e65b1e1de52b56aaa9b04999fe6223d1a7b0f /polly/CMakeLists.txt
parentb6472fe3da9a20bcceb7b24af4ce9f0c4e79b254 (diff)
downloadbcm5719-llvm-52a25237d894fd5736a90f11df2c5c9391d13fd5.tar.gz
bcm5719-llvm-52a25237d894fd5736a90f11df2c5c9391d13fd5.zip
Import isl(+imath) as an external library into Polly
With this patch Polly is always GPL-free (no dependency on GMP any more). As a result, building and distributing Polly will be easier. Furthermore, there is no need to tightly coordinate isl and Polly releases anymore. We import isl b3e0fa7a05d as well as imath 4d707e5ef2. These are the git versions Polly currently was tested with when using utils/checkout_isl.sh. The imported libraries are both MIT-style licensed. We build isl and imath with -fvisibility=hidden to avoid clashes in case other projects (such as gcc) use conflicting versions of isl. The use of imath can temporarily reduce compile-time performance of Polly. We will work on performance tuning in tree. Patches to isl should be contributed first to the main isl repository and can then later be reimported to Polly. This patch is also a prerequisite for the upcoming isl C++ interface. llvm-svn: 228193
Diffstat (limited to 'polly/CMakeLists.txt')
-rw-r--r--polly/CMakeLists.txt28
1 files changed, 20 insertions, 8 deletions
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index 6e72fbabfc6..76919181ada 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -76,23 +76,29 @@ endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
+# Define the FLAGS for the compilation of isl and imath
+#
+# Those are the only C files we have in the repository. Hence, we can just use
+# the CFLAGS to identify them.
+#
+# We first set the visibility of all isl functions to hidden to ensure we do
+# not clash with other isl versions that got linked into a program that uses
+# Polly. (This happens e.g when linking Polly with dragonegg)
+#
+# We also disable all warnings, as these should be fixed upstream. There is
+# no value in reporting them here.
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -w")
+
# Add path for custom modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${POLLY_SOURCE_DIR}/cmake")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-FIND_PACKAGE(Isl REQUIRED)
-set(POLLY_LINK_LIBS ${ISL_LIBRARY})
-
FIND_PACKAGE(Pluto)
if(PLUTO_FOUND)
set(POLLY_LINK_LIBS ${POLLY_LINK_LIBS} ${PLUTO_LIBRARY})
endif(PLUTO_FOUND)
-if(GMP_FOUND)
- set(POLLY_LINK_LIBS ${POLLY_LINK_LIBS} ${GMP_LIBRARY})
-endif(GMP_FOUND)
-
option(POLLY_ENABLE_GPGPU_CODEGEN "Enable GPGPU code generation feature" OFF)
if (POLLY_ENABLE_GPGPU_CODEGEN)
# Do not require CUDA, as GPU code generation test cases can be run without
@@ -118,6 +124,9 @@ include_directories(
BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/JSON/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/External/isl/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/External/isl/imath
+ ${CMAKE_CURRENT_SOURCE_DIR}/lib/External/isl
${CMAKE_CURRENT_BINARY_DIR}/include
)
@@ -151,7 +160,10 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/polly/Config/config.h.cmake
# Add target to check formatting of polly files
file( GLOB_RECURSE files *.h *.cpp)
file( GLOB_RECURSE jsonfiles lib/JSON/*.h lib/JSON/*.cpp)
-list( REMOVE_ITEM files ${jsonfiles} )
+file( GLOB_RECURSE islfiles lib/External/isl/*.h lib/External/isl/*.c
+ lib/External/isl/include/isl/*.h lib/External/isl/imath/*.h
+ lib/External/isl/imath/*.c)
+list( REMOVE_ITEM files ${jsonfiles} ${islfiles})
add_custom_command( OUTPUT formatting COMMAND
CLANG_FORMAT=${LLVM_BINARY_DIR}/bin/clang-format
${CMAKE_CURRENT_SOURCE_DIR}/utils/check_format.sh ${files})
OpenPOWER on IntegriCloud