首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CMake CMakeLists.txt:13错误(find_package):在CMAKE_MODULE_PATH中不提供"FindGeant4.cmake“

CMake CMakeLists.txt:13错误(find_package):在CMAKE_MODULE_PATH中不提供"FindGeant4.cmake“
EN

Ask Ubuntu用户
提问于 2017-03-07 20:59:32
回答 2查看 7.3K关注 0票数 0

我在Linux系统上安装Geant4时遇到了问题。

代码语言:javascript
复制
$ cmake ..
CMake Error at CMakeLists.txt:13 (find_package):
  By not providing "FindGeant4.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Geant4", but
  CMake did not find one.

  Could not find a package configuration file provided by "Geant4" with any
  of the following names:

    Geant4Config.cmake
    geant4-config.cmake

  Add the installation prefix of "Geant4" to CMAKE_PREFIX_PATH or set
  "Geant4_DIR" to a directory containing one of the above files.  If "Geant4"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring incomplete, errors occurred!
See also "/home/dell/Desktop/geant4/geant4.9.6/examples/basic/B1/build/CMakeFiles/CMakeOutput.log".

我试过:

代码语言:javascript
复制
apt-get install g++

但我明白:

代码语言:javascript
复制
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
EN

回答 2

Ask Ubuntu用户

发布于 2017-07-20 06:57:49

您只需获取geant4.sh

在bash中,发出命令:

代码语言:javascript
复制
source /path_to_geant4_install/bin/geant4.sh

然后做cmake

票数 1
EN

Ask Ubuntu用户

发布于 2020-07-02 10:51:52

我也有类似的问题。

.bashrc中添加这些命令可能会有所帮助:

代码语言:javascript
复制
source /home/user/geant4-install directory/bin/geant4.sh

source /home/user/geant4-install directory/share/geant4-version number/geant4make/geant4make.sh

export G4WORKDIR=/home/user/g4work
票数 1
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/890653

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档