【问题标题】:Can't compile and run minisat+ sat solver无法编译和运行 minisat+ sat 求解器
【发布时间】:2013-06-11 23:36:03
【问题描述】:

我使用我大学系的一台 Cent0S 机器。请注意,我没有权限使用我以 root 身份使用的系统。我下载了minisat+zip file

我解压了zip。根据我运行的安装文件

做 rx

但我有以下结果:

Makefile:96: depend.mak: No such file or directory
Making dependencies...
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
In file included from ./Main.h:23,
                 from <command-line>:0:
ADTs/Int.h:101:17: error: gmp.h: No such file or directory
make: *** [depend.mak] Error 1

我也从github下载了minisat+。

我使用

运行它

制作

进行安装

但我仍然有错误。 有人告诉我,我需要安装 gmp 和 gmp-devel?是吗?

可能有帮助的东西:我不确定我是否有 root 用户密码,因为我在大学的实验室工作。

有人如何正确运行 minisat+ 吗?

【问题讨论】:

    标签: c linux compilation cc


    【解决方案1】:

    看起来 minisat 依赖于GNU MP Bignum library (gmp)。你的系统上安装了 libgmp 吗?


    更新:在您没有 root 访问权限的系统上安装库

    由于您使用的是没有 root 访问权限的大学计算机,因此您有两种选择:

    1. 请大学工作人员的一些 IT 人员为您在计算机上安装 libgmp。这可能是最简单的方法,具体取决于系统管理员的顺从程度。

    2. 结束Superuser is a thread discussing how to install packages a normal user。之后,您仍然需要将库搜索路径(使用-L 开关)添加到minisat 包的Makefile 中的CFLAGS

    3. 您可以像这样手动构建 libgmp: 完成后,您还必须像使用选项 #2 一样修改 minisat-Makefile .

      $ cd 
      $ mkdir opt/gmp
      
      $ wget ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2
      $ tar -xjvf gmp-5.1.2.tar.bz2
      
      $ cd gmp-5.1.2
      
      $ ./configure --prefix=~/opt/gmp/ &&
      $ make &&
      // this will install libgmp into /home/your-login/opt/gmp/
      $ make install
      

    【讨论】:

    • 如何查看我的系统上是否安装了 libgmp?
    • @Dchris 取决于。您使用的是什么操作系统?
    • @Dchris 我从未使用过 CentOS,但您应该可以通过在控制台中输入 yum install gmp 来安装它。尽管您在大学计算机上可能没有足够的权限
    • 我无法安装 libgmp,因为我没有 root 权限
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多