0
votes

I'm trying to install xps in R, and have installed ROOT from CERN.

during compile I get:

TMLMath.cxx:51:19: fatal error: TMath.h: No such file or directory

 #include "TMath.h"
                   ^
compilation terminated.
make: *** [TMLMath.o] Error 1
ERROR: compilation failed for package ‘xps’

I tried adding this file manually, then another was required, then another, ... until the error was not just missing files but things being redefined (see notes here), and again compile failed.

My ROOT details are:

Version   5.34/14  16 December 2013
ROOT 5.34/14 (heads/v5-34-00-patches@v5-34-13-131-gd110ad3, Jan 07 2014, 00:12:00 on linuxx8664gcc)

CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
whereis root
root: /usr/bin/root /usr/bin/root.exe /etc/root /usr/bin/X11/root /usr/bin/X11/root.exe /usr/include/root /usr/share/root /usr/share/man/man1/root.1.gz

I tried to make uninstall on a freshly downloaded version of root and perhaps worryingly it did nothing (I deleted the folder I originally make'd from)

I'm guessing perhaps the version of ROOT I have is missing some of these because xps relies on an older version of ROOT? The manual shows a very recent date however, so it's not like this is neglected software (if I understand correctly)...

ROOT installed fine, and all prerequisites I could find were installed:

sudo apt-get install build-essential dpkg-dev make g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev gfortran libssl-dev libpcre3-dev libglu1-mesa-dev libglew-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio3-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python-dev libxml2-dev libkrb5-dev libgsl0-dev libqt4-dev xfs xfstt t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi

Any help would be appreciated, please let me know if I ought provide more details of my system.

Full output from Bioconductor installation:

> biocLite('xps')
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.0 (BiocInstaller 1.16.1), R version 3.1.2.
Installing package(s) 'xps'
trying URL 'http://bioconductor.org/packages/3.0/bioc/src/contrib/xps_1.26.0.tar.gz'
Content type 'application/x-gzip' length 6669399 bytes (6.4 Mb)
opened URL
==================================================
downloaded 6.4 Mb

* installing *source* package ‘xps’ ...
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ANSI C... (cached) none needed
found ROOT version 5.34/14 in directory /usr
** libs
** arch - 
g++ -I/usr//include -O2 -Wall -fPIC -pthread -m64 -I/usr/include/root -c TMLMath.cxx
TMLMath.cxx:51:19: fatal error: TMath.h: No such file or directory
 #include "TMath.h"
                   ^
compilation terminated.
make: *** [TMLMath.o] Error 1
ERROR: compilation failed for package ‘xps’
* removing ‘/home/louis/R/x86_64-pc-linux-gnu-library/3.1/xps’

The downloaded source packages are in
    ‘/tmp/RtmpZVOlbW/downloaded_packages’
Warning message:
In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
  installation of package ‘xps’ had non-zero exit status

Edit: I followed ROOTSYS variable changes before running R:

export ROOTSYS=/usr/
export "PATH=$ROOTSYS/bin:$PATH"

I initially had been using ROOTSYS=/usr/include/root, which is where I find the program with whereis root. This gives a different error however - /usr/bin/root/include not a directory. Hence using ROOTSYS=/usr ...

> source("http://bioconductor.org/biocLite.R")
Bioconductor version 3.0 (BiocInstaller 1.16.1), ?biocLite for help
> biocLite('xps')
BioC_mirror: http://bioconductor.org
Using Bioconductor version 3.0 (BiocInstaller 1.16.1), R version 3.1.2.
Installing package(s) 'xps'
trying URL 'http://bioconductor.org/packages/3.0/bioc/src/contrib/xps_1.26.0.tar.gz'
Content type 'application/x-gzip' length 6669399 bytes (6.4 Mb)
opened URL
==================================================
downloaded 6.4 Mb

* installing *source* package ‘xps’ ...
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ANSI C... (cached) none needed
found ROOT version 5.34/14 in directory /usr
** libs
** arch - 
g++ -I/usr/bin/root/include -O2 -Wall -fPIC -pthread -m64 -I/usr/include/root -c TMLMath.cxx
cc1plus: error: /usr/bin/root/include: Not a directory
make: *** [TMLMath.o] Error 1
ERROR: compilation failed for package ‘xps’
* removing ‘/home/louis/R/x86_64-pc-linux-gnu-library/3.1/xps’

The downloaded source packages are in
    ‘/tmp/Rtmpc9EO9W/downloaded_packages’
Warning messages:
1: In install.packages(pkgs = pkgs, lib = lib, repos = repos, ...) :
  installation of package ‘xps’ had non-zero exit status
2: installed directory not writable, cannot update packages 'maptools'
1
Did you follow these instructions, particularly the shell variable ROOTSYS?user3710546
Ah, well yes, they didn't work oddly, please see the edit I just made - it doesn't find the directory at all in that case, hence I just set ROOTSYS to /usr/ ... I don't think I set these before installing ROOT itself (which does seem to work)Louis Maddox
The error message is /usr/bin/root/include: Not a directory meaning the compiler is trying to enter this directory, which doesn't exist. For example, what is the output of locate TMLMath.h or similar command?user3710546
locate TMLMath.h returns nothing, locate TMath.h gives my Downloads folder... ~/Downloads/root-6.02.04/include/TMath.h ~/Downloads/root-6.02.04/math/mathcore/inc/TMath.hLouis Maddox
ROOT doesn't look correctly installed then.user3710546

1 Answers

0
votes

As pointed out in the comments above, ROOT was not correctly installed - I just got contacted by someone with the same problem thinking it was unsolved (I'd left notes on the solution here rather than on this question). I know S.O. policy is to include the fix rather than link out, so I'm pasting it below the following section divider. At a guess I'd say the advice given to use v5.34.24 rather than production should still apply (perhaps it will be specified somewhere, or else someone can contact the maintainer again). [I've taken out a section on a manual fix that didn't work]


Prerequisites

(Via Elena Graverini's blog)

Prerequisites:

sudo apt-get install build-essential git subversion dpkg-dev make g++ gcc binutils libx11-dev libxpm-dev libxft-dev libxext-dev

Optional (recommended) prerequisites:

sudo apt-get install gfortran libssl-dev libpcre3-dev libglu1-mesa-dev libglew-dev libftgl-dev libmysqlclient-dev libfftw3-dev libcfitsio3-dev graphviz-dev libavahi-compat-libdnssd-dev libldap2-dev python-dev libxml2-dev libkrb5-dev libgsl0-dev libqt4-dev

Install font server and fonts for ROOT:

sudo apt-get install xfs xfstt
sudo apt-get install t1-xfree86-nonfree ttf-xfree86-nonfree ttf-xfree86-nonfree-syriac xfonts-75dpi xfonts-100dpi

Installation

gzip -dc root_v5.34.24.source.tar.gz | tar -xf -
mv root ~
cd ~/root
./configure --all
make -j N

where N is the number of CPU cores on your machine (cat /proc/cpuinfo | grep 'cpu cores')

  • For Ubuntu 14.04 run: sudo mkdir /usr/include/freetype && sudo cp /usr/include/freetype2/freetype.h /usr/include/freetype/freetype.h
    • If you're uninstalling don't forget to take this out too

Removing Ubuntu's version of ROOT resolves ld errors in make

sudo apt-get purge root-system root-system-bin root-system-common export ROOTSYS=/home/louis/root

Rerunning make with config as ./configure --prefix=/home/louis/ works

  • I think the prefix flag is equivalent to setting the ROOTSYS variable before make (I was using multiple guides and forgot to set it, but it worked regardless)
  • The CERN ROOT installation from source page notes that make install is a "NOOP"... but it isn't installed unless you run this after make, so do it anyway

Last step is to add $ROOTSYS/bin to PATH - add source ~/bin/thisroot.sh to your ~/.bashrc (assuming your .bashrc is already sourced in new terminals)

  • For me, ROOTSYS is now set in shells. The xps README suggests you set it, but PATH isn't, so I proceeded to add the following to my .bashrc:
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

ROOT should now be operational, and able to compile xps...

  • For some reason LD_LIBRARY_PATH doesn't get set but PATH does...? .bashrc is otherwise all working as expected
cd $ROOTSYS/tutorials`
root
root [0] .x demos.C

If no errors appear, ROOT is working.

Installing xps

I'd expect biocLite('xps') to fail as the binary was created with ROOT v.5.34.05... but the v5.34.24 was recommended by the maintainer so attempt it anyway:

source("http://bioconductor.org/biocLite.R")
biocLite("xps")

and it works :-)

  • It's also possible to download from source and bypass Bioconductor by running R CMD INSTALL xps_1.26.0.tar.gz
  • RootTalk Discussion Forums (including a ROOT Support forum): https://root.cern.ch/phpBB3/