Skip to content

Test rootpy with ROOT 6 #101

Closed
cdeil opened this Issue Nov 29, 2012 · 10 comments

3 participants

@cdeil
the rootpy project member
cdeil commented Nov 29, 2012

In ROOT 6 CINT will be replaced by cling (see http://root.cern.ch/drupal/content/way-root-6 ).
We should keep an eye on the ROOT 6 development (especially the release candidates) and try to get rootpy and root_numpy to work for the ROOT 6.0 release.

At the moment cling in ROOT trunk crashes for Python 2 and 3 on Ubuntu and Mac:

As soon as things work on Ubuntu I'll add travis-ci builds.

@cdeil cdeil was assigned Nov 29, 2012
@cdeil
the rootpy project member
cdeil commented Mar 11, 2013

Just for fun I did run the rootpy unit tests with ROOT 6 on Ubuntu 64 bit (i.e. in a VirtualBox as used by travis-ci):
https://gist.github.com/cdeil/5134128

There are errors, but this is not surprising, ROOT 6 will probably not be released before Nov 2013 and currently simply creating a TBrowser in ROOT does crash ... will try rootpy with ROOT 6 again in half a year. :-)

@kreczko
kreczko commented Jun 13, 2014

ROOT 6 is now out and I've started to make it work on travis. The compiled build can be found at https://kreczko.web.cern.ch/kreczko/root_builds/root_v6.00.00_python_2.7.tar.gz.

However, travis has problems with stl

cc1plus: error: unrecognized command line option ‘-std=c++11’
Warning in cling::CIFactory::createCI():
Possible C++ standard library mismatch, compiled with __GLIBCXX__ v20130604 but extraction of runtime standard library version failed.
Invoking:
echo '#include <vector>' | g++ -O2 -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fomit-frame-pointer -std=c++11 -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -fdata-sections -Wcast-qual -fno-strict-aliasing -DNDEBUG -xc++ -dM -E - | grep 'define __GLIBCXX__' | awk '{print $3}'
results in
cc1plus: error: unrecognized command line option ‘-std=c++11’
with exit code 0
cc1plus: error: unrecognized command line option ‘-std=c++11’
g++: error: /home/travis/.cache/rootpy/x86_64-60000/dicts/bc0b923518b2009d_ACLiC_dict.o: No such file or directory
Traceback (most recent call last):
File "test/RooFitFit.py", line 7, in <module>
from tools.Fitting import RooFitFit
File "/home/travis/build/BristolTopGroup/DailyPythonScripts/tools/Fitting.py", line 21, in <module>
MapStrRootPtr = stl.map( stl.string, "TH1*" )
File "/home/travis/build/BristolTopGroup/DailyPythonScripts/external/rootpy/rootpy/stl.py", line 421, in __call__
cpptype.ensure_built(headers=headers)
File "/home/travis/build/BristolTopGroup/DailyPythonScripts/external/rootpy/rootpy/stl.py", line 206, in ensure_built
has_iterators=self.name in HAS_ITERATORS)
File "/home/travis/build/BristolTopGroup/DailyPythonScripts/external/rootpy/rootpy/stl.py", line 392, in generate
sourcepath))
RuntimeError: failed to compile the library for '/home/travis/.cache/rootpy/x86_64-60000/dicts/bc0b923518b2009d.C'

more at
https://travis-ci.org/BristolTopGroup/DailyPythonScripts/jobs/27473547.
This is caused by the line:

MapStrRootPtr = stl.map( stl.string, "TH1*" )

as the assertion

ROOT.gSystem.CompileMacro(sourcepath, 'k-', libname, DICTS_PATH) != 1

fails. Is there a way to disable the option ‘-std=c++11’ in roopty for ROOT 6?
I cannot reproduce the problem on my machine (Ubuntu 14.04) and I did not have it on Ubuntu 12.04. This might be a travis-only feature after all.

@ndawe
the rootpy project member
ndawe commented Jun 13, 2014

It looks like you compiled ROOT with a newer compiler than what is available on travis. ACLiC gets the compiler options from those you used to compile ROOT.

@kreczko
kreczko commented Jun 13, 2014

Yes, it seems so. I've updated the gcc to 4.8 on travis, but it does not pick it up.
Probably I have to force it via update-alternatives. Will try this tomorrow.

@cdeil
the rootpy project member
cdeil commented Jun 13, 2014

The easiest way would be to run the same Ubuntu version in virtualbox or docker to produce the ROOT binary ... then it'll just work on travis-ci (and lets you debug any test errors that show up on travis-ci locally).

@kreczko
kreczko commented Jun 15, 2014

Yes, this is what I did. But I still cannot reproduce the error.
Right now I have what I think is an exact copy of my VM in the travis configuration:
https://github.com/kreczko/DailyPythonScripts/blob/multi_variable_fitting/.travis.yml

However, the script fails at building RooUnfold (which needed some changes to work with the new compilers):

/home/travis/build/BristolTopGroup/DailyPythonScripts/external/RooUnfold/tmp/linuxx8664gcc/RooUnfoldDict.cxx:39:92: fatal error: build/BristolTopGroup/DailyPythonScripts/external/RooUnfold/src/RooUnfoldBayes.h: No such file or directory
 #include "build/BristolTopGroup/DailyPythonScripts/external/RooUnfold/src/RooUnfoldBayes.h"

This is the main difference to what I see on the VM. On the VM I have the absolute path instead (and hence it works).

I am away for a week now, hopefully when I come back to it all will be clear.

@ndawe
the rootpy project member
ndawe commented Jun 16, 2014

I see. Thanks a lot for working on this!

@kreczko
kreczko commented Jun 23, 2014

Hmm, so it seems that it is very simple: a combination of clang 3.5 and the new rootcling/rootcint. This shouldn't be a problem for rootpy (in fact in compiles without problems).
I will submit a pull request for the new ROOT build soon. But first you need to add
https://kreczko.web.cern.ch/kreczko/root_builds/root_v6.00.00_python_2.7.tar.gz
to your copy.com account.

@kreczko kreczko added a commit to kreczko/rootpy that referenced this issue Jun 23, 2014
@kreczko kreczko enabled ROOT 6 for tests (#101) dc8add7
@kreczko kreczko added a commit to kreczko/rootpy that referenced this issue Jul 30, 2014
@kreczko kreczko enabled ROOT 6 for tests (#101) b82c91b
@kreczko kreczko added a commit to kreczko/rootpy that referenced this issue Mar 26, 2015
@kreczko kreczko enabled ROOT 6 for tests (#101) f159096
@cdeil
the rootpy project member
cdeil commented May 25, 2015

Looks like rootpy now works with ROOT 6?
https://travis-ci.org/rootpy/rootpy
Is there something left to do here or can this issue be closed?

I guess a better long-term solution for CI and users would be to use conda instead of building and hosting our own ROOT binaries?
Has this been discussed or is this maybe even available via some binstar channel?

@ndawe
the rootpy project member
ndawe commented May 26, 2015

Good to hear from you again @cdeil! I hope you're doing well.

Yes, this issue can be closed. Re conda, I'll have a look. We now have an easy method of building ROOTs in a vagrant VM with the same env as Travis. The 3GB in a free account on Binstar would be sufficient though.

@ndawe ndawe closed this May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.