我使用 Ubuntu 14.0。我想安装root。所以我按照说明进行操作:
我被困在第四步了。我下载并解压到ROOT目录下
主页/约翰/根
我决定将其安装在目录中
家/约翰/根
所以我创建了该文件夹并进入了它。现在我想执行cmake:
cmake home/john/根
但我收到以下错误:
CMake Error at CMakeLists.txt:9 (find_package):
By not providing "FindROOT.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "ROOT", but
CMake did not find one.
Could not find a package configuration file provided by "ROOT" with any of
the following names:
ROOTConfig.cmake
root-config.cmake
Add the installation prefix of "ROOT" to CMAKE_PREFIX_PATH or set
"ROOT_DIR" to a directory containing one of the above files. If "ROOT"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
See also "/home/john/Root/CMakeFiles/CMakeOutput.log".
它基本上告诉我该怎么做。所以我在 CMakeLists 文件的末尾添加了以下行:
SET(CMAKE_INSTALL_PREFIX /home/john/Root/)
然而,这根本没有帮助。
我尝试用谷歌搜索错误,但其他人都说我应该将 CMAKE_INSTALL_PREFIX 设置为源路径。我已经这样做了,但它不起作用。为什么?
答案1
按照说明进行操作[1]我在子目录中做了~/home/Root
;然后我下载了源文件浏览页面[2]并选择文件root_v6.06.00.source.tar.gz
。
wget https://root.cern.ch/download/root_<version>.source.tar.gz
tar -zxf root_<version>.source.tar.gz
然后我进入版本目录(在我的例子中~/Root/root-6.06.00
)。
然后我忘记了 cmake 并使用configure
目录中存在的文件:
./configure # It founds something and misses other
./configure --all # Just to enable something more
make -j4 # I used 4 cores to compile in parallel
# Take a good nap... (> 22 minutes)
# Obtained some white and pink warnings (see below) then finally
============================================================
=== ROOT BUILD SUCCESSFUL. ===
=== Run 'source bin/thisroot.[c]sh' before starting ROOT ===
============================================================
然后,因为我有一个 bash shell,所以我写了
source bin/thisroot.sh # Set some variable
bin/root # Execute ROOT
并获得
------------------------------------------------------------
| Welcome to ROOT 6.06/00 http://root.cern.ch |
| (c) 1995-2014, The ROOT Team |
| Built for linuxx8664gcc |
| From tag v6-06-00, 9 December 2015 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
root [0]
笔记:
警告消息
/usr/include/qt4/QtCore/qmetatype.h:256:5:
warning: 'register' 存储类说明符已弃用 [-Wdeprecated-register]您可以第二次安装
./configure | grep no
并安装您错过的库,然后再次重做:-)。Tar 文件大小 103 MB,打开 305MB,编译+源 1.3GB