Thiago Tomei | 12 Jun 2012 17:39
Picon
Picon

[ROOT] Compilation problem: ROOT 5.34.00

Greetings all

Compilation of ROOT V5.34.00 is failing in my Mac OS X (Snow Leopard)
system with the following error:

g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual
-fsigned-char -fno-common -Iinclude      -pthread -ObjC++ -std=c++11
-o core/macosx/src/CocoaUtils.o -c
/Users/trtomei/root/core/macosx/src/CocoaUtils.mm
cc1objplus: error: unrecognized command line option "-std=c++11"

Relevant information:

$ g++ --version
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Darwin Thiago-Tomeis-MacBook.local 10.8.0 Darwin Kernel Version
10.8.0: Tue Jun  7 16:33:36 PDT 2011;
root:xnu-1504.15.3~1/RELEASE_I386 i386

Cheers,
Thiago
--

-- 
    Thiago R. F. P Tomei - http://cern.ch/Thiago.Tomei
    SPRACE - São Paulo Research and Analysis Center
    CERN - European Organization for Nuclear Research
(Continue reading)

Chris Jones | 12 Jun 2012 21:50
Picon
Picon
Favicon

Re: [ROOT] Compilation problem: ROOT 5.34.00

Hi,

What configure arguments did you use ? Looks like you tried to enable the new cocoa graphical backend, which
in turn appears to try and use std=c++11. I think this is only supposed to be enabled if you ran with --enable-c++11

c++11              Build using C++11 compatible mode, requires gcc > 4.7.x or clang

which will not work with the old gcc 4.2.1 system compiler.

I'm guessing, but it looks like something in the new (and as the release notes say 'work in progress' ;) )
cocoa backend is enabling this when it shouldn't ?

I just tried myself, on OSX 10.7, using gcc 4.7, and I get a different error if I try and enable the cocoa backend.

g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     
-pthread -ObjC++ -std=c++11 -o core/macosx/src/CocoaUtils.o -c /Users/chris/Projects/root/core/macosx/src/CocoaUtils.mm
cc1objplus: error: argument to '-O' should be a non-negative integer
make: *** [core/macosx/src/CocoaUtils.o] Error 1

macmini ~/Projects/root > g++ --version
g++ (MacPorts gcc47 4.7.0_3) 4.7.0
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Chris

On 12 Jun 2012, at 4:39pm, Thiago Tomei wrote:

> Greetings all
(Continue reading)

Timur Pocheptsov | 12 Jun 2012 22:02
Picon
Picon

RE: [ROOT] Compilation problem: ROOT 5.34.00

Hi.

>I'm guessing, but it looks like something in the new (and as the release notes say 'work in progress' ;) )
cocoa backend is enabling this when it shouldn't ?

