Skip to content

Commit

Permalink
Merge branch 'master' into install-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert committed Dec 17, 2016
2 parents de24c6c f37d9e1 commit 31c25de
Show file tree
Hide file tree
Showing 459 changed files with 8,279 additions and 7,654 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 204,13 @@ if(cxxmodules)
DEPENDS build/unix/module.modulemap
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/build/unix/module.modulemap ${CMAKE_BINARY_DIR}/include/module.modulemap
)
get_property(__modulemap_extra_content GLOBAL PROPERTY ROOT_CXXMODULES_EXTRA_MODULEMAP_CONTENT)
string(REPLACE ";" "" __modulemap_extra_content "module ROOT {\\n ${__modulemap_extra_content} \\n }")
add_custom_command(TARGET copymodulemap POST_BUILD
COMMAND echo ${__modulemap_extra_content} >> ${CMAKE_BINARY_DIR}/include/module.modulemap
VERBATIM
)
add_dependencies(move_headers copymodulemap)
endif(cxxmodules)

#---hsimple.root---------(use the executable for clearer dependencies and proper return code)---
Expand Down
91 changes: 74 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 558,7 @@ COREL = $(BASEL1) $(BASEL2) $(BASEL3) $(CONTL) $(METAL) $(ZIPL) \
COREDS := $(call stripsrc,$(COREBASEDIRS)/G__Core.cxx)
COREDO := $(COREDS:.cxx=.o)
COREDH := $(COREDS:.cxx=.h)
COREDICTHDEP = $(BASEDICTH) $(CONTH) $(METAH) $(SYSTEMH) $(ZIPDICTH) \
COREDICTHDEP = $(BASEDICTH) $(CONTH) $(METAH) $(SYSTEMDH) $(ZIPDICTH) \
$(CLIBHH) $(METAUTILSH) $(TEXTINPUTH)
COREDICTH = $(BASEDICTH) $(CONTH) $(METADICTH) $(SYSTEMDICTH) \
$(ZIPDICTH) $(CLIBHH) $(METAUTILSH) $(TEXTINPUTH)
Expand Down Expand Up @@ -592,15 592,38 @@ endif
##### all #####
ALLHDRS :=
ifeq ($(CXXMODULES),yes)
# Add the ROOT Core module. It is organized differently and we cannot do it in
# a Module.mk
CXXMODULES_HEADERS :=
CXXMODULES_MODULEMAP_CONTENTS :=

# Copy the modulemap in $ROOTSYS/include first.
ALLHDRS := include/module.modulemap
ROOT_CXXMODULES_CXXFLAGS = -fmodules -fcxx-modules -fmodules-cache-path=$(ROOT_OBJDIR)/include/pcms/
ROOT_CXXMODULES_CFLAGS = -fmodules -fmodules-cache-path=$(ROOT_OBJDIR)/include/pcms/
# FIXME: Remove -fno-autolink once the clang's modules autolinking is done on a
#use of a header not unconditionally.
ROOT_CXXMODULES_COMMONFLAGS := -fmodules -fmodules-cache-path=$(ROOT_OBJDIR)/include/pcms/ -fno-autolink -fdiagnostics-show-note-include-stack
ifeq ($(PLATFORM),macosx)
# FIXME: OSX doesn't support -fmodules-local-submodule-visibility because its
# Frameworks' modulemaps predate the flag.
ifneq ($(PLATFORM),macosx)
ROOT_CXXMODULES_CXXFLAGS = -Xclang -fmodules-local-submodule-visibility
endif # not macos
# Frameworks' modulemaps predate the flag. Here we exclude the system module maps
# and use only the ROOT one. This is suboptimal, because module-aware systems
# should give us better performance.
ROOT_CXXMODULES_COMMONFLAGS = -fno-implicit-module-maps -fmodule-map-file=$(ROOT_OBJDIR)/include/module.modulemap
# FIXME: TGLIncludes and alike depend on glew.h doing special preprocessor
# trickery to override the contents of system's OpenGL.
# On OSX #include TGLIncludes.h will trigger the creation of the system
# OpenGL.pcm. Once it is built, glew cannot use preprocessor trickery to 'fix'
# the translation units which it needs to 'rewrite'. The translation units
# which need glew support are in graf3d. However, depending on the modulemap
# organization we could request it implicitly (eg. one big module for ROOT).
# In these cases we need to 'prepend' this include path to the compiler in order
# for glew.h to it its trick.
#
# Turn on when we remove -fno-implicit-module-maps
#ROOT_CXXMODULES_COMMONFLAGS = -isystem $(ROOT_SRCDIR)/graf3d/glew/isystem/
endif # macosx

