Xschem Build Instructions for MacOS 'Big Sur'

source: Stefan Schippers' xschem building instructions for macOS Big Sur

verified on

  • i7 with macOS Big Sur ver. 11.7.4

In order to compile xschem properly the following dependencies are required:

The first step is to download and install Xquartz.
Then download and compile Tcl and Tk (use the path /usr/local/opt/tcl-tk as destination folder)

Tcl Compilation

Extract the Tcl sources and then go to the unix folder:

NOTE: ensure the install directory (/usr/local/opt/tcl-tk) is not already used by official MacOS libraries,
if this is the case use another location. This applies for the Tk build as well.

cd <extracted-folder>/unix
./configure --prefix=/usr/local/opt/tcl-tk
make
make install

Tk Compilation

Same procedure as Tcl, but we need to specificy the Tcl and X libraries paths. XQuartz is installed into /opt/X11

NOTE: before running 'make' check the Makefile and ensure the LIB_RUNTIME_DIR is set as follows.

LIB_RUNTIME_DIR         = $(libdir)
cd <extracted-folder>/unix
./configure --prefix=/usr/local/opt/tcl-tk \
--with-tcl=/usr/local/opt/tcl-tk/lib --with-x \
--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
make
make install

xschem

Install these additional packages

brew install libxpm
brew install macvim
sudo port install gaw
sudo port install dbus

Download and configure xschem

git clone https://github.com/StefanSchippers/xschem.git
cd xschem
## set prefix to the base directory where xschem and his support files will be installed
## if unspecified default is /usr/local
./configure --prefix=/Users/$(whoami)/opt/xschem

Build xschem

Before building the application, we need to adjust Makefile.conf
We need to replace the CFLAGS and LDFLAGS variables in Makefile.conf as follows:

CFLAGS=-std=c99 -I/opt/X11/include -I/opt/X11/include/cairo \
-I/usr/local/opt/tcl-tk/include -O2
LDFLAGS=-L/opt/X11/lib -L/usr/local/opt/tcl-tk/lib -lm -lcairo -ljpeg\
-lX11 -lXrender -lxcb -lxcb-render -lX11-xcb -lXpm -ltcl8.6 -ltk8.6
make
make install