1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 SUPPORT_PYTHON_ABIS="1"
8 ESVN_REPO_URI=http://codeblue.umich.edu/hoomd-blue/svn/trunk
11 inherit cmake-utils eutils fdo-mime python subversion versionator
12 DESCRIPTION="HOOMD performs general purpose molecular dynamics simulations on NVIDIA GPUs"
13 HOMEPAGE="http://codeblue.umich.edu/hoomd-blue/index.html"
14 SRC_URI="doc? ( http://codeblue.umich.edu/hoomd-blue/downloads/0.9/hoomd-userdoc-${MY_DOC_PV}.pdf
15 http://codeblue.umich.edu/hoomd-blue/downloads/0.9/hoomd-devdoc-${MY_DOC_PV}.tar.bz2 )"
20 IUSE="+cuda debug doc +openmp +single-precision static-libs zlib"
22 RDEPEND="dev-libs/boost
23 cuda? ( >=dev-util/nvidia-cuda-toolkit-2.0 dev-util/nvidia-cuda-sdk )
26 RESTRICT_PYTHON_ABIS="3.*"
32 if has_version '<=dev-util/nvidia-cuda-toolkit-3.0'; then
33 if version_is_at_least 4.4 $(gcc-version); then
34 ewarn "Nvidia CUDA SDK version 3.0 and below requires a gcc version less than 4.4"
35 ewarn "Enabling the cuda use flag with gcc version 4.4 or higher will cause build failures in those SDK versions."
36 ewarn "Please use gcc-config to set a gcc version less than 4.4 ."
39 elif has_version '<=dev-util/nvidia-cuda-toolkit-3.2'; then
40 if version_is_at_least 4.5 $(gcc-version); then
41 ewarn "Nvidia CUDA SDK Version 3.2 and below require a gcc version less than 4.5"
42 ewarn "Enabling the cuda use flag with gcc version 4.5 or higher will cause build failures in those SDK versions."
43 ewarn "Please use gcc-config to set a gcc version less than 4.5."
54 use single-precision && local sp="ON" || local sp="OFF"
56 if use !single-precision && use cuda ; then
57 ewarn "Single precision must be enabled to have cuda support built-in."
58 ewarn "Single-precision will be enabled for this build."
63 $(cmake-utils_use_enable cuda CUDA)
64 $(cmake-utils_use_enable static-libs STATIC)
65 $(cmake-utils_use_enable test BUILD_TESTING)
66 $(cmake-utils_use_enable openmp OPENMP)
67 $(cmake-utils_use_enable zlib ZLIB)
69 -DENABLE_NATIVE_INSTALL=0N
71 -DPYTHON_SITEDIR="$(python_get_sitedir)"
72 -DENABLE_SINGLE_PRECISION=${sp}
73 -DCMAKE_BUILD_TYPE=${cbt}
74 -DENABLE_OCELOT:BOOL=OFF
77 cmake-utils_src_configure
80 python_execute_function -s my_config
84 python_execute_function -s cmake-utils_src_test
89 insinto /usr/share/doc/${PF}
90 newins "${DISTDIR}/hoomd-userdoc-${MY_DOC_PV}.pdf" hoom-userdoc-${PV}.pdf || die "docs failed"
92 insinto /usr/share/doc/${PF}/devdocs
93 mv "${WORKDIR}/hoomd-devdoc-${MY_DOC_PV}/" "${WORKDIR}/hoomd-devdoc-${PV}" || die
94 doins -r "${WORKDIR}/hoomd-devdoc-${PV}/" || die "docs failed"
97 python_execute_function -s cmake-utils_src_install
101 fdo-mime_desktop_database_update
102 fdo-mime_mime_database_update
106 fdo-mime_desktop_database_update
107 fdo-mime_mime_database_update