From: bsegovia Date: Mon, 13 Aug 2012 16:17:43 +0000 (+0000) Subject: Reenabled the CMake build path. It is really imperfect and the build CMake X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d8eaa446ae23f27421ece63af0fa1c990c035fa;p=contrib%2Fbeignet.git Reenabled the CMake build path. It is really imperfect and the build CMake scripts should be cleanly unified later --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5685cee..ea84071 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,9 @@ ENDIF (USE_FULSIM) SET(CMAKE_CXX_FLAGS "-Wall -Wno-invalid-offsetof -mfpmath=sse --no-rtti -Wcast-align -std=c++0x") SET(CMAKE_C_FLAGS "-Wall -mfpmath=sse -msse2 -Wcast-align") +# Front end stuff we need +Find_Package(LLVM REQUIRED) + # XLib INCLUDE(CMake/FindXLib.cmake) IF(XLIB_FOUND) @@ -95,7 +98,7 @@ ELSE(GBE_FOUND) MESSAGE(STATUS "Looking for Gen-Backend - not found") ENDIF(GBE_FOUND) -# the run-time itself +ADD_SUBDIRECTORY(backend) ADD_SUBDIRECTORY(src) ADD_SUBDIRECTORY(utests) diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index 8057f4c..4ae476f 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -14,27 +14,12 @@ set (GBE_COMPILE_UTESTS false CACHE bool "Will compile the unit tests") set (GBE_USE_BLOB false CACHE bool "Compile everything from one big file") ############################################################## -# Front end stuff we need -############################################################## -Find_Package(LLVM REQUIRED) - -############################################################## # Compiler ############################################################## if (UNIX) set (COMPILER "GCC" CACHE INT "Compiler to choose on Linux (GCC,ICC,CLANG)") endif (UNIX) -if (WIN32) - if (MINGW) - set (DEF "-D") - else (MINGW) - set (DEF "/D") - endif (MINGW) -else (WIN32) - set (DEF "-D") -endif (WIN32) - # Force Release with debug info if (NOT CMAKE_BUILD_TYPE) set (CMAKE_BUILD_TYPE RelWithDebInfo) @@ -43,95 +28,78 @@ set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "assure config" FORCE) message(STATUS "Building mode: " ${CMAKE_BUILD_TYPE}) if (GBE_DEBUG_MEMORY) - set (GBE_DEBUG_MEMORY_FLAG "${DEF}GBE_DEBUG_MEMORY=1") + set (GBE_DEBUG_MEMORY_FLAG "-DGBE_DEBUG_MEMORY=1") else (GBE_DEBUG_MEMORY) - set (GBE_DEBUG_MEMORY_FLAG "${DEF}GBE_DEBUG_MEMORY=0") + set (GBE_DEBUG_MEMORY_FLAG "-DGBE_DEBUG_MEMORY=0") endif (GBE_DEBUG_MEMORY) if (GBE_COMPILE_UTESTS) - set (GBE_COMPILE_UTESTS_FLAG "${DEF}GBE_COMPILE_UTESTS=1") + set (GBE_COMPILE_UTESTS_FLAG "-DGBE_COMPILE_UTESTS=1") else (GBE_COMPILE_UTESTS) - set (GBE_COMPILE_UTESTS_FLAG "${DEF}GBE_COMPILE_UTESTS=0") + set (GBE_COMPILE_UTESTS_FLAG "-DGBE_COMPILE_UTESTS=0") endif (GBE_COMPILE_UTESTS) -## Linux compilation -if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # Hide all symbols and allows the symbols declared as visible to be exported +# Hide all symbols and allows the symbols declared as visible to be exported +if (NOT GBE_COMPILE_UTESTS) + set (CMAKE_C_CXX_FLAGS "-fvisibility=hidden") +endif (NOT GBE_COMPILE_UTESTS) + +if (COMPILER STREQUAL "GCC") + set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -Wstrict-aliasing=2 -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -ffast-math -fPIC -Wall") + set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -Wno-invalid-offsetof -fno-rtti -std=c++0x") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-E") + set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined") if (NOT GBE_COMPILE_UTESTS) - set (CMAKE_C_CXX_FLAGS "-fvisibility=hidden") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") endif (NOT GBE_COMPILE_UTESTS) - - if (COMPILER STREQUAL "GCC") - set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -funroll-loops -Wstrict-aliasing=2 -fstrict-aliasing -msse2 -msse3 -mssse3 -msse4.1 -ffast-math -fPIC -Wall") - set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -Wno-invalid-offsetof -fno-rtti -std=c++0x") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-E") - set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined") - if (NOT GBE_COMPILE_UTESTS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") - endif (NOT GBE_COMPILE_UTESTS) - set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") - set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-E") - set (CMAKE_C_FLAGS_DEBUG "-g -DGBE_DEBUG=1") - set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") - set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") - elseif (COMPILER STREQUAL "CLANG") - set (CMAKE_C_COMPILER "clang") - set (CMAKE_C_FLAGS "-Wall -std=c99") - set (CMAKE_C_FLAGS_DEBUG "-g -DGBE_DEBUG=1") - set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") - set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_CXX_COMPILER "clang++") - set (CMAKE_CXX_FLAGS "-fstrict-aliasing -msse2 -ffast-math -fPIC -Wall -Wno-format-security -Wno-invalid-offsetof -std=c++0x") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG}") - set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1") - set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") - set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") - set (CMAKE_AR "/usr/bin/llvm-ar") - set (CMAKE_LINKER "/usr/bin/llvm-ld") - set (CMAKE_NM "/usr/bin/llvm-nm") - set (CMAKE_OBJDUMP "/usr/bin/llvm-objdump") - set (CMAKE_RANLIB "ranlib") - elseif (COMPILER STREQUAL "ICC") - set (CMAKE_CXX_COMPILER "icpc") - set (CMAKE_C_COMPILER "icc") - set (CMAKE_CXX_FLAGS "-std=c++0x -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -xSSE2") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG} -Wl,-E") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MODE_FLAG}") - set (CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DGBE_DEBUG=1") - set (CCMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DGBE_DEBUG=1") - set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2 -DGBE_DEBUG=0") - set (CCMAKE_CXX_FLAGS_MINSIZEREL "-Os -DGBE_DEBUG=0") - set (CMAKE_EXE_LINKER_FLAGS "") - endif () - -## Windows compilation -elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows") - if (MINGW) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -fstrict-aliasing -msse2 -ffast-math -Wall -fno-rtti -std=c++0x") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MODE_FLAG}") - set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") - else (MINGW) - set (COMMON_FLAGS "${GBE_DEBUG_MEMORY_FLAG} /arch:SSE2 /D_CRT_SECURE_NO_WARNINGS /DNOMINMAX /GR- /GS- /W3 /wd4275") - set (CMAKE_CXX_FLAGS ${COMMON_FLAGS}) - set (CMAKE_C_FLAGS ${COMMON_FLAGS}) - endif (MINGW) + set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1") + set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") + set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-E") + set (CMAKE_C_FLAGS_DEBUG "-g -DGBE_DEBUG=1") + set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") + set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") +elseif (COMPILER STREQUAL "CLANG") + set (CMAKE_C_COMPILER "clang") + set (CMAKE_C_FLAGS "-Wall -std=c99") + set (CMAKE_C_FLAGS_DEBUG "-g -DGBE_DEBUG=1") + set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") + set (CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_CXX_COMPILER "clang++") + set (CMAKE_CXX_FLAGS "-fstrict-aliasing -msse2 -ffast-math -fPIC -Wall -Wno-format-security -Wno-invalid-offsetof -std=c++0x") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG}") + set (CMAKE_CXX_FLAGS_DEBUG "-g -DGBE_DEBUG=1") + set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1") + set (CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG -DGBE_DEBUG=0") + set (CMAKE_AR "/usr/bin/llvm-ar") + set (CMAKE_LINKER "/usr/bin/llvm-ld") + set (CMAKE_NM "/usr/bin/llvm-nm") + set (CMAKE_OBJDUMP "/usr/bin/llvm-objdump") + set (CMAKE_RANLIB "ranlib") +elseif (COMPILER STREQUAL "ICC") + set (CMAKE_CXX_COMPILER "icpc") + set (CMAKE_C_COMPILER "icc") + set (CMAKE_CXX_FLAGS "-std=c++0x -wd2928 -Wall -fPIC -fstrict-aliasing -fp-model fast -xSSE2") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MEMORY_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_COMPILE_UTESTS_FLAG}") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${VISIBILITY_FLAG} -Wl,-E") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GBE_DEBUG_MODE_FLAG}") + set (CMAKE_CXX_FLAGS_DEBUG "-g -O0 -DGBE_DEBUG=1") + set (CCMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2 -DGBE_DEBUG=1") + set (CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O2 -DGBE_DEBUG=0") + set (CCMAKE_CXX_FLAGS_MINSIZEREL "-Os -DGBE_DEBUG=0") + set (CMAKE_EXE_LINKER_FLAGS "") endif () ############################################################## diff --git a/backend/src/backend/sim/sim_vector_str.cpp b/backend/src/backend/sim/sim_vector_str.cpp index 78100ee..be8be9d 100644 --- a/backend/src/backend/sim/sim_vector_str.cpp +++ b/backend/src/backend/sim/sim_vector_str.cpp @@ -1,46 +1,23 @@ -/* - * Copyright © 2012 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: Benjamin Segovia - */ - #include "string" namespace gbe { std::string sim_vector_str = -"/*\n" -" * Copyright 2012 Intel Corporation\n" +"/* \n" +" * Copyright © 2012 Intel Corporation\n" +" *\n" +" * This library is free software; you can redistribute it and/or\n" +" * modify it under the terms of the GNU Lesser General Public\n" +" * License as published by the Free Software Foundation; either\n" +" * version 2 of the License, or (at your option) any later version.\n" " *\n" -" * Permission is hereby granted, free of charge, to any person obtaining a\n" -" * copy of this software and associated documentation files (the \"Software\"),\n" -" * to deal in the Software without restriction, including without limitation\n" -" * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n" -" * and/or sell copies of the Software, and to permit persons to whom the\n" -" * Software is furnished to do so, subject to the following conditions:\n" +" * This library is distributed in the hope that it will be useful,\n" +" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" +" * Lesser General Public License for more details.\n" " *\n" -" * The above copyright notice and this permission notice (including the next\n" -" * paragraph) shall be included in all copies or substantial portions of the\n" -" * Software.\n" +" * You should have received a copy of the GNU Lesser General Public\n" +" * License along with this library. If not, see .\n" " *\n" -" * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" -" * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" -" * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n" -" * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" -" * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n" -" * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n" -" * DEALINGS IN THE SOFTWARE.\n" +" * Author: Benjamin Segovia \n" " */\n" "\n" "/**\n" diff --git a/backend/src/backend/sim/simulator_str.cpp b/backend/src/backend/sim/simulator_str.cpp index 5cffec3..2b60cae 100644 --- a/backend/src/backend/sim/simulator_str.cpp +++ b/backend/src/backend/sim/simulator_str.cpp @@ -1,46 +1,23 @@ -/* - * Copyright © 2012 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: Benjamin Segovia - */ - #include "string" namespace gbe { std::string simulator_str = -"/*\n" -" * Copyright 2012 Intel Corporation\n" +"/* \n" +" * Copyright © 2012 Intel Corporation\n" +" *\n" +" * This library is free software; you can redistribute it and/or\n" +" * modify it under the terms of the GNU Lesser General Public\n" +" * License as published by the Free Software Foundation; either\n" +" * version 2 of the License, or (at your option) any later version.\n" " *\n" -" * Permission is hereby granted, free of charge, to any person obtaining a\n" -" * copy of this software and associated documentation files (the \"Software\"),\n" -" * to deal in the Software without restriction, including without limitation\n" -" * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n" -" * and/or sell copies of the Software, and to permit persons to whom the\n" -" * Software is furnished to do so, subject to the following conditions:\n" +" * This library is distributed in the hope that it will be useful,\n" +" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" +" * Lesser General Public License for more details.\n" " *\n" -" * The above copyright notice and this permission notice (including the next\n" -" * paragraph) shall be included in all copies or substantial portions of the\n" -" * Software.\n" +" * You should have received a copy of the GNU Lesser General Public\n" +" * License along with this library. If not, see .\n" " *\n" -" * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n" -" * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n" -" * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n" -" * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n" -" * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n" -" * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n" -" * DEALINGS IN THE SOFTWARE.\n" +" * Author: Benjamin Segovia \n" " */\n" "\n" "/**\n" diff --git a/backend/src/ocl_stdlib_str.cpp b/backend/src/ocl_stdlib_str.cpp index be2e5af..6e78240 100644 --- a/backend/src/ocl_stdlib_str.cpp +++ b/backend/src/ocl_stdlib_str.cpp @@ -1,25 +1,25 @@ -/* - * Copyright © 2012 Intel Corporation - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - * - * Author: Benjamin Segovia - */ - #include "string" namespace gbe { std::string ocl_stdlib_str = +"/* \n" +" * Copyright © 2012 Intel Corporation\n" +" *\n" +" * This library is free software; you can redistribute it and/or\n" +" * modify it under the terms of the GNU Lesser General Public\n" +" * License as published by the Free Software Foundation; either\n" +" * version 2 of the License, or (at your option) any later version.\n" +" *\n" +" * This library is distributed in the hope that it will be useful,\n" +" * but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n" +" * Lesser General Public License for more details.\n" +" *\n" +" * You should have received a copy of the GNU Lesser General Public\n" +" * License along with this library. If not, see .\n" +" *\n" +" * Author: Benjamin Segovia \n" +" */\n" +"\n" "/////////////////////////////////////////////////////////////////////////////\n" "// OpenCL basic types\n" "/////////////////////////////////////////////////////////////////////////////\n" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 384a70d..f8dd817 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,6 +1,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${DRM_INCLUDE_PATH} - ${GBE_INCLUDE_PATH} + ${CMAKE_CURRENT_SOURCE_DIR}/../backend/src/backend/ ${CMAKE_CURRENT_SOURCE_DIR}/../include) set(OPENCL_SRC @@ -18,9 +18,9 @@ set(OPENCL_SRC cl_command_queue.c cl_command_queue.h cl_command_queue_gen7.c - cl_driver.c cl_driver.h cl_driver.cpp + cl_driver_defs.c sim/sim_driver.c sim/sim_driver.h sim/sim_simulator.c @@ -31,14 +31,14 @@ set(OPENCL_SRC x11/dricommon.c x11/va_dri2.c) +link_directories (${LLVM_LIBRARY_DIRS}) add_library(cl SHARED ${OPENCL_SRC}) target_link_libraries(cl - ${GBE_LIBRARY} - ${DRM_LIBRARY} - ${DRM_INTEL_LIBRARY} + gbe ${XLIB_LIBRARY} ${XEXT_LIBRARY} ${XFIXES_LIBRARY} + ${DRM_INTEL_LIBRARY} ${DRM_LIBRARY}) install (TARGETS cl LIBRARY DESTINATION lib) diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt index ad870f1..4ef504e 100644 --- a/utests/CMakeLists.txt +++ b/utests/CMakeLists.txt @@ -1,6 +1,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../include) +link_directories (${LLVM_LIBRARY_DIRS}) ADD_LIBRARY(utests SHARED utest_error.c utest_helper.cpp @@ -37,6 +38,7 @@ ADD_LIBRARY(utests SHARED compiler_function_argument1.cpp compiler_argument_structure.cpp) # compiler_local_slm.cpp) + TARGET_LINK_LIBRARIES(utests cl m) ADD_EXECUTABLE(run utest_run.cpp)