diff options
author | Justin <jlec@gentoo.org> | 2015-01-10 19:01:56 +0100 |
---|---|---|
committer | Justin <jlec@gentoo.org> | 2015-01-10 19:01:56 +0100 |
commit | a8663a4f2a09f03ff25162bfb56b6d3866ee44a0 (patch) | |
tree | f024accbc11372c51ea8ef3f26f77138c5982fbc | |
parent | Merge pull request #318 from marbre/merlin (diff) | |
parent | Add Manifest for gtest file required by arryfire (diff) | |
download | sci-a8663a4f2a09f03ff25162bfb56b6d3866ee44a0.tar.gz sci-a8663a4f2a09f03ff25162bfb56b6d3866ee44a0.tar.bz2 sci-a8663a4f2a09f03ff25162bfb56b6d3866ee44a0.zip |
Merge pull request #312 from marbre/arrayfire
ArrayFire ebuild
-rw-r--r-- | sci-libs/arrayfire/ChangeLog | 10 | ||||
-rw-r--r-- | sci-libs/arrayfire/Manifest | 1 | ||||
-rw-r--r-- | sci-libs/arrayfire/arrayfire-9999.ebuild | 81 | ||||
-rw-r--r-- | sci-libs/arrayfire/files/CMakeLists_examples.patch | 11 | ||||
-rw-r--r-- | sci-libs/arrayfire/files/FindCBLAS.patch | 48 | ||||
-rw-r--r-- | sci-libs/arrayfire/files/build_gtest.patch | 51 | ||||
-rw-r--r-- | sci-libs/arrayfire/metadata.xml | 17 |
7 files changed, 219 insertions, 0 deletions
diff --git a/sci-libs/arrayfire/ChangeLog b/sci-libs/arrayfire/ChangeLog new file mode 100644 index 000000000..c21468ac0 --- /dev/null +++ b/sci-libs/arrayfire/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sys-cluster/mpe2 +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*arrayfire-9999 (10 Jan 2015) + + 10 Jan 2015; Marius Brehler <marbre@linux.sungazer.de> +metadata.xml, + +files/FindCBLAS.patch, +files/CMakeLists_examples.patch, + +arrayfire-9999.ebuild: + Add to overlay. diff --git a/sci-libs/arrayfire/Manifest b/sci-libs/arrayfire/Manifest new file mode 100644 index 000000000..77f682a16 --- /dev/null +++ b/sci-libs/arrayfire/Manifest @@ -0,0 +1 @@ +DIST gtest-1.7.0.zip 1164254 SHA256 247ca18dd83f53deb1328be17e4b1be31514cedfc1e3424f672bf11fd7e0d60d SHA512 8859369f2dd32cbc2ac01aba029aa3ff20a321f40658b9643aff442d34c33468221866b801b28c66a28af47dbcd362d26941fc98db92b6efb7e41ea5b7be1a07 WHIRLPOOL 0c31a385159551859c1afe76480b3fb1b560d666db9a0afc5cbda92bcd53bf129f85a8f902c6ded0779c2b4c49aacec59ba5a4d5ce316a07bf08174f4fc64049 diff --git a/sci-libs/arrayfire/arrayfire-9999.ebuild b/sci-libs/arrayfire/arrayfire-9999.ebuild new file mode 100644 index 000000000..a1af26b91 --- /dev/null +++ b/sci-libs/arrayfire/arrayfire-9999.ebuild @@ -0,0 +1,81 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit cmake-utils git-r3 unpacker + +DESCRIPTION="A general purpose GPU library." +HOMEPAGE="http://www.arrayfire.com/" +EGIT_REPO_URI="https://github.com/arrayfire/arrayfire.git" +SRC_URI="test? ( https://googletest.googlecode.com/files/gtest-1.7.0.zip )" +KEYWORDS="~amd64" + +LICENSE="BSD" +SLOT="0" +IUSE="+examples +cpu cuda test" + +RDEPEND=" + >=sys-devel/gcc-4.7.3-r1 + virtual/blas + virtual/cblas + cuda? ( >=dev-util/nvidia-cuda-toolkit-6.0 ) + sci-libs/fftw:3.0" +DEPEND="${RDEPEND} + test? ( app-arch/unzip )" + +BUILD_DIR="${S}/build" +CMAKE_BUILD_TYPE=Release + +PATCHES=( + "${FILESDIR}"/FindCBLAS.patch + "${FILESDIR}"/CMakeLists_examples.patch + "${FILESDIR}"/build_gtest.patch +) + +# We need write acccess /dev/nvidiactl, /dev/nvidia0 and /dev/nvidia-uvm and the portage +# user is (usually) not in the video group +RESTRICT="userpriv" + +pkg_pretend() { + if [[ ${MERGE_TYPE} != binary ]]; then + if [[ $(gcc-major-version) -lt 4 ]] || ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 7 ]] ) ; then + die "Compilation with gcc older than 4.7 is not supported." + fi + fi +} + +src_unpack() { + git-r3_src_unpack + + if use test; then + mkdir -p "${BUILD_DIR}"/third_party/src/ || die + cd "${BUILD_DIR}"/third_party/src/ || die + unpack_zip "${DISTDIR}/"gtest-1.7.0.zip + mv "${BUILD_DIR}"/third_party/src/gtest-1.7.0 "${BUILD_DIR}"/third_party/src/googletest || die + fi +} + +src_configure() { + if use cuda; then + addwrite /dev/nvidiactl + addwrite /dev/nvidia0 + addwrite /dev/nvidia-uvm + fi + + local mycmakeargs=( + $(cmake-utils_use_build cpu CPU) + $(cmake-utils_use_build cuda CUDA) + -DBUILD_OPENCL=OFF + $(cmake-utils_use_build examples EXAMPLES) + $(cmake-utils_use_build test TEST) + ) + cmake-utils_src_configure +} + +src_install() { + cmake-utils_src_install + + dobin "bin2cpp" +} diff --git a/sci-libs/arrayfire/files/CMakeLists_examples.patch b/sci-libs/arrayfire/files/CMakeLists_examples.patch new file mode 100644 index 000000000..45139f864 --- /dev/null +++ b/sci-libs/arrayfire/files/CMakeLists_examples.patch @@ -0,0 +1,11 @@ +--- b/examples/CMakeLists.txt 2015-01-10 12:39:23.000000000 +0100 ++++ a/examples/CMakeLists.txt 2015-01-10 12:40:10.000000000 +0100 +@@ -13,7 +13,7 @@ MACRO(CREATE_EXAMPLES BACKEND) + TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} af${BACKEND} ${THREAD_LIB_FLAG}) + SET_TARGET_PROPERTIES(${EXAMPLE_NAME} PROPERTIES COMPILE_FLAGS -DAF_${DEF_NAME} OUTPUT_NAME ${FNAME}_${BACKEND}) + +-# INSTALL(TARGETS ${EXAMPLE_NAME} DESTINATION arrayfire/examples) ++ INSTALL(TARGETS ${EXAMPLE_NAME} DESTINATION share/arrayfire/examples) + ENDFOREACH() + ENDMACRO(CREATE_EXAMPLES) + diff --git a/sci-libs/arrayfire/files/FindCBLAS.patch b/sci-libs/arrayfire/files/FindCBLAS.patch new file mode 100644 index 000000000..16c619716 --- /dev/null +++ b/sci-libs/arrayfire/files/FindCBLAS.patch @@ -0,0 +1,48 @@ +--- b/CMakeModules/FindCBLAS.cmake 2015-01-09 14:00:29.328281398 +0100 ++++ a/CMakeModules/FindCBLAS.cmake 2015-01-09 14:02:52.549276153 +0100 +@@ -1,3 +1,9 @@ ++# ++# Version modified for Gentoo Linux ++# If a valid PkgConfig configuration for cblas is found, this overrides and cancels ++# all further checks. ++# ++ + # Using FindCBLAS.cmake from the following repo + # https://github.com/clementfarabet/THC/blob/master/COPYRIGHT.txt + +@@ -18,6 +24,29 @@ SET(CBLAS_LIBRARIES) + SET(CBLAS_INCLUDE_DIR) + SET(CBLAS_INCLUDE_FILE) + ++ ++# ++# first, try PkgConfig ++# ++find_package(PkgConfig REQUIRED) ++pkg_check_modules(PC_CBLAS cblas) ++if(PC_CBLAS_FOUND) ++ foreach(PC_LIB ${PC_CBLAS_LIBRARIES}) ++ find_library(${PC_LIB}_LIBRARY NAMES ${PC_LIB} HINTS ${PC_CBLAS_LIBRARY_DIRS} ) ++ if (NOT ${PC_LIB}_LIBRARY) ++ message(FATAL_ERROR "Something is wrong in your pkg-config file - lib ${PC_LIB} not found in ${PC_CBLAS_LIBRARY_DIRS}") ++ endif (NOT ${PC_LIB}_LIBRARY) ++ list(APPEND CBLAS_LIBRARIES ${${PC_LIB}_LIBRARY}) ++ endforeach(PC_LIB) ++ find_package_handle_standard_args(CBLAS DEFAULT_MSG CBLAS_LIBRARIES) ++ mark_as_advanced(CBLAS_LIBRARIES) ++else(PC_CBLAS_FOUND) ++message(STATUS "No PkgConfig configuration for CBLAS found; starting more extensive search.") ++ ++ ++ ++ ++ + # CBLAS in Intel mkl + FIND_PACKAGE(MKL) + IF (MKL_FOUND AND NOT CBLAS_LIBRARIES) +@@ -203,3 +232,5 @@ IF(NOT CBLAS_FIND_QUIETLY) + MESSAGE(STATUS "CBLAS library not found.") + ENDIF(CBLAS_FOUND) + ENDIF(NOT CBLAS_FIND_QUIETLY) ++ ++endif(PC_CBLAS_FOUND) diff --git a/sci-libs/arrayfire/files/build_gtest.patch b/sci-libs/arrayfire/files/build_gtest.patch new file mode 100644 index 000000000..24e4b075e --- /dev/null +++ b/sci-libs/arrayfire/files/build_gtest.patch @@ -0,0 +1,51 @@ +--- CMakeModules/build_gtest.cmake 2015-01-10 11:27:52.007076159 +0100 ++++ CMakeModules/build_gtest.cmake 2015-01-10 17:36:23.000000000 +0100 +@@ -1,27 +1,4 @@ +-#Downloads and installs GTest into the third_party directory +- +-# We apply a patch to subversion, thus we need to find it. +-FIND_PACKAGE(Subversion REQUIRED) +- +-# Create patch file for gtest with MSVC 2012 +-if(MSVC_VERSION EQUAL 1700) +- file(WRITE "${CMAKE_BINARY_DIR}/gtest.patch" "Index: cmake/internal_utils.cmake\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "===================================================================\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "--- cmake/internal_utils.cmake (revision 660)\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+++ cmake/internal_utils.cmake (working copy)\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "@@ -66,6 +66,9 @@\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " # Resolved overload was found by argument-dependent lookup.\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " set(cxx_base_flags \"\${cxx_base_flags} -wd4675\")\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " endif()\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+ if (MSVC_VERSION EQUAL 1700)\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+ set(cxx_base_flags \"\${cxx_base_flags} -D_VARIADIC_MAX=10\")\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" "+ endif ()\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " set(cxx_base_flags \"\${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32\")\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " set(cxx_base_flags \"\${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN\")\n") +- file(APPEND "${CMAKE_BINARY_DIR}/gtest.patch" " set(cxx_exception_flags \"-EHsc -D_HAS_EXCEPTIONS=1\")\n") +-else() +- file(WRITE "${CMAKE_BINARY_DIR}/gtest.patch" "") +-endif() ++#Installs GTest into the third_party directory + + # Enable ExternalProject CMake module + include(ExternalProject) +@@ -37,10 +14,6 @@ set_directory_properties(PROPERTIES EP_P + # Add gtest + ExternalProject_Add( + googletest +- SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/ +- SVN_REVISION -r 660 +- TIMEOUT 10 +- PATCH_COMMAND "${Subversion_SVN_EXECUTABLE}" patch "${CMAKE_BINARY_DIR}/gtest.patch" "${CMAKE_BINARY_DIR}/third_party/src/googletest" + # Force separate output paths for debug and release builds to allow easy + # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands + CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} +@@ -54,8 +27,6 @@ ExternalProject_Add( + # Disable install step + INSTALL_COMMAND "" + # Wrap download, configure and build steps in a script to log output +- LOG_DOWNLOAD 0 +- LOG_UPDATE 0 + LOG_CONFIGURE 0 + LOG_BUILD 0) + diff --git a/sci-libs/arrayfire/metadata.xml b/sci-libs/arrayfire/metadata.xml new file mode 100644 index 000000000..45fc55662 --- /dev/null +++ b/sci-libs/arrayfire/metadata.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <herd>sci</herd> + <maintainer> + <email>marbre@linux.sungazer.de</email> + <name>Marius Brehler</name> + </maintainer> + <use> + <flag name="cpu"> + Enable CPU Build. + </flag> + <flag name="cuda"> + Enable CUDA Build. + </flag> + </use> +</pkgmetadata> |