1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 SUPPORT_PYTHON_ABIS="1"
9 inherit cmake-utils eutils fdo-mime python versionator
10 DESCRIPTION="HOOMD performs general purpose molecular dynamics simulations on NVIDIA GPUs"
11 HOMEPAGE="http://codeblue.umich.edu/hoomd-blue/index.html"
12 SRC_URI="http://codeblue.umich.edu/hoomd-blue/downloads/0.9/${P}.tar.bz2
13 doc? ( http://codeblue.umich.edu/hoomd-blue/downloads/0.9/hoomd-userdoc-${PV}.pdf
14 http://codeblue.umich.edu/hoomd-blue/downloads/0.9/hoomd-devdoc-${PV}.tar.bz2 )"
18 KEYWORDS="~amd64 ~x86"
19 IUSE="+cuda debug doc +openmp +single-precision static-libs zlib"
21 RDEPEND="dev-libs/boost
22 cuda? ( >=dev-util/nvidia-cuda-toolkit-2.0 )
25 RESTRICT_PYTHON_ABIS="3.*"
31 if has_version '<=dev-util/nvidia-cuda-toolkit-3.0'; then
32 if version_is_at_least 4.4 $(gcc-version); then
33 ewarn "Nvidia CUDA SDK version 3.0 and below requires a gcc version less than 4.4"
34 ewarn "Enabling the cuda use flag with gcc version 4.4 or higher will cause build failures in those SDK versions."
35 ewarn "Please use gcc-config to set a gcc version less than 4.4 ."
38 elif has_version '<=dev-util/nvidia-cuda-toolkit-3.2'; then
39 if version_is_at_least 4.5 $(gcc-version); then
40 ewarn "Nvidia CUDA SDK Version 3.2 and below require a gcc version less than 4.5"
41 ewarn "Enabling the cuda use flag with gcc version 4.5 or higher will cause build failures in those SDK versions."
42 ewarn "Please use gcc-config to set a gcc version less than 4.5."
53 use single-precision && local sp="ON" || local sp="OFF"
55 if use !single-precision && use cuda ; then
56 ewarn "Single precision must be enabled to have cuda support built-in."
57 ewarn "Single-precision will be enabled for this build."
62 $(cmake-utils_use_enable cuda CUDA)
63 $(cmake-utils_use_enable static-libs STATIC)
64 $(cmake-utils_use_enable test BUILD_TESTING)
65 $(cmake-utils_use_enable openmp OPENMP)
66 $(cmake-utils_use_enable zlib ZLIB)
68 -DENABLE_NATIVE_INSTALL=0N
70 -DPYTHON_SITEDIR="$(python_get_sitedir)"
71 -DENABLE_SINGLE_PRECISION=${sp}
72 -DCMAKE_BUILD_TYPE=${cbt}
73 -DENABLE_OCELOT:BOOL=OFF
76 cmake-utils_src_configure
79 python_execute_function -s my_config
83 python_execute_function -s cmake-utils_src_test
88 insinto /usr/share/doc/${PF}
89 doins hoom-userdoc-${PV}.pdf || die "docs failed"
91 insinto /usr/share/doc/${PF}/devdocs
92 doins -r "${WORKDIR}/hoomd-devdoc-${PV}/" || die "docs failed"
95 python_execute_function -s cmake-utils_src_install
99 fdo-mime_desktop_database_update
100 fdo-mime_mime_database_update
104 fdo-mime_desktop_database_update
105 fdo-mime_mime_database_update