Skip to content
Snippets Groups Projects
Commit 102bb4ad authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Add back spack directory

parent c7567c30
Branches
Tags
1 merge request!16New feature version
Showing
with 856 additions and 0 deletions
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version
# control.
# However, in case of collaboration, if having platform-specific dependencies or
# dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or
# not
# install all needed dependencies.
#Pipfile.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# Custom Spack Repository
Extra spack repository with EIC-related packages and overrides.
## How to load this repository
To load the repository, clone and then load with spack:
```bash
spack clone https://eicweb.phy.anl.gov/containers/eic_container.git
spack repo add eic_contaienr/spack
```
Then use spack as you normally would.
## Packages
* New packages
- `dawn`: A tool to visualize detector geometries.
- `dawncut`: A tool to edit detector visualizations.
* Package overrides
* `dd4hep`: Disabled use of the Ninja backend for cmake as it was running into dependency issues building assymp
* `fmt`: Modified compiler flags to build shared library version.
* `geant4`: Added explicit glu dependency for OpenGL
* `graphviz`: Set upper version limit to stop applying implicit.patch to the newest version
* `qt`: Added gcc10.patch to fix issues compiling QT with gcc10
* `root`: Re-enabled http module as this builds fine on modern Linux systems and we use this heavily.
diff --git a/DAWN_GUI_menu.header2 b/DAWN_GUI_menu.header2
index ef35492..7fa067b 100644
--- a/DAWN_GUI_menu.header2
+++ b/DAWN_GUI_menu.header2
@@ -1 +1 @@
-exec wish "$0" "$@"
+exec wish "$0" ${1+"$@"}
diff --git a/Makefile b/Makefile
index 96e42e7..c9bb589 100644
--- a/Makefile
+++ b/Makefile
@@ -267,6 +267,7 @@ clean:
### install
install:
+ mkdir -p $(INSTALL_DIR)
cp -p ./$(EXEC) $(INSTALL_DIR)/$(EXEC)
cp -p ./$(GUI_MENU) $(INSTALL_DIR)/$(GUI_MENU)
cp -p ./$(EXEC)unixd $(INSTALL_DIR)/$(EXEC)unixd
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Dawn(MakefilePackage):
""" Fukui Renderer DAWN (Drawer for Academic WritiNgs)
is a renderer, which reads 3D geometrical data and visualize them.
It is a vectorized 3D PostScript processor with analytical
hidden line/surface removal.
It aims at precise technical drawing of complex geometries.
It performs geometrical hidden line/surface removal and calculates
out all visible parts of the 3D data before drawing. This drawing
algorithm realizes device-independent technical high quality of
vectorized graphics.
3D Data files should be generated by a modeler or by hands
separately. If you use DAWN as a visualizer of,
say, a simulator of physical experiments,
the simulator application itself is recognized as a modeler.
An important feature of DAWN is that
it has been developed to visualize 3D data generated by
a high-energy experimental detector simulator "GEANT4"
( http://geant4.web.cern.ch/geant4 , http://geant4.kek.jp ).
Note: we set 'gv' as default pdf/ps viewer, assuming this is
installed on your system.
"""
homepage = "https://geant4.kek.jp/~tanaka"
url = "http://geant4.kek.jp/~tanaka/src/dawn_3_91a.tgz"
maintainers = ['sly2j']
version('3_91a', sha256='81d855ead1117681b188242dd0be3a24e005d9bd4063fd2bda9a7a794ebcf5f4')
depends_on('tcl')
depends_on('tk')
## Patch to ensure wish is called correctly
patch('exec.patch')
patch('install.patch')
def edit(self, spec, prefix):
makefile = FileFilter("Makefile")
makefile.filter('CC= .*', 'CC = ' + env['CC'])
makefile.filter('CXX = .*', 'CXX = ' + env['CXX'])
makefile.filter('INSTALL_DIR = .*', 'INSTALL_DIR = {}/bin'.format(prefix))
os.environ['DAWN_PS_PREVIEWER'] = 'gv'
diff --git a/Makefile b/Makefile
index 1dda775..e8a567f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
include ./Makefile.architecture
TARGET = dawncut
+INSTALL_DIR ?= /usr/local/bin
SRC_DIR = src
@@ -44,3 +45,7 @@ clean :
$(RM) $(TARGET) core
$(RM) *~ \#*
+### install
+install:
+ mkdir -p $(INSTALL_DIR)
+ cp -p ./$(TARGET) $(INSTALL_DIR)/$(TARGET)
# Copyright 203-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
class Dawncut(MakefilePackage):
"""DAWNCUT is a tool to generate a 3D scene data clipped with an arbitrary plane.
It reads a source DAWN-format file and outputs a new DAWN-format data,
describing a plane-clipped 3D scene. The output DAWN-format data can be
visualized with Fukui Renderer DAWN.
"""
homepage = "https://geant4.kek.jp/~tanaka"
url = "http://10.10.241.20/software/dawncut_1_54a.tar.gz"
maintainers = ['sly2j']
version('1_54a',
sha256='17d7ccd2ff863e2f3700cc3e751cfca37a1425abfa0edc3b8f6497d8746ddcf4')
# FIXME: Add dependencies if required.
# depends_on('foo')
## Patch to add install directive to Makefile
patch('install.patch')
def edit(self, spec, prefix):
makefile = FileFilter("Makefile")
makefile.filter('CC= .*', 'CC = ' + env['CC'])
makefile.filter('CXX = .*', 'CXX = ' + env['CXX'])
os.environ['INSTALL_DIR'] = '{}/bin'.format(prefix)
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Dd4hep(CMakePackage):
"""DD4hep is a software framework for providing a complete solution for
full detector description (geometry, materials, visualization, readout,
alignment, calibration, etc.) for the full experiment life cycle
(detector concept development, detector optimization, construction,
operation). It offers a consistent description through a single source
of detector information for simulation, reconstruction, analysis, etc.
It distributed under the LGPLv3 License."""
homepage = "https://dd4hep.web.cern.ch/dd4hep/"
url = "https://github.com/AIDASoft/DD4hep/archive/v01-12-01.tar.gz"
git = "https://github.com/AIDASoft/DD4hep.git"
maintainers = ['vvolkl', 'drbenmorgan']
version('master', branch='master')
version('1.14.1', sha256='5b5742f1e23c2b36d3174cca95f810ce909c0eb66f3d6d7acb0ba657819e6717')
version('1.14.0', sha256='b603aa3c0db8dda392253aa71fa4a0f0c3c9715d47df0b895d45c1e8849f4895')
version('1.13.1', sha256='83fa70cd74ce93b2f52f098388dff58d179f05ace5b50aea3f408bb8abf7cb73')
version('1.13.0', sha256='0b1f9d902ebe21a9178c1e41204c066b29f68c8836fd1d03a9ce979811ddb295')
version('1.12.1', sha256='85e8c775ec03c499ce10911e228342e757c81ce9ef2a9195cb253b85175a2e93')
version('1.12.0', sha256='133a1fb8ce0466d2482f3ebb03e60b3bebb9b2d3e33d14ba15c8fbb91706b398')
version('1.11.2', sha256='96a53dd26cb8df11c6dae54669fbc9cc3c90dd47c67e07b24be9a1341c95abc4')
version('1.11.1', sha256='d7902dd7f6744bbda92f6e303ad5a3410eec4a0d2195cdc86f6c1167e72893f0')
version('1.11.0', sha256='25643296f15f9d11ad4ad550b7c3b92e8974fc56f1ee8e4455501010789ae7b6')
version('1.10.0', sha256='1d6b5d1c368dc8bcedd9c61b7c7e1a44bad427f8bd34932516aff47c88a31d95')
# Workarounds for various TBB issues in DD4hep v1.11
# See https://github.com/AIDASoft/DD4hep/pull/613 .
patch('tbb-workarounds.patch', when='@1.11.0')
patch('tbb2.patch', when='@1.12.1')
variant('xercesc', default=False, description="Enable 'Detector Builders' based on XercesC")
variant('geant4', default=False, description="Enable the simulation part based on Geant4")
variant('assimp', default=False, description="Enable CAD interface based on Assimp")
variant('hepmc3', default=False, description="Enable build with hepmc3")
variant('lcio', default=False, description="Enable build with lcio")
variant('debug', default=False, description="Enable debug build")
depends_on('cmake @3.12:', type='build')
depends_on('boost @1.49:')
depends_on('root @6.08: +gdml +math +opengl +python +x')
extends('python')
depends_on('xerces-c', when='+xercesc')
depends_on('geant4@10.2.2:', when='+geant4')
depends_on('assimp', when='+assimp')
depends_on('hepmc3', when="+hepmc3")
depends_on('lcio', when="+lcio")
def cmake_args(self):
spec = self.spec
cxxstd = spec['root'].variants['cxxstd'].value
# root can be built with cxxstd=11, but dd4hep requires 14
if cxxstd == "11":
cxxstd = "14"
args = [
"-DCMAKE_CXX_STANDARD={0}".format(cxxstd),
"-DDD4HEP_USE_XERCESC={0}".format(spec.satisfies('+xercesc')),
"-DDD4HEP_USE_GEANT4={0}".format(spec.satisfies('+geant4')),
"-DDD4HEP_USE_LCIO={0}".format(spec.satisfies('+lcio')),
"-DDD4HEP_LOAD_ASSIMP={0}".format(spec.satisfies('+assimp')),
"-DDD4HEP_USE_HEPMC3={0}".format(spec.satisfies('+hepmc3')),
"-DDD4HEP_BUILD_DEBUG={0}".format(spec.satisfies('+debug')),
"-DBUILD_TESTING={0}".format(self.run_tests),
"-DBOOST_ROOT={0}".format(spec['boost'].prefix),
"-DBoost_NO_BOOST_CMAKE=ON",
"-DPYTHON_EXECUTABLE={0}".format(spec['python'].command.path),
]
return args
def setup_run_environment(self, env):
# used p.ex. in ddsim to find DDDetectors dir
env.set("DD4hepINSTALL", self.prefix)
env.set("DD4hep_DIR", self.prefix)
env.set("DD4hep_ROOT", self.prefix)
def url_for_version(self, version):
# dd4hep releases are dashes and padded with a leading zero
# the patch version is omitted when 0
# so for example v01-12-01, v01-12 ...
major = (str(version[0]).zfill(2))
minor = (str(version[1]).zfill(2))
patch = (str(version[2]).zfill(2))
if version[2] == 0:
url = "https://github.com/AIDASoft/DD4hep/archive/v%s-%s.tar.gz" % (major, minor)
else:
url = "https://github.com/AIDASoft/DD4hep/archive/v%s-%s-%s.tar.gz" % (major, minor, patch)
return url
diff --git a/DDDigi/CMakeLists.txt b/DDDigi/CMakeLists.txt
index e6fb1096..88eb5c92 100644
--- a/DDDigi/CMakeLists.txt
+++ b/DDDigi/CMakeLists.txt
@@ -34,12 +34,10 @@ target_include_directories(DDDigi
FIND_PACKAGE(TBB QUIET)
if(TBB_FOUND)
- dd4hep_print( "|++> TBB_INCLUDE_DIR --> ${TBB_INCLUDE_DIR}")
- dd4hep_print( "|++> TBB_LIBRARY --> ${TBB_LIBRARY}")
+ dd4hep_print( "|++> TBB_IMPORTED_TARGETS --> ${TBB_IMPORTED_TARGETS}")
dd4hep_print( "|++> TBB found. DDDigi will run multi threaded.")
target_compile_definitions(DDDigi PUBLIC DD4HEP_USE_TBB)
- target_link_libraries(DDDigi ${TBB_LIBRARY})
- target_include_directories(DDDigi ${TBB_INCLUDE_DIRS})
+ target_link_libraries(DDDigi PUBLIC ${TBB_IMPORTED_TARGETS})
else()
dd4hep_print( "|++> TBB not found. DDDigi will only work single threaded.")
endif()
diff --git a/DDDigi/src/DigiKernel.cpp b/DDDigi/src/DigiKernel.cpp
index d62c6694..f2c2e86c 100644
--- a/DDDigi/src/DigiKernel.cpp
+++ b/DDDigi/src/DigiKernel.cpp
@@ -91,7 +91,7 @@ public:
DigiEventAction* action = 0;
Wrapper(DigiContext& c, DigiEventAction* a)
: context(c), action(a) {}
- Wrapper(Wrapper&& copy) = delete;
+ Wrapper(Wrapper&& copy) = default;
Wrapper(const Wrapper& copy) = default;
Wrapper& operator=(Wrapper&& copy) = delete;
Wrapper& operator=(const Wrapper& copy) = delete;
@@ -111,7 +111,7 @@ class DigiKernel::Processor {
DigiKernel& kernel;
public:
Processor(DigiKernel& k) : kernel(k) {}
- Processor(Processor&& l) = delete;
+ Processor(Processor&& l) = default;
Processor(const Processor& l) = default;
void operator()() const {
int todo = 1;
diff --git a/DDDigi/src/DigiKernel.cpp b/DDDigi/src/DigiKernel.cpp
index f2c2e86c..f168ef9b 100644
--- a/DDDigi/src/DigiKernel.cpp
+++ b/DDDigi/src/DigiKernel.cpp
@@ -273,7 +273,7 @@ void DigiKernel::submit(const DigiAction::Actors<DigiEventAction>& actions, Digi
if ( parallel ) {
tbb::task_group que;
for ( auto* i : actions )
- que.run(Wrapper(context, *i));
+ que.run(Wrapper(context, i));
que.wait();
goto print_stamp;
}
from spack import *
class Eicd(CMakePackage):
'''EICD podio-based data model for the EIC'''
homepage = 'https://eicweb.phy.anl.gov/EIC/eicd'
#git = 'https://eicweb.phy.anl.gov/EIC/NPDet.git'
#list_url = 'https://eicweb.phy.anl.gov/EIC/NPDet/-/tags'
maintainers = ['sly2j', 'whit']
## Master branch
version('master', git='https://eicweb.phy.anl.gov/EIC/eicd.git',
branch='master',
preferred=True)
variant('cxxstd',
default='11',
values=('11', '14', '17'),
multi=False,
description='Use the specified C++ standard when building.')
depends_on('cmake@3.2:', type='build')
depends_on('podio')
depends_on('root')
def cmake_args(self):
options = []
## C++ standard
options.append('-DCMAKE_CXX_STANDARD={0}'.format(
self.spec.variants['cxxstd'].value))
return options
diff --git a/fmt/format.h b/fmt/format.h
index 561a9e0..9faf5ca 100644
--- a/fmt/format.h
+++ b/fmt/format.h
@@ -153,7 +153,7 @@ typedef __int64 intmax_t;
# define FMT_HAS_CPP_ATTRIBUTE(x) 0
#endif
-#if FMT_HAS_CPP_ATTRIBUTE(maybe_unused)
+#if FMT_HAS_CPP_ATTRIBUTE(maybe_unused) && __cplusplus >= 201103L
# define FMT_HAS_CXX17_ATTRIBUTE_MAYBE_UNUSED
// VC++ 1910 support /std: option and that will set _MSVC_LANG macro
// Clang with Microsoft CodeGen doesn't define _MSVC_LANG macro
diff --git a/fmt/CMakeLists.txt b/fmt/CMakeLists.txt
index c0ef02e..1634924 100644
--- a/fmt/CMakeLists.txt
+++ b/fmt/CMakeLists.txt
@@ -14,8 +14,6 @@ if (FMT_CPPFORMAT)
add_library(cppformat ${FMT_SOURCES} ${FMT_HEADERS})
endif ()
-# Starting with cmake 3.1 the CXX_STANDARD property can be used instead.
-target_compile_options(fmt PUBLIC ${CPP11_FLAG})
if (FMT_PEDANTIC)
target_compile_options(fmt PRIVATE ${PEDANTIC_COMPILE_FLAGS})
endif ()
diff --git a/support/cmake/cxx11.cmake b/support/cmake/cxx11.cmake
index 31ea106..8581b9a 100644
--- a/support/cmake/cxx11.cmake
+++ b/support/cmake/cxx11.cmake
@@ -37,6 +37,10 @@ if (FMT_USE_CPP11)
endif ()
endif ()
+if (CMAKE_CXX_STANDARD)
+ set(CPP11_FLAG )
+endif ()
+
set(CMAKE_REQUIRED_FLAGS ${CPP11_FLAG})
# Check if variadic templates are working and not affected by GCC bug 39653:
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Fmt(CMakePackage):
"""fmt (formerly cppformat) is an open-source formatting library.
It can be used as a safe alternative to printf or as a fast alternative
to C++ IOStreams."""
homepage = "http://fmtlib.net/latest/index.html"
url = "https://github.com/fmtlib/fmt/releases/download/7.1.2/fmt-7.1.2.zip"
version('7.1.2', sha256='4d6968ab7c01e95cc76df136755703defb985105a117b83057e4fd5d53680ea7')
version('7.1.0', sha256='308af4e36ee3ab527b51014a2a5d862682c84f5d16f7a597aea34c84853cbcb0')
version('6.1.2', sha256='63650f3c39a96371f5810c4e41d6f9b0bb10305064e6faf201cbafe297ea30e8')
version('5.3.0', sha256='4c0741e10183f75d7d6f730b8708a99b329b2f942dad5a9da3385ab92bb4a15c')
version('5.2.1', sha256='43894ab8fe561fc9e523a8024efc23018431fa86b95d45b06dbe6ddb29ffb6cd')
version('5.2.0', sha256='c016db7f825bce487a7929e1edb747b9902a2935057af6512cad3df3a080a027')
version('5.1.0', sha256='77ef9fea638dc846e484409fbc1ea710bb9bcea042e7b35b8805041bf7655ad5')
version('5.0.0', sha256='8dd58daf13e7e8adca99f8725ef3ae598f9c97efda7d6d8d4c49db5047879097')
version('4.1.0', sha256='9d49bf02ceb9d0eec51144b203b63b77e69d3798bb402fb82e7d0bdb06c79eeb')
version('4.0.0', sha256='10a9f184d4d66f135093a08396d3b0a0ebe8d97b79f8b3ddb8559f75fe4fcbc3')
version('3.0.2', sha256='51407b62a202b29d1a9c0eb5ecd4095d30031aea65407c42c25cb10cb5c59ad4')
version('3.0.1', sha256='4c9af0dc919a8ae7022b44e1a03c435e42d65c866f44667d8d920d342b098550')
version('3.0.0', sha256='1b050b66fa31b74f1d75a14f15e99e728ab79572f176a53b2f8ad7c201c30ceb')
variant('cxxstd',
default='11',
values=('98', '11', '14', '17'),
multi=False,
description='Use the specified C++ standard when building')
variant('pic', default=True, description='Enable generation of position-independent code')
depends_on('cmake@3.1.0:', type='build')
# Supported compilers/standards are detailed here:
# http://fmtlib.net/latest/index.html#portability
conflicts('%gcc@:4.3.999', when='@5:')
conflicts('%llvm@:2.8.999', when='@5:')
# 5 and above require C++11
conflicts('cxxstd=98', when='@5:')
# 5.0.0 enables C++14 auto return types in C++11 mode
conflicts('cxxstd=11', when='@5.0.0')
# 4.1 fails with C++17 (https://github.com/fmtlib/fmt/issues/722)
conflicts('cxxstd=17', when='@4.1.0')
# Use CMAKE_CXX_STANDARD to define C++ flag, as in later versions
patch('fmt-use-cmake-cxx-standard_3.0.0.patch', when='@3.0.0')
# Remove hardcoding of "-std=c++11/0x" in INTERFACE_COMPILE_OPTIONS
patch('fmt-no-export-cpp11flag_3.0.0.patch', when='@3.0.0:3.0.1')
# Only allow [[attributes]] on C++11 and higher
patch('fmt-attributes-cpp11_4.1.0.patch', when='@4.1.0')
def cmake_args(self):
spec = self.spec
args = []
if '+pic' in spec:
args.extend([
'-DCMAKE_C_FLAGS={0}'.format(self.compiler.cc_pic_flag),
'-DCMAKE_CXX_FLAGS={0}'.format(self.compiler.cxx_pic_flag)
])
args.append('-DCMAKE_CXX_STANDARD={0}'.format(
spec.variants['cxxstd'].value))
# Require standard at configure time to guarantee the
# compiler supports the selected standard.
args.append('-DCMAKE_CXX_STANDARD_REQUIRED=ON')
args.append('-DBUILD_SHARED_LIBS=TRUE')
# When cxxstd is 98, must disable FMT_USE_CPP11
if 'cxxstd=98' in spec:
args.append('-DFMT_USE_CPP11=OFF')
# Can't build docs without doxygen+python+virtualenv
# and call to build "doc" target
args.append("-DFMT_DOC=OFF")
return args
diff --git a/cmake/Modules/FindCLHEP.cmake b/cmake/Modules/FindCLHEP.cmake
index 8b59f1c0a..f616d678e 100644
--- a/cmake/Modules/FindCLHEP.cmake
+++ b/cmake/Modules/FindCLHEP.cmake
@@ -180,7 +180,10 @@ if(UNIX)
execute_process(COMMAND ${CLHEP_CONFIG_EXECUTABLE} --prefix
OUTPUT_VARIABLE _clhep_config_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE)
-
+ if (_clhep_config_prefix)
+ # Remove wrapping double quotes.
+ string(REGEX REPLACE "\"(.*)\"" "\\1" _clhep_config_prefix "${_clhep_config_prefix}")
+ endif()
list(APPEND _clhep_root_hints ${_clhep_config_prefix})
endif()
elseif(WIN32 AND NOT UNIX)
diff --git a/cmake/Templates/Geant4Config.cmake.in b/cmake/Templates/Geant4Config.cmake.in
index d6fe408b3..f355be2af 100644
--- a/cmake/Templates/Geant4Config.cmake.in
+++ b/cmake/Templates/Geant4Config.cmake.in
@@ -268,13 +268,7 @@ set(Geant4_builtin_clhep_FOUND @GEANT4_USE_BUILTIN_CLHEP@)
if(NOT Geant4_builtin_clhep_FOUND)
set(Geant4_system_clhep_ISGRANULAR @GEANT4_USE_SYSTEM_CLHEP_GRANULAR@)
- set(CLHEP_ROOT_DIR "@CLHEP_ROOT_DIR@")
- set(__GEANT4_OLD_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
- set(CMAKE_MODULE_PATH "${_geant4_thisdir}/Modules" ${CMAKE_MODULE_PATH})
find_package(CLHEP @CLHEP_VERSION@ REQUIRED @__g4_clhep_components@)
- set(CMAKE_MODULE_PATH ${__GEANT4_OLD_CMAKE_MODULE_PATH})
- unset(CLHEP_ROOT_DIR)
- unset(__GEANT4_OLD_CMAKE_MODULE_PATH)
#CLHEP doesn't use target properties fully yet, so always include_directories
include_directories(${CLHEP_INCLUDE_DIRS})
endif()
diff -Naur geant4.10.03.p03/cmake/Modules/Geant4LibraryBuildOptions.cmake geant4.10.03.p03/cmake/Modules/Geant4LibraryBuildOptions.cmake
--- geant4.10.03.p03/cmake/Modules/Geant4LibraryBuildOptions.cmake 2017-10-20 06:30:46.000000000 -0500
+++ geant4.10.03.p03/cmake/Modules/Geant4LibraryBuildOptions.cmake 2018-04-16 16:48:02.194321171 -0500
@@ -76,7 +76,7 @@
# Mark as advanced because most users will not need it
enum_option(GEANT4_BUILD_CXXSTD
DOC "C++ Standard to compile against"
- VALUES 11 14 c++11 c++14
+ VALUES 11 14 17 c++11 c++14 c++17
CASE_INSENSITIVE
)
@@ -106,6 +106,9 @@
# Add Definition to flags for temporary back compatibility
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
+if(GEANT4_BUILD_CXXSTD GREATER 14)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES=1")
+endif()
# Hold any appropriate compile flag(s) in variable for later export to
# config files. Needed to support late CMake 2.8 where compile features
diff -Naur geant4/cmake/Modules/G4BuildSettings.cmake geant4/cmake/Modules/G4BuildSettings.cmake
--- geant4/cmake/Modules/G4BuildSettings.cmake 2017-10-20 06:30:46.000000000 -0500
+++ geant4/cmake/Modules/G4BuildSettings.cmake 2018-04-16 16:48:02.194321171 -0500
@@ -76,7 +76,7 @@
# Mark as advanced because most users will not need it
enum_option(GEANT4_BUILD_CXXSTD
DOC "C++ Standard to compile against"
- VALUES 11 14 c++11 c++14
+ VALUES 11 14 17 c++11 c++14 c++17
CASE_INSENSITIVE
)
@@ -106,6 +106,9 @@
# Add Definition to flags for temporary back compatibility
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
+if(GEANT4_BUILD_CXXSTD GREATER 14)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES=1")
+endif()
# Hold any appropriate compile flag(s) in variable for later export to
# config files. Needed to support late CMake 2.8 where compile features
diff --git a/cmake/Modules/G4BuildSettings.cmake b/cmake/Modules/G4BuildSettings.cmake
index f68cb0a44..6bf4b6948 100644
--- a/cmake/Modules/G4BuildSettings.cmake
+++ b/cmake/Modules/G4BuildSettings.cmake
@@ -205,6 +205,13 @@ endif()
# Add Definition to flags for temporary back compatibility
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DG4USE_STD11")
+# Spack patch to support use of C++ features deprecated/removed in C++17
+# Only checked on AppleClang for now
+if(GEANT4_BUILD_CXXSTD GREATER 14)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES=1")
+endif()
+#----
+
# Hold any appropriate compile flag(s) in variable for later export to
# config files. Needed to support clients using late CMake 2.8 where compile features
# are not available.
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
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 = "https://gitlab.cern.ch/geant4/geant4/-/archive/v10.6.0/geant4-v10.6.0.tar.gz"
maintainers = ['drbenmorgan']
version('10.6.2', sha256='e381e04c02aeade1ed8cdd9fdbe7dcf5d6f0f9b3837a417976b839318a005dbd')
version('10.6.1', sha256='4fd64149ae26952672a81ce5579d3806fda4bd251d486897093ac57633a42b7e')
version('10.6.0', sha256='eebe6a170546064ff81ab3b00f513ccd1d4122a026514982368d503ac55a4ee4')
version('10.5.1', sha256='2397eb859dc4de095ff66059d8bda9f060fdc42e10469dd7890946293eeb0e39')
version('10.4.3', sha256='67f3bb6405a2c77e573936c2b933f5a4a33915aa379626a2eb3012009b91e1da')
version('10.4.0', sha256='e919b9b0a88476e00c0b18ab65d40e6a714b55ee4778f66bac32a5396c22aa74')
version('10.3.3', sha256='bcd36a453da44de9368d1d61b0144031a58e4b43a6d2d875e19085f2700a89d8')
_cxxstd_values = ('11', '14', '17')
variant('cxxstd',
default=_cxxstd_values[0],
values=_cxxstd_values,
multi=False,
description='Use the specified C++ standard when building.')
variant('threads', default=True, description='Build with multithreading')
variant('vecgeom', default=False, description='Enable vecgeom support')
variant('opengl', default=False, description='Optional OpenGL support')
variant('x11', default=False, description='Optional X11 support')
variant('motif', default=False, description='Optional motif support')
variant('qt', default=False, description='Enable Qt support')
variant('python', default=False, description='Enable Python bindings')
depends_on('cmake@3.5:', type='build')
depends_on('cmake@3.8:', type='build', when='@10.6.0:')
depends_on('geant4-data@10.6.2', when='@10.6.2')
depends_on('geant4-data@10.6.1', when='@10.6.1')
depends_on('geant4-data@10.6.0', when='@10.6.0')
depends_on('geant4-data@10.5.1', when='@10.5.1')
depends_on('geant4-data@10.4.3', when='@10.4.3')
depends_on('geant4-data@10.4.0', when='@10.4.0')
depends_on('geant4-data@10.3.3', when='@10.3.3')
depends_on("expat")
depends_on("zlib")
# Python, with boost requirement dealt with in cxxstd section
depends_on('python@3:', when='+python')
extends('python', when='+python')
conflicts('+python', when='@:10.6.1',
msg='Geant4 <= 10.6.1 cannont be built with Python bindings')
for std in _cxxstd_values:
# CLHEP version requirements to be reviewed
depends_on('clhep@2.3.3.0: cxxstd=' + std,
when='@10.3.3: cxxstd=' + std)
# Spack only supports Xerces-c 3 and above, so no version req
depends_on('xerces-c cxxstd=' + std, when='cxxstd=' + std)
# Vecgeom specific versions for each Geant4 version
depends_on('vecgeom@1.1.5 cxxstd=' + std,
when='@10.6.0:10.6.99 +vecgeom cxxstd=' + std)
depends_on('vecgeom@1.1.0 cxxstd=' + std,
when='@10.5.0:10.5.99 +vecgeom cxxstd=' + std)
depends_on('vecgeom@0.5.2 cxxstd=' + std,
when='@10.4.0:10.4.99 +vecgeom cxxstd=' + std)
depends_on('vecgeom@0.3rc cxxstd=' + std,
when='@10.3.0:10.3.99 +vecgeom cxxstd=' + std)
# Boost.python, conflict handled earlier
depends_on('boost@1.70: +python cxxstd=' + std,
when='+python cxxstd=' + std)
# Visualization driver dependencies
depends_on("gl", when='+opengl')
depends_on("glu", when='+opengl')
depends_on("glx", when='+opengl+x11')
depends_on("libx11", when='+x11')
depends_on("libxmu", when='+x11')
depends_on("motif", when='+motif')
depends_on("qt@5: +opengl", when="+qt")
# As released, 10.03.03 has issues with respect to using external
# CLHEP.
patch('CLHEP-10.03.03.patch', level=1, when='@10.3.3')
# These patches can be applied independent of the cxxstd value?
patch('cxx17.patch', when='@:10.3.99 cxxstd=17')
patch('cxx17_geant4_10_0.patch', level=1, when='@10.4.0 cxxstd=17')
patch('geant4-10.4.3-cxx17-removed-features.patch',
level=1, when='@10.4.3 cxxstd=17')
def cmake_args(self):
spec = self.spec
# Core options
options = [
'-DGEANT4_BUILD_CXXSTD=c++{0}'.format(
self.spec.variants['cxxstd'].value),
'-DGEANT4_USE_SYSTEM_CLHEP=ON',
'-DGEANT4_USE_SYSTEM_EXPAT=ON',
'-DGEANT4_USE_SYSTEM_ZLIB=ON',
'-DGEANT4_USE_G3TOG4=ON',
'-DGEANT4_USE_GDML=ON',
'-DXERCESC_ROOT_DIR={0}'.format(spec['xerces-c'].prefix)
]
# Multithreading
options.append(self.define_from_variant('GEANT4_BUILD_MULTITHREADED',
'threads'))
if '+threads' in spec:
# Locked at global-dynamic to allow use cases that load the
# geant4 libs at application runtime
options.append('-DGEANT4_BUILD_TLS_MODEL=global-dynamic')
# install the data with geant4
datadir = spec['geant4-data'].prefix.share
dataver = '{0}-{1}'.format(spec['geant4-data'].name,
spec['geant4-data'].version.dotted)
datapath = join_path(datadir, dataver)
options.append('-DGEANT4_INSTALL_DATADIR={0}'.format(datapath))
# Vecgeom
if '+vecgeom' in spec:
options.append('-DGEANT4_USE_USOLIDS=ON')
options.append('-DUSolids_DIR=%s' % spec[
'vecgeom'].prefix.lib.CMake.USolids)
# Visualization options
if 'platform=darwin' not in spec:
if "+x11" in spec and "+opengl" in spec:
options.append('-DGEANT4_USE_OPENGL_X11=ON')
if "+motif" in spec and "+opengl" in spec:
options.append('-DGEANT4_USE_XM=ON')
if "+x11" in spec:
options.append('-DGEANT4_USE_RAYTRACER_X11=ON')
if '+qt' in spec:
options.append('-DGEANT4_USE_QT=ON')
options.append(
'-DQT_QMAKE_EXECUTABLE=%s' %
spec['qt'].prefix.bin.qmake)
# Python
if spec.version > Version('10.6.1'):
options.append(self.define_from_variant('GEANT4_USE_PYTHON',
'python'))
return options
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment