前言
Linux下安装SCIP + PySCIPOpt时常会出现如下的报错,本文记录一下对这个问题的解决。fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
在Windows平台的下载步骤可以参考这篇博文,十分详细。
WIndows平台的安装步骤:https://www.cnblogs.com/dengfaheng/p/10041488.html
一、安装SCIP
建议在官网下载源代码
官网地址是https://www.scipopt.org/index.php#download
建议下载scipoptsuite.tgz
之后的安装命令为
cd scipoptsuite-4.0.0
mkdir build
cd build
cmake ..
make
之后配置一下环境
vim ~/.bashrc
export PATH=$PATH:~/software/scip/scipoptsuite-4.0.0/build/bin/
source ~/.bashrc
之后可以在bash中输入scip进行测试
二、安装PySCIPOpt及中间的坑
正常来说下面直接
pip install PySCIPOpt
或者下载源码编译安装就行了,但直接这样的话就会遇到这个bug
fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
使用cd命令进入文件夹~/software/scip/scipoptsuite-4.0.0/build/bin/,发现确实没有include文件夹,更不用说里面的scip.h头文件了
那么include文件夹在哪儿呢?
实际上就在刚刚下载的scipoptsuite.tgz下面
将其解压之后,拷贝到~/software/scip/scipoptsuite-4.0.0/build/bin/之后就大功告成了!
在下载源代码进行安装时,在
python setup.py install
之前,需要指定路径,即
export SCIPOPTDIR=~/software/scip/scipoptsuite-4.0.0/build/bin