0

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.

  1. 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
  1. 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.

  1. 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/
  1. 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'
  1. install cyipopt
!pip install cyipopt
  1. 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

RetroD
  • 1
  • 2

1 Answers1

0

I have successfully installed cyipopt in Google Colab. Just run the below 2 lines:

!apt install build-essential pkg-config python3-pip python3-dev cython3 python3-numpy coinor-libipopt1v5 coinor-libipopt-dev

!pip install cyipopt
user16217248
  • 3,119
  • 19
  • 19
  • 37