summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorJavier <javiercvilla@gmail.com>2017-02-21 02:33:32 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2017-02-20 17:33:32 -0800
commitfbbcf456e9f8e14509ac0adc62ba0c8711018b5e (patch)
tree3d19a3161327c28f9e8651c0e50a115c886fc272 /var
parent5b6d2754d933f2ca2f728be492c230ee1ee4f219 (diff)
downloadspack-fbbcf456e9f8e14509ac0adc62ba0c8711018b5e.tar.gz
spack-fbbcf456e9f8e14509ac0adc62ba0c8711018b5e.tar.bz2
spack-fbbcf456e9f8e14509ac0adc62ba0c8711018b5e.tar.xz
spack-fbbcf456e9f8e14509ac0adc62ba0c8711018b5e.zip
Updating package: geant4 (#3197)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/geant4/package.py81
-rw-r--r--var/spack/repos/builtin/packages/vecgeom/package.py63
2 files changed, 113 insertions, 31 deletions
diff --git a/var/spack/repos/builtin/packages/geant4/package.py b/var/spack/repos/builtin/packages/geant4/package.py
index 239ef6d586..c940c254bc 100644
--- a/var/spack/repos/builtin/packages/geant4/package.py
+++ b/var/spack/repos/builtin/packages/geant4/package.py
@@ -24,62 +24,81 @@
##############################################################################
from spack import *
+import platform
-class Geant4(Package):
+class Geant4(CMakePackage):
"""Geant4 is a toolkit for the simulation of the passage of particles
through matter. Its areas of application include high energy, nuclear
and accelerator physics, as well as studies in medical and space
science."""
homepage = "http://geant4.cern.ch/"
- url = "http://geant4.cern.ch/support/source/geant4.10.01.p03.tar.gz"
+ url = "http://geant4.cern.ch/support/source/geant4.10.01.p03.tar.gz"
+ version('10.02.p02', '6aae1d0fc743b0edc358c5c8fbe48657')
version('10.02.p01', 'b81f7082a15f6a34b720b6f15c6289cfe4ddbbbdcef0dc52719f71fac95f7f1c')
version('10.01.p03', '4fb4175cc0dabcd517443fbdccd97439')
- variant('qt', default=False, description='Enable Qt support')
+ variant('qt', default=True, description='Enable Qt support')
+ variant('debug', default=False, description='Build debug version')
depends_on('cmake@3.5:', type='build')
+ depends_on("clhep@2.3.1.1~cxx11+cxx14", when="@10.02.p02")
depends_on("clhep@2.3.1.1~cxx11+cxx14", when="@10.02.p01")
depends_on("clhep@2.2.0.4~cxx11+cxx14", when="@10.01.p03")
depends_on("expat")
depends_on("zlib")
+ depends_on("vecgeom")
depends_on("xerces-c")
depends_on("qt@4.8:", when="+qt")
- def install(self, spec, prefix):
- cmake_args = list(std_cmake_args)
- cmake_args.append('-DXERCESC_ROOT_DIR:STRING=%s' %
- spec['xerces-c'].prefix)
- cmake_args.append('-DGEANT4_BUILD_CXXSTD=c++14')
-
- cmake_args += ['-DGEANT4_USE_GDML=ON',
- '-DGEANT4_USE_SYSTEM_EXPAT=ON',
- '-DGEANT4_USE_SYSTEM_ZLIB=ON',
- '-DGEANT4_USE_SYSTEM_CLHEP=ON']
-
- # fixme: turn off data for now and maybe each data set should
- # go into a separate package to cut down on disk usage between
- # different code versions using the same data versions.
- cmake_args.append('-DGEANT4_INSTALL_DATA=OFF')
-
- # http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch02s03.html
- # fixme: likely things that need addressing:
- # -DGEANT4_USE_OPENGL_X11=ON
+ def build_type(self):
+ spec = self.spec
+ if '+debug' in spec:
+ return 'Debug'
+ else:
+ return 'Release'
+
+ def cmake_args(self):
+ spec = self.spec
+
+ options = [
+ '-DGEANT4_USE_GDML=ON',
+ '-DGEANT4_USE_SYSTEM_CLHEP=ON',
+ '-DGEANT4_USE_G3TOG4=ON',
+ '-DGEANT4_INSTALL_DATA=ON',
+ '-DGEANT4_BUILD_TLS_MODEL=global-dynamic',
+ '-DGEANT4_BUILD_MULTITHREADED=ON',
+ '-DGEANT4_USE_USOLIDS=ON',
+ '-DGEANT4_USE_SYSTEM_EXPAT=ON',
+ '-DGEANT4_USE_SYSTEM_ZLIB=ON',
+ '-DXERCESC_ROOT_DIR:STRING=%s' %
+ spec['xerces-c'].prefix,
+ '-DUSolids_DIR=%s' %
+ join_path(spec['vecgeom'].prefix, 'lib/CMake/USolids')]
+
+ arch = platform.system().lower()
+ if arch is not 'darwin':
+ options.append('-DGEANT4_USE_OPENGL_X11=ON')
+ options.append('-DGEANT4_USE_XM=ON')
+ options.append('-DGEANT4_USE_RAYTRACER_X11=ON')
+
+ if '+cxx11' in spec:
+ options.append('-DGEANT4_BUILD_CXXSTD=c++11')
+ if '+cxx14' or '+cxx1y' in spec:
+ options.append('-DGEANT4_BUILD_CXXSTD=c++14')
if '+qt' in spec:
- cmake_args.append('-DGEANT4_USE_QT=ON')
-
- build_directory = join_path(self.stage.path, 'spack-build')
- source_directory = self.stage.source_path
+ options.append('-DGEANT4_USE_QT=ON')
+ options.append(
+ '-DQT_QMAKE_EXECUTABLE=%s' %
+ spec['qt'].prefix + '/bin/qmake'
+ )
- with working_dir(build_directory, create=True):
- cmake(source_directory, *cmake_args)
- make()
- make("install")
+ return options
def url_for_version(self, version):
"""Handle Geant4's unusual version string."""
- return "http://geant4.cern.ch/support/source/geant4.%s.tar.gz" % version
+ return ("http://geant4.cern.ch/support/source/geant4.%s.tar.gz" % version)
diff --git a/var/spack/repos/builtin/packages/vecgeom/package.py b/var/spack/repos/builtin/packages/vecgeom/package.py
new file mode 100644
index 0000000000..988542e4d4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/vecgeom/package.py
@@ -0,0 +1,63 @@
+##############################################################################
+# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
+# Produced at the Lawrence Livermore National Laboratory.
+#
+# This file is part of Spack.
+# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
+# LLNL-CODE-647188
+#
+# For details, see https://github.com/llnl/spack
+# Please also see the LICENSE file for our notice and the LGPL.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License (as
+# published by the Free Software Foundation) version 2.1, February 1999.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and
+# conditions of the GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##############################################################################
+
+from spack import *
+import platform
+
+
+class Vecgeom(CMakePackage):
+ """The vectorized geometry library for particle-detector simulation
+ (toolkits)."""
+
+ homepage = "https://gitlab.cern.ch/VecGeom/VecGeom"
+
+ version('0.3.rc', git='https://gitlab.cern.ch/VecGeom/VecGeom.git',
+ tag='v0.3.rc')
+
+ variant('debug', default=False, description='Build debug version')
+
+ depends_on('cmake@3.5:', type='build')
+
+ def build_type(self):
+ spec = self.spec
+ if '+debug' in spec:
+ return 'Debug'
+ else:
+ return 'Release'
+
+ def cmake_args(self):
+ options = [
+ '-DBACKEND=Scalar',
+ '-DGEANT4=OFF',
+ '-DUSOLIDS=ON',
+ '-DUSOLIDS_VECGEOM=ON'
+ ]
+
+ arch = platform.machine()
+ if arch == 'x86_64':
+ options.append('-DVECGEOM_VECTOR=sse4.2')
+ else:
+ options.append('-DVECGEOM_VECTOR=' + arch)
+ return options