Commit 1a0560f2 authored by hengwen's avatar hengwen

Add script for re-compiling fmu files

parent 3dd20068
Pipeline #146423 canceled with stage
in 16 seconds
#!/usr/bin/env bash
# This script re-compile all *.fmu files in the current directory using
# current available c++ compiler. This makes the fmu files compatible with
# the host OS.
# For example if you have .fmu files exported from ModelicaEditor running
# in Windows but you need linux version. To make these .fmu files compatible
# with linux, you should:
# 1. import and re-export the Windows version .fmu files using linux ModelicaEditor
# 2. copy this script in the same directory where the re-exported .fmu files are located
# 3. run this script with ./recompile_fmu.sh
# 4. all .fmu files should be re-compiled and compatible with linux
tmp_dir=./unzip_dir
function compile() {
filename="$1"
unzip $filename -d $tmp_dir
cd ${tmp_dir}/sources && ./configure && make
cd ../..
zip -r $filename $tmp_dir
rm -rf $tmp_dir
echo "$filename"
}
for f in ./*.fmu; do
compile "$f"
done
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment