summaryrefslogtreecommitdiff
path: root/CMake
Commit message (Collapse)AuthorAgeFilesLines
* Add preliminary LLVM 7 supportRebecca N. Palmer2018-08-201-1/+1
| | | | | | | | | | | | | | | This is preliminary because LLVM 7 has not been released yet: it was tested with the snapshot from Debian experimental (svn336894). 1.Change linking order, as clangCodeGen now links to clangFrontend 2.Pass references not pointers to WriteBitcodeToFile and CloneModule 3.Add the headers that LoopSimplifyID, LCSSAID and some create*Pass have moved to 4.Define our DEBUG whether or not we just undefined LLVM's (theirs is now LLVM_DEBUG, but we never actually use it) Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* FindLLVM: Accept LLVM 3.9Rebecca N. Palmer2017-02-101-2/+2
| | | | | Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Runtime: re-enable cl_khr_gl_sharing with existing egl extension.Chuanbo Weng2016-09-121-26/+0
| | | | | | | | | | | | | | | | | | In order to query low level layout of GL buffer object/texture/render buffer, previous implementation introduced an egl extension and implemented in Beignet side. This way is broken once mesa change its related internal code. In this patch, we use an new egl extension (EGL_MESA_image_dma_buf_export) to query related layout infomations of gl texture. Since this egl extension is already accepted by Khronos, so it's a stable method. This patch just implement GL texture 2d buffer sharing, and we will implement other target type if necessary. v2: Add CMake build option to enable cl_khr_gl_sharing(default off). Clean up related CMake code. Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* FindLLVM: allow LLVM/Clang 3.8 and reorder the llvm-config priority.Yang Rong2016-08-031-2/+2
| | | | | | | | | Beignet support 3 released llvm version, now is 3.6, 3.7, 3.8. For LLVM 3.4, 3.5, beignet may still support them, but full test don't cover them. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
* FindLLVM: allow LLVM/Clang 3.7Rebecca N. Palmer2016-05-111-2/+2
| | | | | | | | As beignet now works with LLVM/Clang 3.7, accept this version when searching for llvm-config. Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* FindLLVM: check for empty system-libs variableSteven Newbury2015-12-251-0/+2
| | | | | | | | When dynamic linking against LLVM, "llvm-config --system-libs" may be empty. Add check for a result before attempting to call REGEX REPLACE with an empty variable. Signed-off-by: Steven Newbury <steve@snewbury.org.uk> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* FindLLVM: allow LLVM/Clang 3.6Rebecca N. Palmer2015-03-241-2/+2
| | | | | | | | As beignet now works with LLVM/Clang 3.6, accept this version when searching for llvm-config. Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Use matching versions of clang/llvm and libclang/libllvmRebecca Palmer2015-03-241-5/+26
| | | | | | | | | compile the OpenCL standard library with the same version of clang as will compile OpenCL user code, not plain "clang" (i.e. the system default version, which may be different). Signed-off-by: Rebecca Palmer <rebecca_palmer@zoho.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* prefer newer llvm versions over 3.3Andreas Beckmann2015-02-111-2/+2
| | | | | | | | v2: LLVM 3.3 is better than 3.4, switch the order of 3.4 and 3.3. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* add CMake option USE_STANDALONE_GBE_COMPILER and STANDALONE_GBE_COMPILER_DIRGuo Yejun2015-01-121-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | At some platforms with old c/c++ environment, C++11 features are not supported, it results in the failure to build the gbe compiler part which depends on LLVM/clang using C++11 features. The way to resolve is to build a standalone gbe compiler within another feasible system, and build beignet with the already built standalone gbe compiler by setting USE_STANDALONE_GBE_COMPILER=true. The path of the standalone compiler is /usr/local/lib/beignet as default or could be specified by STANDALONE_GBE_COMPILER_DIR. Once USE_STANDALONE_GBE_COMPILER is given, all the gbe compiler relative code will not be built any longer, only libcl.so and libgebinterp.so are built. And libcl.so is special for GEN_PCI_ID, which is queried from the building machie or could be specified as CMake option. v2: separate the CMake option name. update the commit comments. add back the script for gen pci id, and build driver with it. v3: add file FindStandaloneGbeCompiler.cmake to make the main cmakefile clean. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* License: adjust all license version to LGPL v2.1+.Zhigang Gong2014-11-111-1/+1
| | | | | | | | To make the license statement consistent to each other, adjust all license versions to v2.1+. Thus beignet should have a pure LGPL v2.1+ license. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Fix the bug of LLVM_LFLAGS fail to setJunyan He2014-09-161-2/+2
| | | | | | | | | The LLVM_LFLAGS is used before finding the LLVM package, which causes the CMake fails to set correct -L flags and cause linkage error. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Fix build with mesa 10.1.Abrahm Scully2014-06-191-1/+1
| | | | | | | Mesa renamed some constants and a directory. Signed-off-by: Abrahm Scully <abrahm.scully@gmail.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* add support for cross compilerGuo Yejun2014-04-281-1/+1
| | | | | Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Use pkg-config to check modulesZhenyu Wang2014-04-175-187/+3
| | | | | | | | | | | | | | | Instead of use pre-defined path for dependent modules, e.g libdrm, libdrm_intel, etc. Use pkg-config helper for cmake instead. This makes it easy to work with developer own built version of those dependences. Also remove libGL dependence for 'gbe_bin_generator' which is not required. libutest.so still requires libGL now but might be fixed by checking real GL dependence. v2: Fix build with mesa source (92e6260) and link required EGL lib with utests too. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Reviewed-by:Zhigang Gong <zhigang.gong@linux.intel.com>
* Fix the cmake problem in FindLLVM.Zhigang Gong2014-02-111-1/+1
| | | | Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Add clang/LLVM 3.5svn support.Zhigang Gong2014-02-111-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | The clang/llvm 3.3 has some minor bugs such as the vector ++/-- which was fixed in 3.4. But the 3.4 version introduces severer OCL bugs as below: http://llvm.org/bugs/show_bug.cgi?id=18119 http://llvm.org/bugs/show_bug.cgi?id=18120 It seems that the community will only fix these bugs in the ToT version rather than the llvm 3.4 branch. I think we'd better to enable clang/llvm 3.5 in beignet. Currently, the 18120 was fixed in ToT, but 18119 still breaks us. When 18119 get fixed, I will switch the preferred version to 3.5. Please be noted, when you build clang/llvm 3.5, you need to enable the cxx11 to make it compatible with beignet. --enable-cxx11 v2: fix the llvm3.4 issue. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* CL: prepare to support ICD if the system has ocl-icd..Zhigang Gong2014-01-161-37/+0
| | | | | | | | | | v2: Only install the intel-beignet.icd if the system has ocl-icd support. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com> Tested-by: "Song, Ruiling" <ruiling.song@intel.com>
* Revert faulty pushed patchsetZhigang Gong2014-01-141-0/+37
| | | | | | | | | | | | This reverts: Revert "GBE: fixed a long related bug." Revert "Refine the method to find pch and pcm files." Revert "GBE: enable relocatable pch files." Revert "CL: prepare to support ICD if the system has ocl-icd.." Revert "CL: back port ICD support to 1.1 branch." The above patches are merged by accident without review comments and are broken. Now revert them.
* CL: prepare to support ICD if the system has ocl-icd..Zhigang Gong2014-01-101-37/+0
| | | | | | | | v2: Only install the intel-beignet.icd if the system has ocl-icd support. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* Start looking for LLVM from version 3.3 then higher version.Simon Richter2014-01-081-2/+7
| | | | | | | | | | | | | | | When different LLVM versions are installed, look for 3.5, 3.4 and 3.3 in order, then try the system default. As configuring for 3.1 and 3.2 gives an error now, drop these versions from the search. v2: change to use llvm 3.3 as the preferred version. update the document accordingly. Signed-off-by: Simon Richter <Simon.Richter@hogyros.de> Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add the drm include and lib path for find when drm is not the system one.Junyan He2013-11-272-2/+12
| | | | | | | | | Add the support when the DRM lib is not in the system standard location. In some cases, we want to debug the libdrm but not want to influence the whole system. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Fix a build problem when the llvm version has the fix version digit.Zhigang Gong2013-11-271-1/+1
| | | | | | | | | | If the llvm version is something like 3.3.1, the previous cmake script will generate an incorrect cflags as: -DLLVM_33 1 which breaks the build. This commit also update the stable llvm version from 3.1 to 3.3. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
* Add a necessary include path for building with mesa.Zhigang Gong2013-11-041-0/+1
| | | | | | Reported by Lv Meng. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
* support LLVM 3.4Homer Hsing2013-10-141-2/+2
| | | | | | | | | LLVM 3.3 or earlier version don't support unary addition of vectors, such as "++ int2". This patch supports LLVM 3.4. Tested by PIGLIT, no regression. Signed-off-by: Homer Hsing <homer.xing@intel.com> Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
* Refine cmake script file.Zhigang Gong2013-09-182-37/+5
| | | | | | | | | Remove GBM which is not needed. Adjust the header file including sequence to avoid including incorrect cl header file when compile with mesa source code package. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: "Yang, Rong R" <rong.r.yang@intel.com>
* CL: Enalbe gl sharing with new egl extension.Zhigang Gong2013-09-061-0/+14
| | | | | | | | | | | | | The previous implementation is only for 2d/3d texture sharing and is implemented in a hacky fashinon. We need to replace it with a clean and complete one. We introduce a new egl extension to export low level layout information of a buffer object/texture/render buffer from the mesa dri driver to the cl driver layer. As the extension is not accpepted by mesa, we have to implement this new extension in beignet internally. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: He Junyan <junyan.he@inbox.com>
* Change CMake to support LLVM 3.1.Yang Rong2013-05-231-2/+2
| | | | | | | Also fix LLVM 3.1 build errors caused by my vector scalarize commit. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Change clang system call to libclang api call.Yang Rong2013-05-231-1/+26
| | | | | | | | | The original call clang command directly as frontend. The implement is not very flexible. I change to call libclang apis, support both clang 3.1 and clang 3.2. Now still write the intermediate to the file, for code simply. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Add the INCLUDE_DIRECTORIES directive to all the FindXXX modules.Junyan He2013-04-278-0/+8
| | | | | | | | | | If the header files are not at the standard location, we will FAIL to compile because FIND_PATH directive will not add the Include Dir to CXX flags. Add the INCLUDE_DIRECTORIES to handle this if we find the headers we neeeds. Signed-off-by: Junyan He <junyan.he@linux.intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Prefer versioned llvm-configSimon Richter2013-04-181-3/+3
| | | | | | | If multiple versions are installed, prefer version 3.2 before falling back to the default version. Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Implement KHR ICD extensionSimon Richter2013-04-181-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | This adds a pointer to the dispatch table at the beginning of every object of type - cl_command_queue - cl_context - cl_device_id - cl_event - cl_kernel - cl_mem - cl_platform_id - cl_program - cl_sampler as required by the ICD specification. The layout of the dispatch table comes from the OpenCL ICD loader by Brice Videau <brice.videau@imag.fr> and Vincent Danjean <Vincent.Danjean@ens-lyon.org>. To avoid dispatch table entries being overwritten with the ICD loader's implementations of the CL functions (as would be the proper behaviour for the ELF loader), the -Bsymbolic option is given to the linker. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* fix typo in FindLLVM.cmakeLu Guanqun2013-04-101-1/+1
| | | | | Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Find GBM/EGL library at build time.Zhigang Gong2013-04-102-0/+70
| | | | | | | | We will change to use EGL_KHR_gl_texture_2D_image and GBM library to implement OCL and OGL interoperation. We need to check GBM. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com> Tested-by: Homer Hsing <homer.xing@intel.com>
* backend: Add LLVM stable version supportFeng, Boqun2013-04-101-3/+14
| | | | | | | | | | | support current llvm stable version 3.2 modify cmake file to check the version of llvm provided by system or configured by LLVM_INSTALL_DIR, and add a macro define in the format LLVM_<MAJOR><MINOR> according the version, this macro can be used for llvm version-specific code. Signed-off-by: Feng, Boqun <boqun.feng@intel.com> Reviewed-by: Homer Hsing <homer.xing@intel.com>
* Keep consistent naming rule for LLVM_XXX Cmake variables.Zhigang Gong2013-04-101-12/+7
| | | | | | | | Also fixed inconsistent indentation in FindLLVM.cmake and remove some unecessary blank lines. Based on patch from guanqun. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* fix compilation errors when it can't find correct library dirsLu Guanqun2013-04-101-2/+2
| | | | | The reason is that we specify `LLVM_LIBRARY_DIRS` in `backend/src/CMakeLists.txt`, while in `FindLLVM.cmake`, we name it wrong.
* Refine CMake to check llvm version.Zhigang Gong2013-04-107-88/+40
| | | | | | | | This branch need llvm 3.3 or newer version. We need to modify the cmake to check the version. This commit also fixed some minor bugs in the find_packages, and removed those useless files. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* CMake fixup.Zhigang Gong2013-03-291-0/+46
| | | | | | | Add a FindLLVM to handle the llvm package finding function. Fixed the broken CMake files in backend. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
* Removed Gen6 Stripped out all dependencies from previous compiler Added a ↵Benjamin Segovia2012-08-101-0/+36
| | | | dependency on the new compiler
* Cleaned and simplified CMakeLists file Fixed some warnings with latest GCCbsegovia2012-08-102-0/+3
|
* Added all miniCL filesbsegovia2012-08-108-0/+230