ROOT_CXXMODULES_CXXFLAGS := $(ROOT_CXXMODULES_COMMONFLAGS) -fcxx-modules -Xclang -fmodules-local-submodule-visibility
ROOT_CXXMODULES_CFLAGS := $(ROOT_CXXMODULES_COMMONFLAGS)

CXXFLAGS = $(ROOT_CXXMODULES_CXXFLAGS)
CFLAGS = $(ROOT_CXXMODULES_CFLAGS)
Expand All @@ -612,7 635,6 @@ CFLAGS = --gcc-toolchain=$(GCCTOOLCHAIN)
LDFLAGS = --gcc-toolchain=$(GCCTOOLCHAIN)
endif


ALLLIBS := $(CORELIB)
ALLMAPS := $(COREMAP)
ALLEXECS :=
Expand Down Expand Up @@ -654,8 676,8 @@ $(1)/%.o: $(ROOT_SRCDIR)/$(1)/%.c

$(1)/%.o: $(ROOT_SRCDIR)/$(1)/%.mm
$$(MAKEDIR)
$$(MAKEDEP) -R -f$$(@:.o=.d) -Y -w 1000 -- $$(CXXFLAGS) -D__cplusplus -- $$<
$$(CXX) $$(OPT) $$(CXXFLAGS) $$(CXXMKDEPFLAGS) -ObjC $$(CXXOUT)$$@ -c $$<
$$(MAKEDEP) -R -f$$(@:.o=.d) -Y -w 1000 -- $$(OBJCXXFLAGS) -D__cplusplus -- $$<
$$(CXX) $$(OPT) $$(OBJCXXFLAGS) $$(CXXMKDEPFLAGS) -ObjC $$(CXXOUT)$$@ -c $$<

$(1)/%.o: $(ROOT_SRCDIR)/$(1)/%.f
$$(MAKEDIR)
Expand Down Expand Up @@ -684,8 706,8 @@ $(foreach module,$(MODULESGENERIC),$(eval $(call SRCTOOBJ_template,$(module))))
$(CC) $(OPT) $(CFLAGS) $(CXXMKDEPFLAGS) $(CXXOUT)$@ -c $<

%.o: %.mm
$(MAKEDEP) -R -f$*.d -Y -w 1000 -- $(CXXFLAGS) -D__cplusplus -- $<
$(CXX) $(OPT) $(CXXFLAGS) $(CXXMKDEPFLAGS) -ObjC $(CXXOUT)$@ -c $<
$(MAKEDEP) -R -f$*.d -Y -w 1000 -- $(OBJCXXFLAGS) -D__cplusplus -- $<
$(CXX) $(OPT) $(OBJCXXFLAGS) $(CXXMKDEPFLAGS) -ObjC $(CXXOUT)$@ -c $<

%.o: %.f
ifeq ($(F77),f2c)
Expand Down Expand Up @@ -830,8 852,43 @@ $(COMPILEDATA): $(ROOT_SRCDIR)/config/Makefile.$(ARCH) config/Makefile.comp Make
"$(EXPLICITLINK)"

ifeq ($(CXXMODULES),yes)
include/module.modulemap: $(ROOT_SRCDIR)/build/unix/module.modulemap

