按照该步骤一步一步执行,即可完成安装

安装基本依赖

$ apt-get install libblas-dev liblapack-dev gfortran

下载安装工具coinbrew

$ wget https://raw.githubusercontent.com/coin-or/coinbrew/master/coinbrew
or
$ git clone git@github.com:coin-or/coinbrew.git
$ cd coinbrew
$ sudo chmod u+x coinbrew # 给可执行权限

下载ipopt

$ ./coinbrew --ssh fetch Ipopt

接下来出现如下界面:

You haven't specified a project version
It appears that the last 10 releases of Ipopt are
3.14.9
3.14.8
3.14.7
3.14.6
3.14.5
3.14.4
3.14.3
3.14.2
3.14.1
3.14.0
Do you want to work with the latest release? (y/n)
=>

这里需要我们选择一个版本来安装,或者直接输入y,回车。

接下来,coinbrew会克隆github里面的ipopt第三方库和源码,包含:

  • 在当前目录下建立一个ThirdParty文件夹。
  • 克隆asl源码存放在ThirdParty/ASL里面(其实非必须)。
  • 克隆mumps源码存放在ThirdParty/Mumps里面。
  • 克隆hsl源码存放在ThirdParty/HSL里面(注意这里没有源码,需要后面自行从官网下载源码)。
  • 当前目录新建Ipopt文件夹,然后克隆ipopt源码存放在该目录下。

Metis库作为可选项并不是必须的,用于加速线性求解器HSL/Mumps的矩阵排序,可提高性能。

Download, build, and install dependencies
The linear solvers MA57, HSL_MA77, HSL_MA86, HSL_MA97 can make use of the matrix ordering algorithms implemented in METIS.
MUMPS will perform better if the matrix ordering algorithms implemented in METIS are available on the system.

下面安装Metis库:

$ cd ThirdParty
$ git clone git@git.zhlh6.cn:coin-or-tools/ThirdParty-Metis.git Metis
$ mkdir build && cd build
$ ../configure --prefix=${your_path}/coinbrew/install/
$ make -j8
$ make install

将从HSL官网获取的coinhsl-2021.05.05.tar.gz解压到ThirdParty/HSL/目录下,并重命名文件夹coinhsl-2021.05.05/为coinhsl/

下面回到coinbrew所在路径,编译Ipopt及其他第三方依赖:

$ ./coinbrew --ssh --skip-update build Ipopt -j 8 --prefix=${your_path}/coinbrew/install/ \
--with-metis-lflags='-L${your_path}/coinbrew/install/lib/ -lcoinmetis -lm' \
--with-metis-cflags=-I${your_path}/coinbrew/install/include/coin-or/metis/

第一次执行编译会在mumps编译完后报Error: Build failed, see error output above的错误,没关系,再执行一遍上面的命令继续编译,会出现如下界面:

You are trying to run the build again and have specified
configuration options on the command line.Please choose one of the following options.The indicated action will be performed for you AUTOMATICALLY
1. Run the build again with the previously specified options.This can also be accomplished invoking the buildcommand without any arguments.
2. Configure in a new build directory (whose name you will beprmpted to specify) with new options.
3. Re-configure in the same build directory with the newoptions. This option is not recommended unless you knowwhat you're doing!.
4. QuitPlease type 1, 2, 3, or 4
=>

输入1接着编译,即可完成链接了metis库的ipopt库了。

进一步可以检测一下install/include/coin/hsl/CoinHslConfig.h文件中Metis是否被包含,有如下一行说明已经包含:

/* Define to 1 if METIS is available */
#define COINHSL_HAS_METIS 1

将install目录下的文件夹拷贝到自己的工程目录下,就可以用ipopt以及有关依赖库了。

