Opened 10 years ago
Last modified 10 years ago
#12 new defect
Build error with CERN ROOT 5.34/21
Reported by: | smueller | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | milestone: |
Component: | component1 | Version: | |
Keywords: | Cc: |
Description
When building Mars using the latest and recommended (November 2014) CERN ROOT version 5.34/21 on Ubuntu 14.04 64bit, there are build errors concerning mbase/MQuarternion.h
and msim/MPhotonData.h
. In both these header files the sqrt() is 'redefined' from 'sqrt' to 'sqrt ::sqrt'.
In the header files it looks like:
#ifndef ROOT_TQuaternion #include <math.h> #define sqrt ::sqrt #include <TQuaternion.h> #undef sqrt #endif
The build error looks like:
In file included from MPhotonData.cc:43:0: /usr/include/c++/4.8/bits/random.h: In member function ‘std::student_t_distribution<_RealType>::result_type std::student_t_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&)’: MPhotonData.h:20:14: error: expected unqualified-id before ‘::’ token #define sqrt ::sqrt ^
Note:
See TracTickets
for help on using tickets.
I found a possible solution. But for now I only know this is running with my CERN Root version 5.34/21. How ever a valid solution should work for them all.
I tried to use the
ROOT_VERSION(XX,XX,XX)
function to fix this. I use it like this:The
#include "RVersion.h"
is needed when there is no CERN Root include before theROOT_VERSION()
But Root would not be Root without its pitfalls. This solution causes a different rootCINT related error.
This latter turns out to be a 'well known bug'. See
http://root.cern.ch/phpBB3/viewtopic.php?t=5795
So I put a
-p
option to the Mars Makefile.rules where the CINT is called:Now it is working on my machine. But further tests with different CERN Root versions might be needed.