This way of building OpenModelica is useful if you want to use a Unix shell and tools on a Windows 10 computer. You don't need to run a VM and Windows Subsystem for Linux (WSL) should be noticeably faster than doing so.
If you want to use the executables from Windows look at Windows instructions or cross compile for Windows 10 . Please let us know how you did it when it's working ;-)
Follow the instructions from Microsoft to install a Linux distribution.
See the Dependencies for Linux in Linux instructions or use
echo deb http://build.openmodelica.org/apt bionic nightly | sudo tee -a /etc/apt/sources.list
echo deb-src http://build.openmodelica.org/apt bionic nightly | sudo tee -a /etc/apt/sources.list
# Get key for OpenModelica
wget -q http://build.openmodelica.org/apt/openmodelica.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get build-dep openmodelica
If you want to build documentation and run all tests successfully you need some additional programs. There are two options:
- Instal the bare minimum to run the testsuite:
sudo apt-get update
apt-get install flex zip unzip libomp-dev
OR
- Install a lot more to test everything and build documentation and so on.
See Dockerfile.build-deps from OpenModelicaBuildScripts/docker to get the up to date dependencies and do everything stated in the RUN instruction.
Get OpenModelica from our Github repository.
git clone --recursive https://openmodelica.org/git-readonly/OpenModelica.git OpenModelica
cd OpenModelica
autoconf
./configure CC=clang CXX=clang++ -without-omc -with-cppruntime
make -j4 # Or 4 with the number of cores you have
make omc-diff testsuite-depends -j4
cd testsuite/runtests && ./runtests.pl
Tested on Windows 10 with Ubutnu 18.04 TLS.
Failing tests: 5 of 3995