Linux Ubuntu16.04 pip安装pyscipopt

本文详细介绍了如何在Linux Ubuntu 16.04上通过pip安装pyscipopt,包括下载和安装SCIP组件的步骤,以及配置环境变量的过程。首先解释了pyscipopt的作用,然后详细阐述了下载安装SCIPoptsuit的I和II部分,最后成功安装pyscipopt并验证其可用性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Linux Ubuntu16.04 pip安装pyscipopt



一、pyscipoopt是什么?

SCIP 是一个解决约束整数规划 (CIP) 和混合整数非线性规划的框架。SCIP 结合了混合整数规划 (MIP) 求解器以及基于 LP 的混合整数非线性规划 (MINLP) 求解器,并且是分支切割和定价的框架。
SCIP is a framework to solve constraint integer programs (CIPs) and mixed-integer nonlinear programs. In particular, SCIP incorporates a mixed-integer programming (MIP) solver as well as an LP based mixed-integer nonlinear programming (MINLP) solver, and is a framework for branch-and-cut-and-price.
参考官方文档: doc

二、安装scipoptsuit组件

scip官网:https://scipopt.org/

1.下载scip安装文件

在Download下,选择平台类型和需要下载的版本型号,这里我选择4.0.0版本。下分别点击下面出现对应的下载文件链接。
在这里插入图片描述
点击下载链接,将跳转到信息统计界面。填写基本信息,选择非商用选项,点击Start Download进行下载。
在这里插入图片描述下载完成scipoptsuite-4.0.0.tgz、scipoptheaders-4.0.0.tgz、
scip-4.0.0.tgz三个文件后在本地解压。

2.安装scipoptsuit

打开scipoptsuit-4.0.0文件夹并用gedit打开INSTALL文件,将会显示具体的安装步骤。

cd scipoptsuit-4.0.0
gedit ./INSTALL

The SCIP Optimization Suite consists of the following five software tools:

  1. ZIMPL - the Zuse Institute Mathematical Programming language
  2. SoPlex - the Sequential Object Oriented Simplex
  3. SCIP - Solving Constraint Integer Programs
  4. GCG - Generic Column Generation
  5. UG - Ubiquity Generator Framework

I Creating a SCIP binary and the individual libraries
II Creating a single library containing SCIP, SoPlex, and ZIMPL
III Creating GCG and UG

这里根据需求我需要执行I和II步骤。

I、 Creating a SCIP binary and the individual libraries

cd scipoptsuit-4.0.0
make

如果gcc 编译器版本<4.2 ,需要执行:

cd scipoptsuit-4.0.0
make LPSOPT=opt-gccold ZIMPLOPT=opt-gccold OPT=opt-gccold

其他特殊安装需求参考安装文档
安装成功后会显示:
** Build complete.
** Find your binary in “ /scipoptsuite-/scip-/bin”.
** Enter “make test” to solve a number of easy instances in order to verify that SCIP runs correctly.

II、Creating a single library containing SCIP, SoPlex, and ZIMP

cd scipoptsuit-4.0.0
make scipoptlib SHARED=true

成功后显示:
** Build complete.
** Find your SCIP binary in “ /scipoptsuite-/scip-/bin”.
** Enter “make test” to solve a number of easy instances in order to verify that SCIP runs correctly.
链接文件将放在lib文件夹

2.配置环境变量

打开~/.bashrc文件,在最后一行添加:

export PATH=$PATH:~/自己的路径/scipoptsuite-4.0.0/scip-4.0.0/bin/

终端中输入:

source ~/.bashrc

测试:
终端输入:

scip

显示下面结果说明scip可以正常使用
在这里插入图片描述

三、安装pyscipopt

解压之前下载的scipoptheaders-4.0.0.tgz文件得到include文件夹,将该文件家放到 /scipoptsuite-4.0.0/scip-4.0.0/bin/路径下面。
然后终端输入:

pip install pyscipopt==2.0

注意版本必须要和scip版本配套,否则会报错。
安装成功后显示:
Successfully installed pyscipopt-2.0.0


参考资料

https://scipopt.org/index.php
https://blog.csdn.net/weixin_42690752/article/details/108429040
https://zhuanlan.zhihu.com/p/494450220

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值