无法在OSX 10.8 / Ubuntu 14.x上编译pyglpk

迈克尔·巴顿

我正在努力在OSX 10.8上编译PyGLPK。我已经通过自制软件安装了glpk和gmp。我已验证以下文件都在/ usr / local / include中

gmp.h
gmpxx.h
glpk.h

但是我仍然收到以下错误。

python setup.py build
running build
running build_ext
building 'glpk' extension
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Isrc -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/glpk.c -o build/temp.macosx-10.9-x86_64-2.7/src/glpk.o -m32
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -Isrc -I/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lp.c -o build/temp.macosx-10.9-x86_64-2.7/src/lp.o -m32
In file included from src/lp.c:24:
src/kkt.h:30:3: error: unknown type name 'LPXKKT'
  LPXKKT kkt;
  ^
src/lp.c:182:18: warning: implicit declaration of function 'lpx_read_model' is invalid in C99 [-Wimplicit-function-declaration]
      self->lp = lpx_read_model(model[0], model[1], model[2]);
                 ^
src/lp.c:182:16: warning: incompatible integer to pointer conversion assigning to 'glp_prob *' (aka 'struct glp_prob *') from 'int' [-Wint-conversion]
      self->lp = lpx_read_model(model[0], model[1], model[2]);
               ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/lp.c:338:7: warning: implicit declaration of function 'lpx_read_bas' is invalid in C99 [-Wimplicit-function-declaration]
  if (lpx_read_bas(LP, bas_filename)) {
      ^
src/lp.c:349:8: error: use of undeclared identifier 'LPX_E_OK'
  case LPX_E_OK:        Py_RETURN_NONE;
       ^
src/lp.c:350:8: error: use of undeclared identifier 'LPX_E_FAULT'
  case LPX_E_FAULT:     return PyString_FromString("fault");
       ^
src/lp.c:351:8: error: use of undeclared identifier 'LPX_E_OBJLL'
  case LPX_E_OBJLL:     return PyString_FromString("objll");
       ^
src/lp.c:352:8: error: use of undeclared identifier 'LPX_E_OBJUL'
  case LPX_E_OBJUL:     return PyString_FromString("objul");
       ^
src/lp.c:353:8: error: use of undeclared identifier 'LPX_E_ITLIM'
  case LPX_E_ITLIM:     return PyString_FromString("itlim");
       ^
src/lp.c:354:8: error: use of undeclared identifier 'LPX_E_TMLIM'
  case LPX_E_TMLIM:     return PyString_FromString("tmlim");
       ^
src/lp.c:355:8: error: use of undeclared identifier 'LPX_E_SING'
  case LPX_E_SING:      return PyString_FromString("sing");
       ^
src/lp.c:357:8: error: use of undeclared identifier 'LPX_E_NOPFS'
  case LPX_E_NOPFS:     return PyString_FromString("nopfs");
       ^
src/lp.c:358:8: error: use of undeclared identifier 'LPX_E_NODFS'
  case LPX_E_NODFS:     return PyString_FromString("nodfs");
       ^
src/lp.c:360:8: error: use of undeclared identifier 'LPX_E_NOFEAS'
  case LPX_E_NOFEAS:    return PyString_FromString("nofeas");
       ^
src/lp.c:361:8: error: use of undeclared identifier 'LPX_E_NOCONV'
  case LPX_E_NOCONV:    return PyString_FromString("noconv");
       ^
src/lp.c:362:8: error: use of undeclared identifier 'LPX_E_INSTAB'
  case LPX_E_INSTAB:    return PyString_FromString("instab");
       ^
src/lp.c:492:16: warning: implicit declaration of function 'lpx_exact' is invalid in C99 [-Wimplicit-function-declaration]
  int retval = lpx_exact(LP);
               ^
src/lp.c:493:15: error: use of undeclared identifier 'LPX_E_FAULT'
  if (retval!=LPX_E_FAULT) self->last_solver = 0;
              ^
src/lp.c:498:16: warning: implicit declaration of function 'lpx_interior' is invalid in C99 [-Wimplicit-function-declaration]
  int retval = lpx_interior(LP);
               ^
src/lp.c:499:15: error: use of undeclared identifier 'LPX_E_FAULT'
  if (retval!=LPX_E_FAULT) self->last_solver = 1;
              ^
src/lp.c:708:16: warning: implicit declaration of function 'lpx_intopt' is invalid in C99 [-Wimplicit-function-declaration]
  int retval = lpx_intopt(LP);
               ^
src/lp.c:709:15: error: use of undeclared identifier 'LPX_E_FAULT'
  if (retval!=LPX_E_FAULT) self->last_solver = 2;
              ^
src/lp.c:730:3: warning: implicit declaration of function 'lpx_check_kkt' is invalid in C99 [-Wimplicit-function-declaration]
  lpx_check_kkt(LP, scaling, &(kkt->kkt));
  ^
src/lp.c:737:3: warning: implicit declaration of function 'lpx_check_int' is invalid in C99 [-Wimplicit-function-declaration]
  lpx_check_int(LP, &(kkt->kkt));
  ^
src/lp.c:744:26: error: unknown type name 'LPX'
  static int(*writers[])(LPX*,const char*) = {
                         ^
src/lp.c:745:5: error: use of undeclared identifier 'lpx_write_mps'; did you mean 'glp_write_mps'?
    lpx_write_mps, lpx_write_bas, 
    ^~~~~~~~~~~~~
    glp_write_mps
/usr/local/include/glpk.h:723:5: note: 'glp_write_mps' declared here
int glp_write_mps(glp_prob *P, int fmt, const glp_mpscp *parm,
    ^
src/lp.c:745:20: error: use of undeclared identifier 'lpx_write_bas'
    lpx_write_mps, lpx_write_bas, 
                   ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
8 warnings and 20 errors generated.
error: command 'clang' failed with exit status 1
make: *** [all] Error 1

有人可以提出解决建议吗?我尝试过使用路径和环境变量,但是没有任何效果。

艾琳·谢尔曼(Erin Shellman)

不确定这是否是一般修复程序,但它解决了我对GLPK的特殊需求。我只是恢复到较旧的版本,并且可以正常工作。

首先卸载最新的:

brew remove glpk

然后安装一个旧的(4.39)。

cd $(brew --prefix)
git checkout a82e823 Library/Formula/glpk.rb
brew install glpk

然后这很好用:

pip install glpk

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法在Ubuntu 14上运行IDEA 14

来自分类Dev

PHP无法在ubuntu 14上运行

来自分类Dev

无法在Dell Inspiron 14Z上安装Ubuntu 12.04

来自分类Dev

在Windows 10旁边安装Ubuntu 14 LTS

来自分类Dev

即使在Ubuntu 14,10中配置了以太网接口后也无法连接Internet

来自分类Dev

将VMWare Ubuntu 14上的文件夹共享到主机Windows10

来自分类Dev

SMB无法在Windows 8/10上运行

来自分类Dev

无法在Ubuntu上安装Postgresql 10

来自分类Dev

Ubuntu 14上的MySql Workbench

来自分类Dev

Ubuntu 14上的MySql Workbench

来自分类Dev

无法在wine Ubuntu上安装JDK 8

来自分类Dev

无法在 Ubuntu 19.04 上安装 MySQL 8

来自分类Dev

无法在 Ubuntu 8 上安装 OpenSSL 1.1

来自分类Dev

Maven项目无法在OSX上使用Java 8进行编译

来自分类Dev

Maven项目无法在OSX上使用Java 8进行编译

来自分类Dev

自2016年8月14日起,Skype无法从Ubuntu 16.04连接。我该如何解决?

来自分类Dev

无法打开Nano,也无法在Ubuntu Server 14上安装它

来自分类Dev

新系统无法识别硬盘(ubuntu 14)

来自分类Dev

WIN10上的VMWARE Workstation Player 14与4K上的Ubuntu 18.04固定DPI缩放比例

来自分类Dev

v8 NAN支持从Nodejs 10迁移到14

来自分类Dev

如何从Ubuntu 14访问Windows 8驱动器?

来自分类Dev

无法在Lenovo Ideapad S205上安装Ubuntu 14 LTS(64bit)

来自分类Dev

Wifi无法在Ubuntu 16.04 ACER Aspire E14上运行

来自分类Dev

Mac Pro上的Ubuntu 14 Server无法在关机时关机

来自分类Dev

Windows上的Ubuntu上的Bash(10)-无法连接到Upstart

来自分类Dev

如何在Ubuntu 14.x上安装Netbeans 8.0.2

来自分类Dev

如何重启在Ubuntu 14.x版本上运行的进程

来自分类Dev

VMWare 10 Windows 8(主机)Ubuntu 14.04(来宾)共享文件夹无法挂载

来自分类Dev

在Dell Inspiron 14 7490上安装Ubuntu

Related 相关文章

  1. 1

    无法在Ubuntu 14上运行IDEA 14

  2. 2

    PHP无法在ubuntu 14上运行

  3. 3

    无法在Dell Inspiron 14Z上安装Ubuntu 12.04

  4. 4

    在Windows 10旁边安装Ubuntu 14 LTS

  5. 5

    即使在Ubuntu 14,10中配置了以太网接口后也无法连接Internet

  6. 6

    将VMWare Ubuntu 14上的文件夹共享到主机Windows10

  7. 7

    SMB无法在Windows 8/10上运行

  8. 8

    无法在Ubuntu上安装Postgresql 10

  9. 9

    Ubuntu 14上的MySql Workbench

  10. 10

    Ubuntu 14上的MySql Workbench

  11. 11

    无法在wine Ubuntu上安装JDK 8

  12. 12

    无法在 Ubuntu 19.04 上安装 MySQL 8

  13. 13

    无法在 Ubuntu 8 上安装 OpenSSL 1.1

  14. 14

    Maven项目无法在OSX上使用Java 8进行编译

  15. 15

    Maven项目无法在OSX上使用Java 8进行编译

  16. 16

    自2016年8月14日起,Skype无法从Ubuntu 16.04连接。我该如何解决?

  17. 17

    无法打开Nano,也无法在Ubuntu Server 14上安装它

  18. 18

    新系统无法识别硬盘(ubuntu 14)

  19. 19

    WIN10上的VMWARE Workstation Player 14与4K上的Ubuntu 18.04固定DPI缩放比例

  20. 20

    v8 NAN支持从Nodejs 10迁移到14

  21. 21

    如何从Ubuntu 14访问Windows 8驱动器?

  22. 22

    无法在Lenovo Ideapad S205上安装Ubuntu 14 LTS(64bit)

  23. 23

    Wifi无法在Ubuntu 16.04 ACER Aspire E14上运行

  24. 24

    Mac Pro上的Ubuntu 14 Server无法在关机时关机

  25. 25

    Windows上的Ubuntu上的Bash(10)-无法连接到Upstart

  26. 26

    如何在Ubuntu 14.x上安装Netbeans 8.0.2

  27. 27

    如何重启在Ubuntu 14.x版本上运行的进程

  28. 28

    VMWare 10 Windows 8(主机)Ubuntu 14.04(来宾)共享文件夹无法挂载

  29. 29

    在Dell Inspiron 14 7490上安装Ubuntu

热门标签

归档