Opened 12 years ago

Closed 12 years ago

#36004 closed defect (invalid)

root: error: token is not a valid binary operator in a preprocessor subexpression

Reported by: jfcaron3 Owned by: mattiafrancescomoro@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: cjones051073 (Chris Jones)
Port: root

Description

The port root (+python27 +fftw3) fails to build. As far as I know it has always failed, why is this port so problematic? Nearly all other ports just work when you install them.

xcode 4.2.1 on a MacBook Pro, MacOS 10.7.4

Attachments (1)

main.log (576.2 KB) - added by jfcaron3 12 years ago.
failed build log

Download all attachments as: .zip

Change History (18)

Changed 12 years ago by jfcaron3

Attachment: main.log added

failed build log

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: jonesc@… added
Keywords: root build fail removed
Owner: changed from macports-tickets@… to mattiafrancescomoro@…
Summary: root port fails to buildroot: error: token is not a valid binary operator in a preprocessor subexpression

comment:2 Changed 12 years ago by cjones051073 (Chris Jones)

The root port does not always fail to build. It works just fine for most people.

Take a look at

http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=14614

which I think describes your problem. Basically, my bet is your llvm version is too old. Follow the instructions to update your command line tools.

Chris

comment:3 Changed 12 years ago by jfcaron3

In this case the port compiles properly, but something is apparently not working in the configuration step. See here: http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=15072

Unfortunately I can't glean a solution from those forum posts, other than "Don't use the macports one and built it yourself."

comment:4 in reply to:  3 Changed 12 years ago by jfcaron3

Replying to jfcaron@…:

In this case the port compiles properly, but something is apparently not working in the configuration step. See here: http://root.cern.ch/phpBB3/viewtopic.php?f=3&t=15072

Unfortunately I can't glean a solution from those forum posts, other than "Don't use the macports one and built it yourself."

Sorry I left out some details: I updated my XCode and the CLI package, then built the root port (with +python27 and +fftw3). It compiled fine, but then when running I had the issue mentioned above.

comment:5 Changed 12 years ago by cjones051073 (Chris Jones)

In your original post you said you where using the cocoa variant. When using this, you use the native OS X Quartx graphics, and not X11. In that case, the above link you provide is not really relevant at all.

So which is it, are you using the cocoa variant or not ? Note that the cocoa variant is (very) experimental. If you are using it, and having issues, I suggest try running without it first and make sure everything works fine there first...

The link also refers to OS X 10.8, whereas you said you where using 10.7. Which is it ?

With 10.7, you could either be using the stock X11 provided by Apple, or Xquartz. With 10.8, Apple has removed their own X11, so XQuartz is the only option.

I just tried myself using OS X 10.8 and Xcode 4.4.1, and I was not able to reproduce the issue discussed above, creating a new TCanvas using either X11 (XQuartz 2.7.3) or native OS X graphics....

what do you get if you run

echo $DISPLAY

at the command line ?

If should look something line

Chris-Jones-Macbook-Pro ~ > echo $DISPLAY
/tmp/launch-B7yZDP/org.macosforge.xquartz:0

Does it ?

if you see anything like "localhost:0.0" then most likely you are incorrectly overriding your DISPLAY settings in one of your ~/.* config files which you should then remove.

I personally only have 10.8 machines now, so if the issue is specific to 10.7, I'm not going to be able to reproduce it I'm afraid....

Chris

comment:6 Changed 12 years ago by jfcaron3

The link I provided was found on ROOT Talk as a potential solution, it was linked when I posted myself about this particular problem. It sounded like it was a potential solution that would go in the configuration part of the portfile or something. Indeed in their post they mention cocoa and 10.8, but I was not using them.

I am using 10.7.4 with XCode now 4.4.1. I am trying to use the port: root +python27 +fftw3, which builds but then seems to not work properly in the graphics department. echo $DISPLAY says: /tmp/launch-MeooNC/org.x:0 .

I also tried separately uninstalling and reinstalling with +cocoa. The $DISPLAY is the same, and the behavior is the same. The only "xquartz" that I have from macports is qt4-mac+quartz, but I don't have an actual quartz port.

comment:7 in reply to:  6 Changed 12 years ago by jfcaron3

Replying to jfcaron@…:

The link I provided was found on ROOT Talk as a potential solution, it was linked when I posted myself about this particular problem. It sounded like it was a potential solution that would go in the configuration part of the portfile or something. Indeed in their post they mention cocoa and 10.8, but I was not using them.

