Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-physics/opticks/, sci-physics/opticks/files/
Date: Sun, 01 Dec 2019 04:37:26
Message-Id: 1575174927.811bb613d2bf8a45e9dbbbb689308fdf04a3d390.heroxbd@gentoo
1 commit: 811bb613d2bf8a45e9dbbbb689308fdf04a3d390
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 1 04:07:27 2019 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 1 04:35:27 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=811bb613
7
8 sci-physics/opticks: initial commit of 0.0.1_p20191110.
9
10 Package-Manager: Portage-2.3.79, Repoman-2.3.18
11 Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
12
13 .../opticks/files/opticks-0.0.1_cuda-helper.patch | 13 +++
14 .../opticks/files/opticks-0.0.1_extG4-CLHEP.patch | 20 +++++
15 .../opticks/files/opticks-0.0.1_nvcc-flags.patch | 12 +++
16 .../opticks/files/opticks-0.0.1_okconf.patch | 45 ++++++++++
17 .../files/opticks-0.0.1_python-helper.patch | 48 +++++++++++
18 .../opticks/files/opticks-0.0.1_split-cmake.patch | 29 +++++++
19 sci-physics/opticks/metadata.xml | 7 ++
20 sci-physics/opticks/opticks-0.0.1_p20191110.ebuild | 98 ++++++++++++++++++++++
21 8 files changed, 272 insertions(+)
22
23 diff --git a/sci-physics/opticks/files/opticks-0.0.1_cuda-helper.patch b/sci-physics/opticks/files/opticks-0.0.1_cuda-helper.patch
24 new file mode 100644
25 index 000000000..8893fb279
26 --- /dev/null
27 +++ b/sci-physics/opticks/files/opticks-0.0.1_cuda-helper.patch
28 @@ -0,0 +1,13 @@
29 +Index: opticks-0.0.1_p20191110/cmake/Modules/FindOpticksCUDA.cmake
30 +===================================================================
31 +--- opticks-0.0.1_p20191110.orig/cmake/Modules/FindOpticksCUDA.cmake
32 ++++ opticks-0.0.1_p20191110/cmake/Modules/FindOpticksCUDA.cmake
33 +@@ -52,7 +52,7 @@ if(OpticksCUDA_FOUND)
34 + HELPER_CUDA_INCLUDE_DIR
35 + NAMES "helper_cuda.h"
36 + PATHS
37 +- "${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc"
38 ++ "${CUDA_TOOLKIT_ROOT_DIR}/sdk/common/inc"
39 + "${CMAKE_CURRENT_LIST_DIR}/include/helper_cuda_fallback/${CUDA_VERSION}"
40 + )
41 + if(HELPER_CUDA_INCLUDE_DIR)
42
43 diff --git a/sci-physics/opticks/files/opticks-0.0.1_extG4-CLHEP.patch b/sci-physics/opticks/files/opticks-0.0.1_extG4-CLHEP.patch
44 new file mode 100644
45 index 000000000..9df5373d4
46 --- /dev/null
47 +++ b/sci-physics/opticks/files/opticks-0.0.1_extG4-CLHEP.patch
48 @@ -0,0 +1,20 @@
49 +Index: opticks-0.0.1_p20191110/extg4/CMakeLists.txt
50 +===================================================================
51 +--- opticks-0.0.1_p20191110.orig/extg4/CMakeLists.txt
52 ++++ opticks-0.0.1_p20191110/extg4/CMakeLists.txt
53 +@@ -27,6 +27,7 @@ very focussed converter classes.
54 +
55 + set(G4_VERBOSE ON)
56 + find_package(G4 REQUIRED MODULE)
57 ++find_package(CLHEP REQUIRED)
58 + find_package(GGeo REQUIRED CONFIG)
59 +
60 + # just for X4GDMLWrite
61 +@@ -143,6 +144,7 @@ set(HEADERS
62 + add_library( ${name} SHARED ${SOURCES} ${HEADERS} )
63 + target_link_libraries( ${name} PUBLIC
64 + Opticks::G4
65 ++ CLHEP
66 + Opticks::GGeo
67 + Opticks::OpticksXercesC
68 + )
69
70 diff --git a/sci-physics/opticks/files/opticks-0.0.1_nvcc-flags.patch b/sci-physics/opticks/files/opticks-0.0.1_nvcc-flags.patch
71 new file mode 100644
72 index 000000000..4360da18b
73 --- /dev/null
74 +++ b/sci-physics/opticks/files/opticks-0.0.1_nvcc-flags.patch
75 @@ -0,0 +1,12 @@
76 +Index: opticks-0.0.1_p20191110/cmake/Modules/OpticksCUDAFlags.cmake
77 +===================================================================
78 +--- opticks-0.0.1_p20191110.orig/cmake/Modules/OpticksCUDAFlags.cmake
79 ++++ opticks-0.0.1_p20191110/cmake/Modules/OpticksCUDAFlags.cmake
80 +@@ -18,6 +18,7 @@ if(NOT (COMPUTE_CAPABILITY LESS 30))
81 + list(APPEND CUDA_NVCC_FLAGS "-O2")
82 + #list(APPEND CUDA_NVCC_FLAGS "-DVERBOSE")
83 + list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
84 ++ list(APPEND CUDA_NVCC_FLAGS $ENV{NVCCFLAGS})
85 +
86 + #list(APPEND CUDA_NVCC_FLAGS "-m64")
87 + #list(APPEND CUDA_NVCC_FLAGS "--disable-warnings")
88
89 diff --git a/sci-physics/opticks/files/opticks-0.0.1_okconf.patch b/sci-physics/opticks/files/opticks-0.0.1_okconf.patch
90 new file mode 100644
91 index 000000000..58cedbf06
92 --- /dev/null
93 +++ b/sci-physics/opticks/files/opticks-0.0.1_okconf.patch
94 @@ -0,0 +1,45 @@
95 +Index: opticks-0.0.1_p20191110/cmake/Modules/OpticksBuildOptions.cmake
96 +===================================================================
97 +--- opticks-0.0.1_p20191110.orig/cmake/Modules/OpticksBuildOptions.cmake
98 ++++ opticks-0.0.1_p20191110/cmake/Modules/OpticksBuildOptions.cmake
99 +@@ -26,7 +26,7 @@ RPATH setup docs
100 +
101 + #]=]
102 +
103 +-
104 ++find_package(okconf REQUIRED CONFIG)
105 + #message(STATUS "OpticksBuildOptions.cmake Configuring ${name}")
106 + message(STATUS "Configuring ${name}")
107 +
108 +@@ -92,31 +92,6 @@ set(BUILD_SHARED_LIBS ON)
109 + # to check the RPATH of a library or executable use chrpath on it, eg: chrpath $(which OKTest)
110 + #
111 +
112 +-
113 +-if(UNIX AND NOT APPLE)
114 +- if(CMAKE_INSTALL_PREFIX STREQUAL ${OPTICKS_PREFIX})
115 +- set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib64:$ORIGIN/../externals/lib:$ORIGIN/../externals/lib64:$ORIGIN/../externals/OptiX/lib64")
116 +- else()
117 +- message(STATUS " Below two strings differ : forced to use absolute RPATH ")
118 +- message(STATUS " CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX} ")
119 +- message(STATUS " OPTICKS_PREFIX : ${OPTICKS_PREFIX} ")
120 +- set(ABSOLUTE_INSTALL_RPATH
121 +- ${OPTICKS_PREFIX}/lib64
122 +- ${OPTICKS_PREFIX}/externals/lib
123 +- ${OPTICKS_PREFIX}/externals/lib64
124 +- ${OPTICKS_PREFIX}/externals/OptiX/lib64
125 +- )
126 +- set(CMAKE_INSTALL_RPATH "${ABSOLUTE_INSTALL_RPATH}")
127 +- endif()
128 +-
129 +-elseif(APPLE)
130 +-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
131 +-endif()
132 +-
133 +-
134 +-
135 +-
136 +-
137 + include(OpticksCXXFlags)
138 +
139 +
140
141 diff --git a/sci-physics/opticks/files/opticks-0.0.1_python-helper.patch b/sci-physics/opticks/files/opticks-0.0.1_python-helper.patch
142 new file mode 100644
143 index 000000000..255e0ee1a
144 --- /dev/null
145 +++ b/sci-physics/opticks/files/opticks-0.0.1_python-helper.patch
146 @@ -0,0 +1,48 @@
147 +Index: opticks-0.0.1_p20191110/ana/base.py
148 +===================================================================
149 +--- opticks-0.0.1_p20191110.orig/ana/base.py
150 ++++ opticks-0.0.1_p20191110/ana/base.py
151 +@@ -27,7 +27,7 @@ Mostly Non-numpy basics, just numpy conf
152 + import numpy as np
153 + import os, logging, json, ctypes, subprocess, datetime, re
154 + from collections import OrderedDict as odict
155 +-from opticks.ana.enum import Enum
156 ++from enum import Enum
157 +
158 + log = logging.getLogger(__name__)
159 +
160 +Index: opticks-0.0.1_p20191110/ana/OpticksFlags.py
161 +===================================================================
162 +--- opticks-0.0.1_p20191110.orig/ana/OpticksFlags.py
163 ++++ opticks-0.0.1_p20191110/ana/OpticksFlags.py
164 +@@ -7,7 +7,7 @@ Used from optickscore/CMakeLists.txt
165 +
166 + """
167 + import os, re, logging, argparse
168 +-from opticks.ana.base import json_save_
169 ++from base import json_save_
170 +
171 + log = logging.getLogger(__name__)
172 +
173 +Index: opticks-0.0.1_p20191110/optickscore/CMakeLists.txt
174 +===================================================================
175 +--- opticks-0.0.1_p20191110.orig/optickscore/CMakeLists.txt
176 ++++ opticks-0.0.1_p20191110/optickscore/CMakeLists.txt
177 +@@ -153,7 +153,7 @@ add_custom_command(
178 + OUTPUT
179 + ${PYINI}
180 + COMMAND
181 +- enum.py ${HDR} --quiet --inipath ${PYINI}
182 ++ python2 ${CMAKE_CURRENT_SOURCE_DIR}/../ana/enum.py ${HDR} --quiet --inipath ${PYINI}
183 + DEPENDS
184 + ${HDR}
185 + )
186 +@@ -167,7 +167,7 @@ add_custom_command(
187 + OUTPUT
188 + ${PYJS}
189 + COMMAND
190 +- OpticksFlags.py ${CCFL} --quiet --jsonpath ${PYJS}
191 ++ python2 ${CMAKE_CURRENT_SOURCE_DIR}/../ana/OpticksFlags.py ${CCFL} --quiet --jsonpath ${PYJS}
192 + DEPENDS
193 + ${CCFL}
194 + )
195
196 diff --git a/sci-physics/opticks/files/opticks-0.0.1_split-cmake.patch b/sci-physics/opticks/files/opticks-0.0.1_split-cmake.patch
197 new file mode 100644
198 index 000000000..213c6bd3b
199 --- /dev/null
200 +++ b/sci-physics/opticks/files/opticks-0.0.1_split-cmake.patch
201 @@ -0,0 +1,29 @@
202 +Index: opticks-0.0.1_p20191110/CMakeLists.txt
203 +===================================================================
204 +--- opticks-0.0.1_p20191110.orig/CMakeLists.txt
205 ++++ opticks-0.0.1_p20191110/CMakeLists.txt
206 +@@ -56,12 +56,11 @@ project(${name} VERSION 0.1.0)
207 + include(OpticksBuildOptions)
208 +
209 + set(INTEGRATED_SUBDIRS
210 +- okconf
211 + sysrap
212 +-#[=[
213 + boostrap
214 + npy
215 + optickscore
216 ++ yoctoglrap
217 + ggeo
218 + assimprap
219 + openmeshrap
220 +@@ -73,9 +72,9 @@ set(INTEGRATED_SUBDIRS
221 + oglrap
222 + opticksgl
223 + ok
224 ++ extg4
225 + cfg4
226 + okg4
227 +-#]=]
228 + )
229 +
230 +
231
232 diff --git a/sci-physics/opticks/metadata.xml b/sci-physics/opticks/metadata.xml
233 new file mode 100644
234 index 000000000..7203fb853
235 --- /dev/null
236 +++ b/sci-physics/opticks/metadata.xml
237 @@ -0,0 +1,7 @@
238 +<?xml version="1.0" encoding="UTF-8"?>
239 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
240 +<pkgmetadata>
241 + <maintainer type="person">
242 + <email>heroxbd@g.o</email>
243 + </maintainer>
244 +</pkgmetadata>
245
246 diff --git a/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild b/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild
247 new file mode 100644
248 index 000000000..2553f571c
249 --- /dev/null
250 +++ b/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild
251 @@ -0,0 +1,98 @@
252 +# Copyright 1999-2019 Gentoo Authors
253 +# Distributed under the terms of the GNU General Public License v2
254 +
255 +EAPI=7
256 +
257 +PYTHON_COMPAT=( python2_7 )
258 +inherit mercurial cmake-utils cuda flag-o-matic python-any-r1
259 +
260 +EHG_REPO_URI="https://bitbucket.org/simoncblyth/${PN}"
261 +EHG_REVISION="a580e704afe9d2c138072835e986542c835c29fc"
262 +
263 +DESCRIPTION="GPU Optical Photon Simulation for Particle Physics"
264 +HOMEPAGE="https://simoncblyth.bitbucket.io"
265 +
266 +LICENSE="Apache-2.0"
267 +SLOT="0"
268 +KEYWORDS="~amd64"
269 +
270 +RDEPEND="dev-util/nvidia-cuda-sdk
271 + dev-libs/optix
272 + media-gfx/openmesh
273 + media-libs/DualContouringSample
274 + media-libs/implicitmesher
275 + media-libs/assimp
276 + media-libs/glfw
277 + media-libs/glew:0
278 + media-libs/glm"
279 +DEPEND="dev-libs/boost
280 + dev-util/bcm
281 + dev-util/plog
282 + ${PYTHON_DEPS}
283 + ${RDEPEND}"
284 +PATCHES=( "${FILESDIR}"/opticks-0.0.1_split-cmake.patch
285 + "${FILESDIR}"/opticks-0.0.1_okconf.patch
286 + "${FILESDIR}"/opticks-0.0.1_cuda-helper.patch
287 + "${FILESDIR}"/opticks-0.0.1_extG4-CLHEP.patch
288 + "${FILESDIR}"/opticks-0.0.1_python-helper.patch )
289 +CMAKE_REMOVE_MODULES_LIST="${CMAKE_REMOVE_MODULES_LIST} FindBoost"
290 +
291 +pkg_setup() {
292 + # opticks combined build is not parallel.
293 + export MAKEOPTS="-j1"
294 +
295 + python-any-r1_pkg_setup
296 +}
297 +
298 +src_prepare() {
299 + cmake-utils_src_prepare
300 +
301 + # do not add the default '-O2' that results in nvcc error of
302 + # nvcc fatal : redefinition of argument 'optimize'
303 + export NVCCFLAGS=
304 + cuda_src_prepare
305 +
306 + # do not install the tests
307 + for f in $(find -path '*/tests/CMakeLists.txt'); do
308 + ebegin "Removing installation phrase from ${f}"
309 + sed '/install(TARGETS/d' -i ${f}
310 + eend $?
311 + done
312 + # do not install test scripts
313 + ebegin "Removing test scripts installation from optixrap/{,tests/}CMakeLists.txt"
314 + sed -e '/install(PROGRAMS/d' \
315 + -e '/installcache/d' \
316 + -i optixrap/CMakeLists.txt \
317 + -i optixrap/tests/CMakeLists.txt || die
318 + eend $?
319 + ebegin "Removing test scripts installation from ggeo/tests/CMakeLists.txt"
320 + sed -e '/install(FILES/,/)/d' -i ggeo/tests/CMakeLists.txt
321 + eend $?
322 + ebegin "Moving glsl into share in oglrap/CMakeLists.txt"
323 + sed -e "s,gl),share/${PN}/gl)," -i oglrap/CMakeLists.txt
324 + eend $?
325 +
326 + ebegin "Removing python bindings from sysrap/CMakeLists.txt"
327 + sed -e "/py\/opticks\/sysrap/d" -i sysrap/CMakeLists.txt
328 + eend $?
329 +
330 + # integrated build OpticksBuildOptions is included at the top
331 + for f in */CMakeLists.txt; do
332 + ebegin "Removing OpticksBuildOptions include from ${f}"
333 + sed '/OpticksBuildOptions/d' -i ${f}
334 + eend $?
335 + done
336 +}
337 +
338 +# om-make-one
339 +src_configure() {
340 + local mycmakeargs=(
341 + -DCMAKE_MODULE_PATH="${S}"/cmake/Modules
342 + -DOptiX_INSTALL_DIR="${EPREFIX}/opt/optix"
343 + -DCUDA_SDK_ROOT_DIR="${EPREFIX}/opt/cuda/sdk"
344 + -DCOMPUTE_CAPABILITY=61
345 + -DCUDA_NVCC_FLAGS="${NVCCFLAGS}"
346 + --target all
347 + )
348 + cmake-utils_src_configure
349 +}