Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Initial CMake buildsystem commit
Converted most of top level configure.ac and Makefile.am into CMakeLists.txt. Added cmake versions of config.h.in, pocl.icd.in, pocl.pc.in. Most of LLVM & Clang related stuff is in cmake/LLVM.cmake module. Changes against configure.ac setup: - remove install-paths.h references (most are unused anyway); replace PKG*DIR variables from install-paths.h with defines from config.h - replace PACKAGE_VERSION with POCL_VERSION - replace CLFLAGS with KERNEL_CL_FLAGS, and CLANGXX_FLAGS with KERNEL_CLANGXX_FLAGS - they seem more fitting and less confusing (with LLVM_{CXX,C,CL}FLAGS being values from llvm-config) - changed TARGET-{LLC,CLANG}-FLAGS into {CELL,TCE}-{LLC,CLANG}-FLAGS seems more consistent wrt >1 ocl "targets" - removed {TARGET,HOST}_SIZEOF_<type> defines, they all seem unused; there is some code using SIZEOF_<type> defines though. Missing stuff: - HOST_{LLC,CLANG,...}_FLAGS setup is incomplete, especially on !x86, and also sanitization of various triplets is missing - Other platforms than linux need testing, may not work - TCE & Cell need testing
- Loading branch information
Showing
with
1,498 additions
and 17 deletions.
- +839 −0 CMakeLists.txt
- +478 −0 cmake/LLVM.cmake
- +14 −0 cmake/Sphinx.cmake
- +146 −0 config.h.in.cmake
- +0 −1 lib/CL/clBuildProgram.c
- +0 −1 lib/CL/clCreateKernel.c
- +0 −1 lib/CL/clEnqueueNDRangeKernel.c
- +1 −1 lib/CL/clGetPlatformInfo.c
- +0 −1 lib/CL/devices/basic/basic.c
- +1 −1 lib/CL/devices/cellspu/cellspu.c
- +1 −1 lib/CL/devices/devices.c
- +0 −1 lib/CL/devices/pthread/pthread.c
- +2 −3 lib/CL/devices/tce/tce_common.cc
- +0 −1 lib/CL/devices/tce/ttasim/ttasim.cc
- +3 −4 lib/CL/pocl_llvm_api.cc
- +1 −0 pocl.icd.in.cmake
- +11 −0 pocl.pc.in.cmake
- +1 −1 tests/runtime/test_version.c
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,14 @@ | ||
find_program(SPHINX_EXECUTABLE NAMES sphinx-build | ||
HINTS | ||
$ENV{SPHINX_DIR} | ||
PATH_SUFFIXES bin | ||
DOC "Sphinx documentation generator" | ||
) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(Sphinx DEFAULT_MSG | ||
SPHINX_EXECUTABLE | ||
) | ||
|
||
mark_as_advanced(SPHINX_EXECUTABLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,146 @@ | ||
|
||
/* The normal alignment of `double16', in bytes. */ | ||
#cmakedefine ALIGNOF_DOUBLE16 @ALIGNOF_DOUBLE16@ | ||
|
||
/* The normal alignment of `float16', in bytes. */ | ||
#cmakedefine ALIGNOF_FLOAT16 @ALIGNOF_FLOAT16@ | ||
|
||
|
||
#cmakedefine BUILD_SPU | ||
|
||
#cmakedefine BUILDDIR "@BUILDDIR@" | ||
|
||
/* "Build with ICD" */ | ||
#cmakedefine BUILD_ICD | ||
|
||
|
||
|
||
#cmakedefine CLANG "@CLANG@" | ||
|
||
/* clang++ executable */ | ||
#cmakedefine CLANGXX "@CLANGXX@" | ||
|
||
/* clang++ compiler flags */ | ||
/* TODO in sources */ | ||
#cmakedefine KERNEL_CLANGXX_FLAGS "@KERNEL_CLANGXX_FLAGS@" | ||
|
||
/* "Using a SPIR generator Clang from Khronos." */ | ||
#cmakedefine CLANG_SPIR | ||
|
||
|
||
/* TODO in sources */ | ||
#cmakedefine KERNEL_CL_FLAGS "@KERNEL_CL_FLAGS@" | ||
|
||
|
||
/* "Use a custom buffer allocator" */ | ||
#cmakedefine CUSTOM_BUFFER_ALLOCATOR | ||
|
||
|
||
|
||
#cmakedefine DIRECT_LINKAGE | ||
|
||
|
||
|
||
#cmakedefine FORCED_CLFLAGS "@FORCED_CLFLAGS@" | ||
|
||
|
||
|
||
#cmakedefine HAVE_OCL_ICD | ||
|
||
|
||
|
||
|
||
|
||
/* Defined if posix_memalign is available. */ | ||
#cmakedefine HAVE_POSIX_MEMALIGN | ||
|
||
|
||
#define HOST "@HOST@" | ||
|
||
#define HOST_AS_FLAGS "@HOST_AS_FLAGS@" | ||
|
||
#define HOST_CLANG_FLAGS "@HOST_CLANG_FLAGS@" | ||
|
||
#define HOST_CPU "@HOST_CPU@" | ||
|
||
#define HOST_LD_FLAGS "@HOST_LD_FLAGS@" | ||
|
||
#define HOST_LLC_FLAGS "@HOST_LLC_FLAGS@" | ||
|
||
|
||
|
||
#cmakedefine LLC "@LLC@" | ||
|
||
|
||
/* "Using LLVM 3.2" */ | ||
#cmakedefine LLVM_3_2 | ||
|
||
/* "Using LLVM 3.3" */ | ||
#cmakedefine LLVM_3_3 | ||
|
||
/* "Using LLVM 3.4" */ | ||
#cmakedefine LLVM_3_4 | ||
|
||
/* "Using upcoming LLVM 3.5" */ | ||
#cmakedefine LLVM_3_5 | ||
|
||
|
||
|
||
/* Defined to greatest expected alignment for extended types, in bytes. */ | ||
#cmakedefine MAX_EXTENDED_ALIGNMENT @MAX_EXTENDED_ALIGNMENT@ | ||
|
||
|
||
|
||
/* used in lib/CL/devices/basic */ | ||
#cmakedefine OCL_KERNEL_TARGET "@OCL_KERNEL_TARGET@" | ||
#cmakedefine OCL_KERNEL_TARGET_CPU "@OCL_KERNEL_TARGET_CPU@" | ||
|
||
|
||
|
||
|
||
|
||
#cmakedefine POCL_DEVICE_ADDRESS_BITS @POCL_DEVICE_ADDRESS_BITS@ | ||
|
||
#cmakedefine POCL_VERSION "@POCL_VERSION@" | ||
|
||
#cmakedefine POCL_INSTALL_PRIVATE_HEADER_DIR "@POCL_INSTALL_PRIVATE_HEADER_DIR@" | ||
|
||
#cmakedefine POCL_INSTALL_PRIVATE_DATADIR "@POCL_INSTALL_PRIVATE_DATADIR@" | ||
|
||
/* these are *host* values */ | ||
|
||
/* The size of `double', as computed by sizeof. */ | ||
#cmakedefine SIZEOF_DOUBLE @SIZEOF_DOUBLE@ | ||
|
||
/* The size of `long', as computed by sizeof. */ | ||
#cmakedefine SIZEOF_LONG @SIZEOF_LONG@ | ||
|
||
/* The size of `void *', as computed by sizeof. */ | ||
#cmakedefine SIZEOF_VOID_P @SIZEOF_VOID_P@ | ||
|
||
/* The size of `__fp16', as computed by sizeof. */ | ||
#cmakedefine SIZEOF___FP16 @SIZEOF___FP16@ | ||
|
||
|
||
|
||
/* used in tce_common.c & pocl_llvm_api.cc */ | ||
#cmakedefine SRCDIR "@SRCDIR@" | ||
|
||
|
||
|
||
|
||
|
||
#cmakedefine TCEMC_AVAILABLE | ||
|
||
#cmakedefine TCE_AVAILABLE | ||
|
||
|
||
/* "Use vecmathlib if available for the target." */ | ||
#cmakedefine USE_VECMATHLIB | ||
|
||
|
||
/* Defined on big endian systems */ | ||
#cmakedefine WORDS_BIGENDIAN | ||
|
||
/* Disable cl_khr_int64 when a clang bug is present */ | ||
#cmakedefine _CL_DISABLE_LONG @CL_DISABLE_LONG@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -23,7 +23,6 @@ | ||
*/ | ||
|
||
#include "pocl_cl.h" | ||
#include <assert.h> | ||
#include <string.h> | ||
#include <unistd.h> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -24,7 +24,6 @@ | ||
|
||
#include "pocl_cl.h" | ||
#include "pocl_llvm.h" | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <sys/stat.h> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -27,7 +27,6 @@ | ||
#include "pocl_llvm.h" | ||
#include "pocl_util.h" | ||
#include "utlist.h" | ||
#include <assert.h> | ||
#include <sys/stat.h> | ||
#include <unistd.h> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -25,7 +25,6 @@ | ||
#include "basic.h" | ||
#include "cpuinfo.h" | ||
#include "topology/pocl_topology.h" | ||
#include "common.h" | ||
#include "utlist.h" | ||
#include "devices.h" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -22,7 +22,7 @@ | ||
*/ | ||
|
||
#include "cellspu.h" | ||
#include "config.h" | ||
#include <assert.h> | ||
#include <string.h> | ||
#include <stdlib.h> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -23,7 +23,6 @@ | ||
*/ | ||
|
||
#include "pocl-pthread.h" | ||
#include <assert.h> | ||
#include <pthread.h> | ||
#include <string.h> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -22,7 +22,6 @@ | ||
*/ | ||
|
||
#include "ttasim.h" | ||
#include "bufalloc.h" | ||
#include "pocl_device.h" | ||
#include "pocl_util.h" | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1 @@ | ||
@POCL_INSTALL_PUBLIC_LIBDIR@/libpocl@POCL_LIB_SUFFIX@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,11 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=@POCL_INSTALL_PUBLIC_BINDIR@ | ||
libdir=@POCL_INSTALL_PUBLIC_LIBDIR@ | ||
includedir=@POCL_INSTALL_PUBLIC_HEADER_DIR@ | ||
|
||
Name: Portable Computing Language | ||
Description: Portable Computing Language | ||
Version: @POCL_VERSION@ | ||
Libs: -L${libdir} -lpocl @LD_FLAGS_BIN@ | ||
Cflags: -I${includedir} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters