I want to install cyipopt on Google colab, but it seems like I failed. The ultimate goal is to make ipopt and cyipopt work with HSL ma86/ma97.
I know there are other ways to install.
- Use apt-get
By using the following command, it is possible to use cyipopt, but I cannot use HSL, for example ma97. The following is the case that I faced.
Cannot load HSL for IPOPT in Google Colab
!apt-get install coinor-libipopt-dev
!pip install cyipopt
- Use conda environment
By following detailed instructions, it is possible to set conda environments and simply use "conda install cyipopt". However, I need to use GPU acceleration using Jax, so I'm not considering it as an option for me.
On Google colab, I installed IPOPT and cyipopt with the following process.
- install ipopt
# Clone IPOPT
!git clone https://github.com/coin-or/Ipopt.git
# Install IPOPT
%cd /content/Ipopt/
!mkdir ./build
%cd /content/Ipopt/build
!/content/Ipopt/configure
!make
!sudo make install
%cd /content/
- set path
import os
os.environ['PKG_CONFIG_PATH'] = '/usr/local/lib/pkgconfig/'
os.environ['PATH'] += ':/usr/local/bin'
os.environ['LD_LIBRARY_PATH'] += ':/usr/local/lib'
- install cyipopt
!pip install cyipopt
- import cyipopt
import cyipopt
from cyipopt import minimize_ipopt
from scipy.optimize import rosen, rosen_der
import numpy as np
The following is my code on Google colab.
https://colab.research.google.com/drive/1a5v-L0q-JCAMcptTzEGodvTUcnkNN9sR?usp=sharing