Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottlittle/3d89a219385ba1e78e126182c1d5b192 to your computer and use it in GitHub Desktop.
Save scottlittle/3d89a219385ba1e78e126182c1d5b192 to your computer and use it in GitHub Desktop.
JModelica compilation and installation notes for Ubuntu 16.04

JModelica installation for Ubuntu 16.04

Installing JModelica to paperspace (cloud) machine with 4 cores running Ubuntu 16.04 (64-bit). I installed all of the required packages on a fresh install, but did not enforce the tested version numbers. This was done May 29, 2019. This isn't meant to be complete, but complementary to the installation instructions in the JModelica 2.2 manual.

IPopt installation

Download

https://www.coin-or.org/download/source/Ipopt/
wget https://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.13.tgz
tar -xvzf Ipopt-3.12.13.tgz
# followed instructions for getting ASL, Blas, etc. by running ./get.XXXX for everything except HSL (details below)

# Got closed source personal license HSL from http://www.hsl.rl.ac.uk -> fill out a form and get the file emailed to you
scp ~/Downloads/coinhsl-archive-linux-x86_64-2014.01.17.tar.gz paperspace@100.201.69.43:/home/paperspace/.
cp -r coinhsl-archive-linux-c86_64-2014.01.17/* /home/paperspace/Ipopt-3.12.13/ThirdParty/HSL

Build

cd Ipopt-3.12.13
mkdir build
cd build
../configure --prefix=/home/paperspace/Ipopt
make -j 4
make -j 4 install

JModelica installation

svn co https://svn.jmodelica.org/trunk JModelica.org

# this next line is not included in the installation instructions (for 2.2), but is necessary
svn co https://svn.jmodelica.org/assimulo/trunk JModelica.org/external/Assimulo

Configure and build

cd JModelica.org
mkdir build
../configure --prefix=/home/paperspace/JModelica --with-ipopt=/home/paperspace/Ipopt
make -j 4
make -j 4 install
make -j 4 casadi_interface

Demo

cd /home/paperspace/JModelica/bin
./jm_ipython.sh
from pyfmi.examples
import fmi_bouncing_ball
fmi_bouncing_ball.run_demo()

Jupyter

I had to uninstall python-mzq to get Jupyter to install via pip. I also uninstalled python-matplotlib and install via pip to get plotting to work.

Conclusion

I hope this helped! (Talking to you, future self.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment