Microsemi Maker-Board M2S010-MKR-KIT

An error I encountered but was able to fix while doing the tutorial:

When using the system builder or synthesizing, I ran into the following errors

Starting Synplify Pro ME…
/usr/local/microsemi/Libero_v11.8/Synplify/bin/synplify_pro: 137: [: unexpected operator

/usr/local/microsemi/Libero_v11.8/Synplify/bin/synplify_pro: 151: [: !=: argument expected

/usr/local/microsemi/Libero_v11.8/Synplify/bin/synplify_pro: 386: /usr/local/microsemi/Libero_v11.8/Synplify/bin/config/execute: Syntax error: “(” unexpected (expecting “;;”)

The cause of this is with several shell scripts under /usr/local/microsemi/Libero_v11.8/Synplify/bin/

When looking at the first line of the file “execute”, the shebang is “#! /bin/sh” but the file uses some syntax that sh doesn’t like, but bash can understand. E.g. lines 321 and 386 where it says “args_a=( $@ )” gives problems because of the ‘(’ and ‘)’ around the “$@” expansion

This can be fixed by fixing the shebang so that it says “#! /bin/bash” instead of sh

Under the “microsemi/Libero_v11.8/Synplify/bin/” the following files needed to be changed:

c_ver
c_vhdl
c_hdl
syn_nfilter
synplify_pro
./config/execute

It may be possible to just link /bin/sh to /bin/bash, but that could cause problems for other programs on your system if they are not bash compatible for some reason.

2 Likes