SIS provides a logic synthesis library libsis.a that is required for Petrify. The following instructions are for SIS 1.3 Unofficial Distribution.
SIS source code needs the following changes to be compatible with modern compilers:
restrict is a keyword now and needs to be replaced, e.g. by restrict_var. This effects the following files: espresso/unite.c, sis/espresso/unite.c, sis/minimize/minimize.csis/command/filec.c, change line 15 #include <termio.h> to #include <termios.h>.sis/io/read_kiss.c, edit line 13, changing read_error() to read_error(char *, …).sis/pld/act_bdd.c, move line 151 static int compare(); to line 144.sis/pld/act_ite.c move static int compare(); to line 124.sis/pld/xln_merge.c, move line 299 static sm_row *xln_merge_find_neighbor_of_row1_with_minimum_neighbors(); to line 287.sis/pld/xln_pert_dec.c, move line 58, static int kernel_value(); to line 50. sis/Makefile.in change line && $(AR) x ../$$I && $(AR) r ../$@ * \ to && $(AR) x ../$$I && $(AR) r ../$@ *.o \ (this is necessary for OSX build).
While 64-bit SIS can be built with CFLAGS=-m64 or –host=x86_64-w64-mingw32 configure parameter, the produced result is not reliable and often segfaults, especially on Windows and OSX.
Build 32-bit SIS for Linux as follows:
./configure CFLAGS=-m32 make
Cygwin build is smooth, but it introduces an ugly dependency on cygwin1.dll for compatibility layer. On the other hand, MinGW provides a convenient toolchain for cross-compilation and does not introduce unnecessary dependencies, therefore MinGW will be used to cross-compile for Windows.
sudo apt install mingw-w64
__MINGW32__ macro to distinguish Windows builds.-lwinmm to the linker command: ifneq ($(findstring mingw32, $(CC)),)
sis_LDADD = libsis.a -lm -lwinmm
else
sis_LDADD = libsis.a -lm
endif
libsis.a library for linking with Petrify without compatibility layer of Cygwin or MSYS2. The following changes and sacrifices had to be made for Windows build:malloc instead of default sbrk.gethostname function could not be found even when linked with -lws2_32 option.SIGSTOP in bwd_com.c needs CloseHandle function which however cannot be found at linking. It is commented out which may lead to resource leaks.SIGALRM is based on timeSetEvent function that requires -lwinmm at linking../configure --host=i686-w64-mingw32 make
sudo port install gcc8 +universal #sudo port select --list gcc sudo port select --set gcc mp-gcc8 - Install Bison and DOS2Unix: <code shell> sudo port install bison sudo port install dos2unix
./configure CFLAGS=-m32 make