aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2019-12-01 12:07:27 +0800
committerBenda Xu <heroxbd@gentoo.org>2019-12-01 12:35:27 +0800
commit811bb613d2bf8a45e9dbbbb689308fdf04a3d390 (patch)
tree123f2d675c87016b628f1de0047d2675c4646c73 /sci-physics
parentdev-util/plog: initial commit 1.1.4_p20191110. (diff)
downloadsci-811bb613d2bf8a45e9dbbbb689308fdf04a3d390.tar.gz
sci-811bb613d2bf8a45e9dbbbb689308fdf04a3d390.tar.bz2
sci-811bb613d2bf8a45e9dbbbb689308fdf04a3d390.zip
sci-physics/opticks: initial commit of 0.0.1_p20191110.
Package-Manager: Portage-2.3.79, Repoman-2.3.18 Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-physics')
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_cuda-helper.patch13
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_extG4-CLHEP.patch20
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_nvcc-flags.patch12
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_okconf.patch45
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_python-helper.patch48
-rw-r--r--sci-physics/opticks/files/opticks-0.0.1_split-cmake.patch29
-rw-r--r--sci-physics/opticks/metadata.xml7
-rw-r--r--sci-physics/opticks/opticks-0.0.1_p20191110.ebuild98
8 files changed, 272 insertions, 0 deletions
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
new file mode 100644
index 000000000..8893fb279
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_cuda-helper.patch
@@ -0,0 +1,13 @@
+Index: opticks-0.0.1_p20191110/cmake/Modules/FindOpticksCUDA.cmake
+===================================================================
+--- opticks-0.0.1_p20191110.orig/cmake/Modules/FindOpticksCUDA.cmake
++++ opticks-0.0.1_p20191110/cmake/Modules/FindOpticksCUDA.cmake
+@@ -52,7 +52,7 @@ if(OpticksCUDA_FOUND)
+ HELPER_CUDA_INCLUDE_DIR
+ NAMES "helper_cuda.h"
+ PATHS
+- "${CUDA_TOOLKIT_ROOT_DIR}/samples/common/inc"
++ "${CUDA_TOOLKIT_ROOT_DIR}/sdk/common/inc"
+ "${CMAKE_CURRENT_LIST_DIR}/include/helper_cuda_fallback/${CUDA_VERSION}"
+ )
+ if(HELPER_CUDA_INCLUDE_DIR)
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
new file mode 100644
index 000000000..9df5373d4
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_extG4-CLHEP.patch
@@ -0,0 +1,20 @@
+Index: opticks-0.0.1_p20191110/extg4/CMakeLists.txt
+===================================================================
+--- opticks-0.0.1_p20191110.orig/extg4/CMakeLists.txt
++++ opticks-0.0.1_p20191110/extg4/CMakeLists.txt
+@@ -27,6 +27,7 @@ very focussed converter classes.
+
+ set(G4_VERBOSE ON)
+ find_package(G4 REQUIRED MODULE)
++find_package(CLHEP REQUIRED)
+ find_package(GGeo REQUIRED CONFIG)
+
+ # just for X4GDMLWrite
+@@ -143,6 +144,7 @@ set(HEADERS
+ add_library( ${name} SHARED ${SOURCES} ${HEADERS} )
+ target_link_libraries( ${name} PUBLIC
+ Opticks::G4
++ CLHEP
+ Opticks::GGeo
+ Opticks::OpticksXercesC
+ )
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
new file mode 100644
index 000000000..4360da18b
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_nvcc-flags.patch
@@ -0,0 +1,12 @@
+Index: opticks-0.0.1_p20191110/cmake/Modules/OpticksCUDAFlags.cmake
+===================================================================
+--- opticks-0.0.1_p20191110.orig/cmake/Modules/OpticksCUDAFlags.cmake
++++ opticks-0.0.1_p20191110/cmake/Modules/OpticksCUDAFlags.cmake
+@@ -18,6 +18,7 @@ if(NOT (COMPUTE_CAPABILITY LESS 30))
+ list(APPEND CUDA_NVCC_FLAGS "-O2")
+ #list(APPEND CUDA_NVCC_FLAGS "-DVERBOSE")
+ list(APPEND CUDA_NVCC_FLAGS "--use_fast_math")
++ list(APPEND CUDA_NVCC_FLAGS $ENV{NVCCFLAGS})
+
+ #list(APPEND CUDA_NVCC_FLAGS "-m64")
+ #list(APPEND CUDA_NVCC_FLAGS "--disable-warnings")
diff --git a/sci-physics/opticks/files/opticks-0.0.1_okconf.patch b/sci-physics/opticks/files/opticks-0.0.1_okconf.patch
new file mode 100644
index 000000000..58cedbf06
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_okconf.patch
@@ -0,0 +1,45 @@
+Index: opticks-0.0.1_p20191110/cmake/Modules/OpticksBuildOptions.cmake
+===================================================================
+--- opticks-0.0.1_p20191110.orig/cmake/Modules/OpticksBuildOptions.cmake
++++ opticks-0.0.1_p20191110/cmake/Modules/OpticksBuildOptions.cmake
+@@ -26,7 +26,7 @@ RPATH setup docs
+
+ #]=]
+
+-
++find_package(okconf REQUIRED CONFIG)
+ #message(STATUS "OpticksBuildOptions.cmake Configuring ${name}")
+ message(STATUS "Configuring ${name}")
+
+@@ -92,31 +92,6 @@ set(BUILD_SHARED_LIBS ON)
+ # to check the RPATH of a library or executable use chrpath on it, eg: chrpath $(which OKTest)
+ #
+
+-
+-if(UNIX AND NOT APPLE)
+- if(CMAKE_INSTALL_PREFIX STREQUAL ${OPTICKS_PREFIX})
+- set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib64:$ORIGIN/../externals/lib:$ORIGIN/../externals/lib64:$ORIGIN/../externals/OptiX/lib64")
+- else()
+- message(STATUS " Below two strings differ : forced to use absolute RPATH ")
+- message(STATUS " CMAKE_INSTALL_PREFIX : ${CMAKE_INSTALL_PREFIX} ")
+- message(STATUS " OPTICKS_PREFIX : ${OPTICKS_PREFIX} ")
+- set(ABSOLUTE_INSTALL_RPATH
+- ${OPTICKS_PREFIX}/lib64
+- ${OPTICKS_PREFIX}/externals/lib
+- ${OPTICKS_PREFIX}/externals/lib64
+- ${OPTICKS_PREFIX}/externals/OptiX/lib64
+- )
+- set(CMAKE_INSTALL_RPATH "${ABSOLUTE_INSTALL_RPATH}")
+- endif()
+-
+-elseif(APPLE)
+-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+-endif()
+-
+-
+-
+-
+-
+ include(OpticksCXXFlags)
+
+
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
new file mode 100644
index 000000000..255e0ee1a
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_python-helper.patch
@@ -0,0 +1,48 @@
+Index: opticks-0.0.1_p20191110/ana/base.py
+===================================================================
+--- opticks-0.0.1_p20191110.orig/ana/base.py
++++ opticks-0.0.1_p20191110/ana/base.py
+@@ -27,7 +27,7 @@ Mostly Non-numpy basics, just numpy conf
+ import numpy as np
+ import os, logging, json, ctypes, subprocess, datetime, re
+ from collections import OrderedDict as odict
+-from opticks.ana.enum import Enum
++from enum import Enum
+
+ log = logging.getLogger(__name__)
+
+Index: opticks-0.0.1_p20191110/ana/OpticksFlags.py
+===================================================================
+--- opticks-0.0.1_p20191110.orig/ana/OpticksFlags.py
++++ opticks-0.0.1_p20191110/ana/OpticksFlags.py
+@@ -7,7 +7,7 @@ Used from optickscore/CMakeLists.txt
+
+ """
+ import os, re, logging, argparse
+-from opticks.ana.base import json_save_
++from base import json_save_
+
+ log = logging.getLogger(__name__)
+
+Index: opticks-0.0.1_p20191110/optickscore/CMakeLists.txt
+===================================================================
+--- opticks-0.0.1_p20191110.orig/optickscore/CMakeLists.txt
++++ opticks-0.0.1_p20191110/optickscore/CMakeLists.txt
+@@ -153,7 +153,7 @@ add_custom_command(
+ OUTPUT
+ ${PYINI}
+ COMMAND
+- enum.py ${HDR} --quiet --inipath ${PYINI}
++ python2 ${CMAKE_CURRENT_SOURCE_DIR}/../ana/enum.py ${HDR} --quiet --inipath ${PYINI}
+ DEPENDS
+ ${HDR}
+ )
+@@ -167,7 +167,7 @@ add_custom_command(
+ OUTPUT
+ ${PYJS}
+ COMMAND
+- OpticksFlags.py ${CCFL} --quiet --jsonpath ${PYJS}
++ python2 ${CMAKE_CURRENT_SOURCE_DIR}/../ana/OpticksFlags.py ${CCFL} --quiet --jsonpath ${PYJS}
+ DEPENDS
+ ${CCFL}
+ )
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
new file mode 100644
index 000000000..213c6bd3b
--- /dev/null
+++ b/sci-physics/opticks/files/opticks-0.0.1_split-cmake.patch
@@ -0,0 +1,29 @@
+Index: opticks-0.0.1_p20191110/CMakeLists.txt
+===================================================================
+--- opticks-0.0.1_p20191110.orig/CMakeLists.txt
++++ opticks-0.0.1_p20191110/CMakeLists.txt
+@@ -56,12 +56,11 @@ project(${name} VERSION 0.1.0)
+ include(OpticksBuildOptions)
+
+ set(INTEGRATED_SUBDIRS
+- okconf
+ sysrap
+-#[=[
+ boostrap
+ npy
+ optickscore
++ yoctoglrap
+ ggeo
+ assimprap
+ openmeshrap
+@@ -73,9 +72,9 @@ set(INTEGRATED_SUBDIRS
+ oglrap
+ opticksgl
+ ok
++ extg4
+ cfg4
+ okg4
+-#]=]
+ )
+
+
diff --git a/sci-physics/opticks/metadata.xml b/sci-physics/opticks/metadata.xml
new file mode 100644
index 000000000..7203fb853
--- /dev/null
+++ b/sci-physics/opticks/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>heroxbd@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild b/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild
new file mode 100644
index 000000000..2553f571c
--- /dev/null
+++ b/sci-physics/opticks/opticks-0.0.1_p20191110.ebuild
@@ -0,0 +1,98 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 )
+inherit mercurial cmake-utils cuda flag-o-matic python-any-r1
+
+EHG_REPO_URI="https://bitbucket.org/simoncblyth/${PN}"
+EHG_REVISION="a580e704afe9d2c138072835e986542c835c29fc"
+
+DESCRIPTION="GPU Optical Photon Simulation for Particle Physics"
+HOMEPAGE="https://simoncblyth.bitbucket.io"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+RDEPEND="dev-util/nvidia-cuda-sdk
+ dev-libs/optix
+ media-gfx/openmesh
+ media-libs/DualContouringSample
+ media-libs/implicitmesher
+ media-libs/assimp
+ media-libs/glfw
+ media-libs/glew:0
+ media-libs/glm"
+DEPEND="dev-libs/boost
+ dev-util/bcm
+ dev-util/plog
+ ${PYTHON_DEPS}
+ ${RDEPEND}"
+PATCHES=( "${FILESDIR}"/opticks-0.0.1_split-cmake.patch
+ "${FILESDIR}"/opticks-0.0.1_okconf.patch
+ "${FILESDIR}"/opticks-0.0.1_cuda-helper.patch
+ "${FILESDIR}"/opticks-0.0.1_extG4-CLHEP.patch
+ "${FILESDIR}"/opticks-0.0.1_python-helper.patch )
+CMAKE_REMOVE_MODULES_LIST="${CMAKE_REMOVE_MODULES_LIST} FindBoost"
+
+pkg_setup() {
+ # opticks combined build is not parallel.
+ export MAKEOPTS="-j1"
+
+ python-any-r1_pkg_setup
+}
+
+src_prepare() {
+ cmake-utils_src_prepare
+
+ # do not add the default '-O2' that results in nvcc error of
+ # nvcc fatal : redefinition of argument 'optimize'
+ export NVCCFLAGS=
+ cuda_src_prepare
+
+ # do not install the tests
+ for f in $(find -path '*/tests/CMakeLists.txt'); do
+ ebegin "Removing installation phrase from ${f}"
+ sed '/install(TARGETS/d' -i ${f}
+ eend $?
+ done
+ # do not install test scripts
+ ebegin "Removing test scripts installation from optixrap/{,tests/}CMakeLists.txt"
+ sed -e '/install(PROGRAMS/d' \
+ -e '/installcache/d' \
+ -i optixrap/CMakeLists.txt \
+ -i optixrap/tests/CMakeLists.txt || die
+ eend $?
+ ebegin "Removing test scripts installation from ggeo/tests/CMakeLists.txt"
+ sed -e '/install(FILES/,/)/d' -i ggeo/tests/CMakeLists.txt
+ eend $?
+ ebegin "Moving glsl into share in oglrap/CMakeLists.txt"
+ sed -e "s,gl),share/${PN}/gl)," -i oglrap/CMakeLists.txt
+ eend $?
+
+ ebegin "Removing python bindings from sysrap/CMakeLists.txt"
+ sed -e "/py\/opticks\/sysrap/d" -i sysrap/CMakeLists.txt
+ eend $?
+
+ # integrated build OpticksBuildOptions is included at the top
+ for f in */CMakeLists.txt; do
+ ebegin "Removing OpticksBuildOptions include from ${f}"
+ sed '/OpticksBuildOptions/d' -i ${f}
+ eend $?
+ done
+}
+
+# om-make-one
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_MODULE_PATH="${S}"/cmake/Modules
+ -DOptiX_INSTALL_DIR="${EPREFIX}/opt/optix"
+ -DCUDA_SDK_ROOT_DIR="${EPREFIX}/opt/cuda/sdk"
+ -DCOMPUTE_CAPABILITY=61
+ -DCUDA_NVCC_FLAGS="${NVCCFLAGS}"
+ --target all
+ )
+ cmake-utils_src_configure
+}