*.mm files have a special rule to compile with unconditional C++11 option. As soon as I was asked to remove
all C++11 constructs, I can also remove this option
(you can also try this, it's in a Makefile, the rule for mm files) - we'll commit this changes into the 5-34 tomorrow.
Even so, if you have an old version of clang you can not compile cocoa back-end, this is Objective-C++ and old
compilers have a problem with some of
names in ROOT's source code, like IsA, etc.

>I just tried myself, on OSX 10.7, using gcc 4.7, and I get a different error if I try and enable the cocoa backend.

>g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     
-pthread -ObjC++ -std=c++11 -o core/macosx/src/CocoaUtils.o -c /Users/chris/Projects/root/core/macosx/src/CocoaUtils.mm
>cc1objplus: error: argument to '-O' should be a non-negative integer

The code is to be compiled with clang.

On 12 Jun 2012, at 4:39pm, Thiago Tomei wrote:

> Greetings all
>
> Compilation of ROOT V5.34.00 is failing in my Mac OS X (Snow Leopard)
> system with the following error:
>
> g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual
> -fsigned-char -fno-common -Iinclude      -pthread -ObjC++ -std=c++11
> -o core/macosx/src/CocoaUtils.o -c
(Continue reading)

Chris Jones | 12 Jun 2012 22:09
Picon
Picon
Favicon

Re: [ROOT] Compilation problem: ROOT 5.34.00

Hi,

>> I just tried myself, on OSX 10.7, using gcc 4.7, and I get a different error if I try and enable the cocoa backend.
> 
>> g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     
-pthread -ObjC++ -std=c++11 -o core/macosx/src/CocoaUtils.o -c /Users/chris/Projects/root/core/macosx/src/CocoaUtils.mm
>> cc1objplus: error: argument to '-O' should be a non-negative integer
> 
> The code is to be compiled with clang.

Just to be clear, you are saying the cocoa backend can only be compiled with clang, not gcc ?

Chris

> 
> On 12 Jun 2012, at 4:39pm, Thiago Tomei wrote:
> 
>> Greetings all
>> 
>> Compilation of ROOT V5.34.00 is failing in my Mac OS X (Snow Leopard)
>> system with the following error:
>> 
>> g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual
>> -fsigned-char -fno-common -Iinclude      -pthread -ObjC++ -std=c++11
>> -o core/macosx/src/CocoaUtils.o -c
>> /Users/trtomei/root/core/macosx/src/CocoaUtils.mm
>> cc1objplus: error: unrecognized command line option "-std=c++11"
>> 
>> Relevant information:
>> 
(Continue reading)

Chris Jones | 12 Jun 2012 22:11
Picon
Picon
Favicon

Re: [ROOT] Compilation problem: ROOT 5.34.00


On 12 Jun 2012, at 9:02pm, Timur Pocheptsov wrote:

> Hi.
> 
>> I'm guessing, but it looks like something in the new (and as the release notes say 'work in progress' ;) )
cocoa backend is enabling this when it shouldn't ?
> 
> *.mm files have a special rule to compile with unconditional C++11 option. As soon as I was asked to remove
all C++11 constructs, I can also remove this option
> (you can also try this, it's in a Makefile, the rule for mm files) - we'll commit this changes into the 5-34 tomorrow.

Can you point me to the exact makefile ? I've been trying to figure out where this was set up, but could quite
find it ?

Chris

> Even so, if you have an old version of clang you can not compile cocoa back-end, this is Objective-C++ and
old compilers have a problem with some of
> names in ROOT's source code, like IsA, etc.
> 
>> I just tried myself, on OSX 10.7, using gcc 4.7, and I get a different error if I try and enable the cocoa backend.
> 
>> g++ -O2 -m64 -pipe -Wshadow -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Iinclude     
-pthread -ObjC++ -std=c++11 -o core/macosx/src/CocoaUtils.o -c /Users/chris/Projects/root/core/macosx/src/CocoaUtils.mm
>> cc1objplus: error: argument to '-O' should be a non-negative integer
> 
> The code is to be compiled with clang.
> 
> On 12 Jun 2012, at 4:39pm, Thiago Tomei wrote:
(Continue reading)

Arthur E. Snyder | 12 Jun 2012 22:41
Picon
Favicon

Re: [ROOT] Compilation problem: ROOT 5.34.00

Hi Rooters,

I find the following weird behavior with cloned |TF1|s:

fp=makePowerLaw();    <---creates a simple power law TF1

make function: lo=1 up=10 power=2 name=powerLaw
(class TF1*)0xa0f6ad0

root [29] fp->Print()
              powerLaw :  Ndim= 1, Npar= 4, Noper= 0
  Par  0                    p0 = 1
  Par  1                    p1 = 2
  Par  2                    p2 = 1
  Par  3                    p3 = 10
root [30]

root [30] fpa=(TF1*)fp->Clone()
(class TF1*)0xa0f6968

root [32] fpa->Print()
              powerLaw :  Ndim= 1, Npar= 4, Noper= 0
  Par  0                    p0 = 1
  Par  1                    p1 = 2
  Par  2                    p2 = 1
  Par  3                    p3 = 10

root [31] fpa->Draw() 
root [32]

(Continue reading)

Arthur E. Snyder | 12 Jun 2012 22:53
Picon
Favicon

[ROOT] TF1 cloning problem (correctiong subject)

> Hi Rooters,
>
> I find the following weird behavior with cloned |TF1|s:
>
> fp=makePowerLaw();    <---creates a simple power law TF1
>
> make function: lo=1 up=10 power=2 name=powerLaw
> (class TF1*)0xa0f6ad0
>
> root [29] fp->Print()
>              powerLaw :  Ndim= 1, Npar= 4, Noper= 0
>  Par  0                    p0 = 1
>  Par  1                    p1 = 2
>  Par  2                    p2 = 1
>  Par  3                    p3 = 10
> root [30]
>
> root [30] fpa=(TF1*)fp->Clone()
> (class TF1*)0xa0f6968
>
> root [32] fpa->Print()
>              powerLaw :  Ndim= 1, Npar= 4, Noper= 0
>  Par  0                    p0 = 1
>  Par  1                    p1 = 2
>  Par  2                    p2 = 1
>  Par  3                    p3 = 10
>
>
> root [31] fpa->Draw()
> root [32]
(Continue reading)

Arthur E. Snyder | 12 Jun 2012 23:06
Picon
Favicon

[ROOT] Re: TF1 cloning problem (correctiong subject)

BTW, the problem does not occur with 'native' functions like 'gaus'

-AE

A.E. Snyder, The Former Group C (TFC)        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder <at> slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:707-313-0250                          Collaboration
                                                 &
                                            Fermi/GLAST

On Tue, 12 Jun 2012, Arthur E. Snyder wrote:

>> Hi Rooters,
>>
>> I find the following weird behavior with cloned |TF1|s:
>>
>> fp=makePowerLaw();    <---creates a simple power law TF1
>>
>> make function: lo=1 up=10 power=2 name=powerLaw
>> (class TF1*)0xa0f6ad0
>>
>> root [29] fp->Print()
>>              powerLaw :  Ndim= 1, Npar= 4, Noper= 0
>>  Par  0                    p0 = 1
>>  Par  1                    p1 = 2
(Continue reading)

Lorenzo Moneta | 13 Jun 2012 09:42
Picon
Picon

Re: [ROOT] TF1 cloning problem (correctiong subject)

Hi, 

 A real Clone (and I/O) of the TF1 object  works only for native or interpreted functions. In case of functions
made from + code, the Clone method just copies the function values in the bin centers, so you cannot use this
function afterwards for fitting, only for plotting. 
You must in that case re-create the function object from the original code

 
 Best Regards

 Lorenzo
On Jun 12, 2012, at 11:06 PM, Arthur E. Snyder wrote:

> BTW, the problem does not occur with 'native' functions like 'gaus'
> 
> -AE
> 
> A.E. Snyder, The Former Group C (TFC)        \!c*p?/
> SLAC Mail Stop #95                          ((.   .))
> Box 4349                                        |
> Stanford, Ca, USA, 94309                      '\|/`
> e-mail:snyder <at> slac.stanford.edu                 o
> phone:650-926-2701                              _
> http://www.slac.stanford.edu/~snyder          BaBar
> FAX:707-313-0250                          Collaboration
>                                                &
>                                           Fermi/GLAST
> 
> 
> 
(Continue reading)

Thiago Tomei | 12 Jun 2012 22:41
Picon
Picon

Re: [ROOT] Compilation problem: ROOT 5.34.00

Hi Chris

Yes, exactly, I wanted to try the new cocoa thing. The notes don't say
that it is specific to clang, gcc > 4.7.x or anything to that effect.
=(

But I do have some version of clang available:

trtomei <at> Thiago-Tomeis-MacBook:~ $ clang -v
Apple clang version 1.7 (tags/Apple/clang-77) (based on LLVM 2.9svn)
Target: x86_64-apple-darwin10
Thread model: posix

Is this good enough?

Thiago

On Tue, Jun 12, 2012 at 4:50 PM, Chris Jones <jonesc <at> hep.phy.cam.ac.uk> wrote:
> Hi,
>
> What configure arguments did you use ? Looks like you tried to enable the new cocoa graphical backend,
which in turn appears to try and use std=c++11. I think this is only supposed to be enabled if you ran with --enable-c++11
>
> c++11              Build using C++11 compatible mode, requires gcc > 4.7.x or clang
>
> which will not work with the old gcc 4.2.1 system compiler.
>
> I'm guessing, but it looks like something in the new (and as the release notes say 'work in progress' ;) )
cocoa backend is enabling this when it shouldn't ?
>
(Continue reading)


Gmane