我尝试在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'
答案 0 :(得分:0)
正如上面的评论所指出的那样,ROOT没有正确安装 - 我遇到了一个有同样问题的人联系我认为它没有解决(我在解决方案上留下了注释here而不是这个问题)。我知道这样。策略是包含修复而不是链接,所以我将它粘贴到以下部分下面的分隔符。猜测我会说使用v5.34.24而不是生产的建议应该仍然适用(可能会在某处指定,否则有人可以再次联系维护者)。 [我已经拿出一个关于手动修复但没有用的部分]
先决条件:
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
xps
的开发者推荐截至2015年2月4日的5.34.24 source.tar.gz
文件
/usr/
目录中(xps
开发者建议通过电子邮件),因为很多可用的指南建议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'
)
sudo mkdir /usr/include/freetype && sudo cp /usr/include/freetype2/freetype.h /usr/include/freetype/freetype.h
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
...
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