安装ROOT后,无法编译xps,缺少库

时间:2015-02-04 10:27:58

标签: c++ r gcc g++ bioconductor

我尝试在R中安装xps,并已从CERN安装了ROOT

在编译期间我得到:

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’

我尝试手动添加此文件,然后另一个需要,然后另一个,...直到错误不仅仅是丢失文件而是重新定义的内容(请参阅notes here),并再次编译失败。

我的ROOT详细信息是:

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

我尝试make uninstall新下载的root版本,可能令人担忧的是它没有做任何事情(我删除了原来的文件夹make' d)

我猜测我的ROOT版本可能缺少其中一些,因为xps依赖于旧版本的ROOT?但手册显示的是最近的日期,所以它不是被忽视的软件(如果我理解正确的话)...

ROOT安装正常,并安装了all prerequisites I could find

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

任何帮助将不胜感激,如果我应该提供我的系统的更多细节,请告诉我。

Bioconductor安装的完整输出:

> 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

编辑:我在运行R:

之前跟踪了ROOTSYS变量
export ROOTSYS=/usr/
export "PATH=$ROOTSYS/bin:$PATH"

我最初使用ROOTSYS=/usr/include/root,这是我找到whereis root程序的地方。但这会产生不同的错误 - /usr/bin/root/include not a directory。因此使用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 个答案:

答案 0 :(得分:0)

正如上面的评论所指出的那样,ROOT没有正确安装 - 我遇到了一个有同样问题的人联系我认为它没有解决(我在解决方案上留下了注释here而不是这个问题)。我知道这样。策略是包含修复而不是链接,所以我将它粘贴到以下部分下面的分隔符。猜测我会说使用v5.34.24而不是生产的建议应该仍然适用(可能会在某处指定,否则有人可以再次联系维护者)。 [我已经拿出一个关于手动修复但没有用的部分]

先决条件

(通过Elena Graverini's blog

先决条件:

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

可选(推荐)先决条件:

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

为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

安装

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

其中N是计算机上的CPU核心数(cat /proc/cpuinfo | grep 'cpu cores'

  • 对于Ubuntu 14.04运行: sudo mkdir /usr/include/freetype && sudo cp /usr/include/freetype2/freetype.h /usr/include/freetype/freetype.h
    • 如果您正在卸载,请不要忘记将其删除

删除Ubuntu版本的ROOT可解决ld

中的make错误

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

使用配置重新运行make ./configure --prefix=/home/louis/正常工作

  • 我认为前缀标记相当于在ROOTSYS之前设置make变量(我使用了多个指南而忘记设置它,但无论如何都有效)
  • make install注意make是“CERN ROOT installation from source page”...但除非您在source ~/bin/thisroot.sh之后运行,否则不会安装,所以无论如何都要这样做< / LI>

最后一步是将$ ROOTSYS / bin添加到PATH - 将~/.bashrc添加到ROOTSYS(假设你的.bashrc已经在新终端中提供)

  • 对我来说,ROOT现在设置在shell中。 NOOP建议您设置它,但PATH不是,所以我继续将以下内容添加到我的.bashrc中:
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH

xps现在应该可以投放,并且可以编译xps ...

  • 由于某种原因LD_LIBRARY_PATH没有设置但是PATH确实......? .bashrc否则全部按预期工作
cd $ROOTSYS/tutorials`
root
root [0] .x demos.C

如果没有出现错误,ROOT正在工作。

正在安装R CMD INSTALL xps_1.26.0.tar.gz

我希望biocLite('xps')失败,因为二进制文件是用ROOT v.5.34.05创建的......但v5.34.24是维护者推荐的,所以无论如何都要尝试:

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

它有效: - )

  • 也可以通过运行lxml.objectify
  • 从源下载并绕过Bioconductor
  • RootTalk 讨论论坛(包括The xps README论坛):ROOT Support