Ipopt with Metis编译指南相关推荐

  1. linux编译ace tao,CentOS环境下ACE编译指南

    CentOS环境下ACE编译指南 1.环境说明: (1)CentOS6.3 (2) ACE6.10 2.编译步骤: (1)定义环境变量: ACE_ROOT=/root/work/cots/ACE_wr ...

  2. linux编译准备,Linux 下编译指南

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 首先,我们需要获取最新的源码. 使用如下命令即可: git clone -b master --depth=1 https://github.com/Cl ...

  3. Android高版本P/Q/R源码编译指南

           Android高版本P/Q/R源码编译指南 Android源码编译系列博客: Android.bp你真的了解吗 Android.bp入门指南之Android.mk转换成Android.b ...

  4. linux下编译,Linux 下编译指南

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 首先,我们需要获取最新的源码. 使用如下命令即可: git clone -b master --depth=1 https://github.com/Cl ...

  5. 金山开源安全卫士全套代码编译指南–湘勇整理版

    金山开源安全卫士全套代码编译指南–湘勇整理版 要从金山开源安全卫士的代码里学习,首先当然是最好能把全套代码编译出来进行调试.在开发湘勇网络医生的过程中,我一直关注金山开源安全卫士代码的更新动态,第一时 ...

  6. mongodb 4.0.3 源码编译【1】编译指南的翻译

    [原始文档] mongodb-src-r4.0.3.zip\mongodb-src-r4.0.3\docs\building.md [翻译] 编译 MongoDB ================ 编 ...

  7. 小米linux内核(Xiaomi_Kernel_OpenSource)编译指南

    一.下载对应 设备版本的 Xiaomi Kernel https://github.com/MiCode/Xiaomi_Kernel_OpenSource/ 二.独立编译内核 主机:ubuntu 18 ...

  8. Hadoop源代码eclipse编译指南

    目录 1. 下载Hadoop源代码 1 2. 准备编译环境 2 2.1. Hadoop代码版本 2 2.2. 联网 2 2.3. java 2 2.4. Ant和Cygwin 3 2.5. Eclip ...

  9. Chromium Android编译指南

    先决条件 需要有一台装有Linux操作系统环境的主机来做编译,这个环境的搭建配置方法可以参考Linux-specific build instructions.目前还不支持在其它(Mac/Window ...

最新文章

  1. cocos2d-x坐标系
  2. 关于项目过程能力基线的几个讨论
  3. css 关闭按钮实现,CSS做的关闭按钮动效
  4. DistBelief 框架下的并行随机梯度下降法 - Downpour SGD
  5. 树莓派 python_树莓派笔记08—Python流水灯
  6. Bootstrap Table的使用小结
  7. 戴尔服务器哪1顶型号好,戴尔PowerEdge R730xd新一代服务器评测
  8. Java开发熟手该当心的11个错误
  9. 某LINUX平台,消息队列导致崩溃
  10. 二进制转十六进制的详细步骤
  11. 数字舵机c语言编程,舵机入门
  12. 【深度学习】02-06-谈谈机器学习的原理(选修)-李宏毅老师2122深度学习课程笔记
  13. <<视觉问答>>2021:Zero-shot Visual Question Answering usingKnowledge Graph
  14. mac电脑上网突然变得很慢
  15. VR全景技术的优点有哪些?
  16. 智力题库软件测试,最新软件测试笔试题网友回忆版
  17. C11编译 systemc 2.3.3 和 SCV 2.0.1
  18. 《云端软件平台》运行机制浅析
  19. 画论39 李衎《画竹谱》
  20. Javascript编码解码方法(decodeURIComponent)

热门文章

  1. 资源优化问题常见形式
  2. karaf常用命令纪录
  3. 【Homebrew】Homebrew 介绍与安装
  4. python机器人开发——基于Micropython的智能机器人底层控制开发
  5. js 原子级操作_原子操作与同步机制
  6. 在虚拟机中安装mysql数据库
  7. jdk9模块化简单介绍
  8. Dapp开发实战:去中心化NFT交易平台
  9. 运动控制卡讲解及实例应用
  10. 虚拟主机、VPS、云服务器三者的区别