I am using 10.7.4 with XCode now 4.4.1. I am trying to use the port: root +python27 +fftw3, which builds but then seems to not work properly in the graphics department. echo $DISPLAY says: /tmp/launch-MeooNC/org.x:0 .

I also tried separately uninstalling and reinstalling with +cocoa. The $DISPLAY is the same, and the behavior is the same. The only "xquartz" that I have from macports is qt4-mac+quartz, but I don't have an actual quartz port.

I just installed XQuartz 2.7.3, logged out and in, uninstalled root, re-installed (with just +python27 and +fftw3). Now $DISPLAY is /tmp/launch-liKLue/org.macosforge.xquartz:0 and the behavior is the same.

comment:8 Changed 12 years ago by cjones051073 (Chris Jones)

Can we first prove you have a working X11 environment. Make sure Xquartz is not running, go to a terminal and run 'xclock'. This should trigger XQuartx to start, and eventually you should see the clock. Does this work for you.

I have not heard of any other reports of problems like yours, and I cannot reproduce it in any way, so for the moment my best bet is some issue in your setup.

Chris

comment:9 Changed 12 years ago by cjones051073 (Chris Jones)

The link you provide discusses the etcdir setting when root is configured. In MacPorts, for the root port the setting

 --etcdir=${prefix}/etc/root

is used. ${prefix} is your base MacPorts installation area. The default, which I use is /opt/local. So for me I see

Chris-Jones-Macbook-Pro ~ > ls /opt/local/etc/root/
HistFactorySchema.dtd	hostcert.conf		svninfo.txt
Makefile.arch		html			system.plugins-ios
RadioNuclides.txt	pdg_table.txt		system.rootauthrc
class.rules		plugins			system.rootdaemonrc
cmake			proof			system.rootrc
daemons			root.desktop		valgrind-root.supp
gdb-backtrace.sh	root.mimes		vmc

Which seems fine. What do you have ?

Chris

comment:10 Changed 12 years ago by cjones051073 (Chris Jones)

a few other thoughts on things to try.

Can you try installing the binary version, instead of building it yourself. You can do this by installing the default version, no variants. Make sure the installation does not run the build phase. See if this version works.

Or, try building using one of the gcc variants, such as +gcc47. This will build using MacPorts gcc 4.7 compiler.

Chris

comment:11 Changed 12 years ago by jfcaron3

xclock test: xclock eventually opens an XQuartz window with the clock on it.

ls /opt/local/etc/root/ has identical contents to yours.

I tried installing the binary version by not requesting variants. There was no build phase. The result is the same: TBrowser tb;, the object is created but there is no window. Same with TCanvas and TH1F and such.

I also found this old suggestion from Rene Brun, which I tried to no avail: http://root.cern.ch/root/roottalk/roottalk03/1272.html

I recompiled with +gcc45 (which was already installed on my system). Again the result is the same.

comment:12 Changed 12 years ago by cjones051073 (Chris Jones)

Can you test running the binaries from the ROOT page, so by-pass MacPorts entirely ?

http://root.cern.ch/drupal/content/production-version-534

Do you have any custom configs, in ~/.rootc ? If so try removing that.

Can you run 'port installed', pipe the output to a file and post it here. I want to see what other ports you have installed.

Failing that, I am out of ideas. What you describe is not a problem I have heard any other reports of, so I still think it has to be something specific to your setup.

Chris

comment:13 Changed 12 years ago by cjones051073 (Chris Jones)

One other question. Have you changed anything in your MacPorts setup ? For instance to change the target type (32/64 bits, universal etc.) ?

comment:14 Changed 12 years ago by cjones051073 (Chris Jones)

Can I also check your ports are all generally up to date ? Can you run

sudo port selfupdate
sudo port sync
sudo port upgrade outdated

to make sure.

Chris

comment:15 Changed 12 years ago by jfcaron3

Wow, I did have a ~/.rootrc from my previous installation, but I recall having looked in there to make sure there weren't any X11-related options set. I moved the .rootrc file and now everything works as expected. Thank you for the suggestions and for helping find the problem!

comment:16 Changed 12 years ago by cjones051073 (Chris Jones)

No problem, glad you eventually found your problem (and also that there is no issue with the port... ;) )

comment:17 Changed 12 years ago by mf2k (Frank Schima)

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.