# We cannot use the usual way of setting CXXMODULES_MODULEMAP_CONTENTS for core,
# because we require information from the core submodules. Thus we have to access
# the information at the target.
#
# We use the relative path of COREDICT.
# FIXME: We probably should be chaning the COREDICTH to use relative paths, too.
# COREDICTH = $(BASEDICTH) $(CONTH) $(METADICTH) $(SYSTEMDICTH) \
# $(ZIPDICTH) $(CLIBHH) $(METAUTILSH) $(TEXTINPUTH)
include/module.modulemap:
COREDICTH_REL := $(BASEH_REL) $(CONTH_REL) $(METAH_REL) $(METAUTILSH_REL)
COREDICTH_REL := $(patsubst include/%,%, $(COREDICTH_REL))
CXXMODULES_CORE_EXCLUDE := RConversionRuleParser.h TSchemaRuleProcessor.h \
RConfig.h RVersion.h RtypesImp.h \
Rtypes.h RtypesCore.h TClassEdit.h TMetaUtils.h \
TSchemaType.h DllImport.h TGenericClassInfo.h \
TSchemaHelper.h ESTLType.h RStringView.h Varargs.h \
RootMetaSelection.h \
RWrap_libcpp_string_view.h TAtomicCountGcc.h \
TException.h ROOT/TThreadExecutor.hxx TBranchProxyTemplate.h \
TGLIncludes.h TGLWSIncludes.h snprintf.h strlcpy.h
COREDICTH_REL := $(filter-out $(CXXMODULES_CORE_EXCLUDE),$(COREDICTH_REL))
CXXMODULES_CORE_HEADERS := $(patsubst %,header \"%\"\\n, $(COREDICTH_REL))
CXXMODULES_CORE_MODULEMAP_CONTENTS := module Core { \\n \
requires cplusplus \\n \
$(CXXMODULES_CORE_HEADERS) \
"export * \\n" \
link \"$(CORELIB)\" \\n \
} \\n
CXXMODULES_ROOT_MODULE := "module ROOT {\\n" \
"$(CXXMODULES_CORE_MODULEMAP_CONTENTS)" \
"$(CXXMODULES_MODULEMAP_CONTENTS)" \
"\\n } //module ROOT \\n"
include/module.modulemap: $(ROOT_SRCDIR)/build/unix/module.modulemap
cp $< $@
@echo "$(value CXXMODULES_ROOT_MODULE)" | sed -E 's|(\s*)(.*) header "(.*)"|\1 module "\3" { \2 header "\3" export * }|g' >> $@

endif

# We rebuild GITCOMMITH only when we would re-link libCore anyway.
Expand Down Expand Up @@ -865,7 922,7 @@ endif
$(COREDS): $(COREDICTHDEP) $(COREL) $(ROOTCLINGSTAGE1DEP) $(LLVMDEP)
$(MAKEDIR)
@echo "Generating dictionary $@..."
$(ROOTCLINGSTAGE1) -f $@ -s lib/libCore.$(SOEXT) -c $(COREDICTCXXFLAGS) \
$(ROOTCLINGSTAGE1) -f $@ -s $(CORELIB) -c $(COREDICTCXXFLAGS) \
$(COREDICTH) $(COREL0) && touch lib/libCore_rdict.pcm

$(call pcmname,$(CORELIB)): $(COREDS)
Expand Down Expand Up @@ -1139,18 1196,18 @@ changelog:

releasenotes:
@$(MAKERELNOTES)
ROOTCLING_CXXFLAGS := $(CXXFLAGS)
ROOTPCHCXXFLAGS := $(CXXFLAGS)
# rootcling uses our internal version of clang. Passing the modules flags here
# would allow rootcling to find module files built by the external compiler
# (eg. $CXX or $CC). This, in turn, would cause problems if we are using
# different clang version (even different commit revision) as the modules files
# are not guaranteed to be compatible among clang revisions.
ifeq ($(CXXMODULES),yes)
ROOTCLING_CXXFLAGS := $(filter-out $(ROOT_CXXMODULES_CXXFLAGS),$(CXXFLAGS))
ROOTPCHCXXFLAGS := $(filter-out $(ROOT_CXXMODULES_CXXFLAGS),$(ROOTPCHCXXFLAGS))
endif

$(ROOTPCH): $(MAKEPCH) $(ROOTCLINGSTAGE1DEP) $(ALLHDRS) $(CLINGETCPCH) $(ORDER_) $(ALLLIBS)
@$(MAKEPCHINPUT) $(ROOT_SRCDIR) "$(MODULES)" $(CLINGETCPCH) -- $(ROOTCLING_CXXFLAGS)
@$(MAKEPCHINPUT) $(ROOT_SRCDIR) "$(MODULES)" $(CLINGETCPCH) -- $(ROOTPCHCXXFLAGS)
@ROOTIGNOREPREFIX=1 $(MAKEPCH) $@

$(MAKEPCH): $(ROOT_SRCDIR)/$(MAKEPCH)
Expand Down
8 changes: 8 additions & 0 deletions README/ReleaseNotes/v610/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 124,11 @@ The following interfaces have been removed, after deprecation in v6.08.
range should be recomputed. This has the side effect that some graph parameters
(like the axis titles) were also deleted. This now fixed. It was reported
[here](https://sft.its.cern.ch/jira/browse/ROOT-8092).
- Improve the error bars drawing in TLegend to better match the plot's error
drawing. This improvement was requested [here](https://sft.its.cern.ch/jira/browse/ROOT-5468).
- Implement text clipping in TASImage as requested [here](https://sft.its.cern.ch/jira/browse/ROOT-4538).
Also the text size in batch mode for png (gif jpeg) files better matches the
size on screen and pdf.

## 3D Graphics Libraries
- In `TMarker3DBox::PaintH3` the boxes' sizes was not correct.
Expand All @@ -133,6 138,9 @@ The following interfaces have been removed, after deprecation in v6.08.

## Geometry Libraries

## Dictionaries
- Stop dictionary generation early, during AST scanning, if a union is selected for I/O as this is not supported (triggered by [ROOT-8492](https://sft.its.cern.ch/jira/browse/ROOT-8492))
- Allow inclusion of headers in linkdef files [ROOT-7765](https://sft.its.cern.ch/jira/browse/ROOT-7765)

## I/O Libraries
- [[https://sft.its.cern.ch/jira/browse/ROOT-8478](https://sft.its.cern.ch/jira/browse/ROOT-8478)] - Prompt error when building streamer info and a data member is a vector<T> w/o dictionary
Expand Down
7 changes: 6 additions & 1 deletion bindings/pyroot/JsMVA/DataLoader.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 5,12 @@


from ROOT import TH1F, TMVA, TBufferJSON
import JPyInterface
import sys
if sys.version_info >= (3, 0):
from JsMVA import JPyInterface
else:
import JPyInterface
from JsMVA.Utils import xrange
import ROOT


Expand Down
22 changes: 16 additions & 6 deletions bindings/pyroot/JsMVA/Factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 6,12 @@

import ROOT
from ROOT import TMVA
import JPyInterface
import sys
if sys.version_info >= (3, 0):
from JsMVA import JPyInterface
else:
import JPyInterface
from JsMVA.Utils import xrange
from xml.etree.ElementTree import ElementTree
import json
from IPython.core.display import display, HTML, clear_output
Expand Down Expand Up @@ -147,7 152,7 @@ def GetDeepNetworkOld(xml_file, returnObj=False):
network["synapses"] = synapses
if returnObj:
return network
return json.dumps(network)
return json.dumps(network, sort_keys = True)

## Reads deep neural network weights from file and returns it in JSON format.
# @param xml_file path to DNN weight file
Expand Down Expand Up @@ -191,7 196,7 @@ def GetDeepNetwork(xml_file, returnObj=False):
network["layers"] = layers
if returnObj:
return network
return json.dumps(network)
return json.dumps(network, sort_keys = True)

## Reads neural network weights from file and returns it in JSON format
# @param xml_file path to weight file
Expand Down Expand Up @@ -226,7 231,7 @@ def GetNetwork(xml_file):
neurons[label]["weights"] = weights
net["layer_" str(layer.get('Index'))] = neurons
network["layout"] = net
return json.dumps(network)
return json.dumps(network, sort_keys = True)

## Helper class for reading decision tree from XML file
class TreeReader:
Expand Down Expand Up @@ -681,7 686,12 @@ def ChangeCallOriginal__init__(*args, **kwargs):
hasColor = False
args = list(args)
for arg_idx in xrange(len(args)):
if isinstance(args[arg_idx], basestring) and args[arg_idx].find(":")!=-1:
# basestring==(str, unicode) in Python2, which translates to str in Python3
if sys.version_info >= (3, 0):
is_string = isinstance(args[arg_idx], str)
else:
is_string = isinstance(args[arg_idx], basestring)
if is_string and args[arg_idx].find(":")!=-1:
if args[arg_idx].find("Color")!=-1:
hasColor = True
if args[arg_idx].find("!Color")==-1:
Expand Down Expand Up @@ -825,4 835,4 @@ def drawWrapper(e):
button = widgets.Button(description="Draw", font_weight="bold", font_size="16")
button.on_click(drawWrapper)
box = widgets.HBox([selectLayer, button])
display(box)
display(box)
16 changes: 9 additions & 7 deletions bindings/pyroot/JsMVA/JPyInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 8,12 @@
from IPython.core.display import display, HTML
from string import Template
import ROOT
import DataLoader
import Factory
import types
import OutputTransformer
import sys
if sys.version_info >= (3, 0):
from JsMVA import DataLoader, Factory
else:
import DataLoader, Factory
from JsMVA import OutputTransformer


## Function inserter class
Expand Down Expand Up @@ -94,15 96,15 @@ def ProcessParameters(optStringStartIndex, *args, **kwargs):
else:
opt = ""
for key in kwargs:
if type(kwargs[key]) == types.BooleanType:
if isinstance(kwargs[key], bool):
if kwargs[key] == True:
opt = key ":"
else:
opt = "!" key ":"
elif type(kwargs[key]) == types.ListType:
elif isinstance(kwargs[key], list):
ss = ""
for o in kwargs[key]:
if type(o) == types.DictType:
if isinstance(o, dict):
sst = ""
for kk in o:
sst = kk "=" str(o[kk]) ","
Expand Down
4 changes: 2 additions & 2 deletions bindings/pyroot/JsMVA/JsMVAMagic.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 23,7 @@ def __init__(self, shell):
@magic_arguments()
@argument('arg', nargs="?", default="on", help='Enable/Disable JavaScript visualisation for TMVA')
def jsmva(self, line):
from JPyInterface import functions
from JsMVA.JPyInterface import functions
args = parse_argstring(self.jsmva, line)
if args.arg == 'on':
functions.register()
Expand All @@ -35,4 35,4 @@ def jsmva(self, line):

## Function for registering the magic class
def load_ipython_extension(ipython):
ipython.register_magics(JsMVAMagic)
ipython.register_magics(JsMVAMagic)
3 changes: 2 additions & 1 deletion bindings/pyroot/JsMVA/OutputTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,8 @@
# @author Attila Bagoly <[email protected]>
# This class will transform the TMVA original output to HTML formated output.

import DataLoader
from JsMVA import DataLoader
from JsMVA.Utils import xrange
import cgi
import re

Expand Down
10 changes: 10 additions & 0 deletions bindings/pyroot/JsMVA/Utils.py
Original file line number Diff line number Diff line change
@@ -0,0 1,10 @@
# -*- coding: utf-8 -*-
# @package JsMVA.Utils
# @author Enric Tejedor <[email protected]>
# Utilities module.

import sys
if sys.version_info >= (3, 0):
xrange = range
else:
xrange = xrange
3 changes: 2 additions & 1 deletion bindings/pyroot/JupyROOT/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
import JupyROOT.utils
from JupyROOT import cppcompleter, utils

if '__IPYTHON__' in __builtins__ and __IPYTHON__:
cppcompleter.load_ipython_extension(get_ipython())
utils.iPythonize()
Loading

0 comments on commit 31c25de

Please sign in to comment.