Recent versions of Bison (e.g. v3.6.2 in MacPort and v3.5.1 in Ubuntu 20.04) have a new way to detect reduce/reduce conflicts. This affects generating a parser from unflib/pn_parse_hl.y
grammar – the following error is reported by Bison: reduce/reduce conflicts: 162 found, 54 expected. A workaround is to change the number of expected reduce/reduce conflicts from 54 to 162.
These instructions also work for Windows Subsystem for Linux (WSL).
See WSL documentation for detailed setup instructions.
sudo apt install gcc gcc-multilib # GCC v9.3.0 sudo apt install g++ g++-multilib # G++ v9.3.0 sudo apt install bison flex # Bison v3.5.1 sudo apt install make dos2unix sudo apt install libhwloc-dev
make cleanall
and remove all static libraries (*.a
files)make
Binaries produced in Ubuntu 20.04 and 18.04 require Linux kernel v3.2.0 or newer. This may cause problems for EDA servers that often run Red Hat 6 with kernel v2.6.32. A workaround is to configure a build environment under Ubuntu 16.04 instead:
curl.exe -L -o ubuntu-1604.appx https://aka.ms/wsl-ubuntu-1604 Add-AppxPackage .\Ubuntu_1604.2019.523.0_x64.appx
sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt install gcc-8 gcc-8-multilib g++-8 g++-8-multilib sudo update-alternatives \ --install /usr/bin/gcc gcc /usr/bin/gcc-8 20 \ --slave /usr/bin/g++ g++ /usr/bin/g++-8 \ --slave /usr/bin/gcov gcov /usr/bin/gcov-8
sudo apt install m4 make flex dos2unix libhwloc-dev
wget http://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.gz tar xzfv bison-3.5.1.tar.gz cd bison-3.5.1 ./configure make sudo make install
sudo port install gcc8 +universal #sudo port select --list gcc sudo port select --set gcc mp-gcc8
sudo port install bison sudo port install openssl sudo port install dos2unix
cp flags_osx flags
The changes are as follows:
-static
is replaced with -static-libstdc++ -static-libgcc
in CFLAGS
-Wl,–whole-archive
and -Wl,–no-whole-archive
are removed from CXXFLAGS
unflib/parse_hl.y
grammar file:sed -i'' 's/%expect-rr 54/%expect-rr 162/g' unflib/parse_hl.y
make cleanall
and remove all static libraries (*.a
files)make
FlexLexer.h
from Flex package into include
directory of Visual Studio installation (e.g. C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.32.31326\include\
)make_unf_tools.bat
to pack the produced binaries into a zip file