xschem/README_MacOS.md

100 lines
3.3 KiB
Markdown
Raw Normal View History

2021-05-03 22:56:10 +02:00
# Build instructions for MacOS 'Catalina'
Install the latest XQuartz from XQuartz.org.
Install the latest tcl, tk and cairo from MacPorts.
## xschem compilation
Let's use a recent xschem repository and install it on ~/xschem-macos
```
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
## default if unspecified is /usr/local
./configure --prefix=/Users/$(whoami)/xschem-macos
```
Finally, we compile and install the application.
```
make
make install
```
The application will be placed in `/Users/$(whoami)/xschem-macos/bin` and can be started with
`./xschem` in that folder.
2021-05-03 22:56:10 +02:00
---
# Build Instructions for MacOS 'Big Sur'
In order to compile xschem properly on MacOS, we always need to reference the X libraries from XQuartz
and change some compilation variables. The following dependencies are required:
- XQuartz: https://www.xquartz.org/releases/XQuartz-2.7.11.html
- Tcl: https://prdownloads.sourceforge.net/tcl/tcl8.6.10-src.tar.gz
2020-12-12 02:12:27 +01:00
- Tk: https://prdownloads.sourceforge.net/tcl/tk8.6.10-src.tar.gz
The first step is to install XQuartz and then compile Tcl and Tk. Nothing special on compiling these two, but
we need to specify the X libraries from XQuartz when compiling Tk. Let's 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 Tk build as well.
2020-12-12 02:16:57 +01:00
```
cd <extracted-folder>/unix
./configure --prefix=/usr/local/opt/tcl-tk
make
make install
```
2020-12-12 02:12:27 +01:00
## Tk compilation
Same procedure as Tcl, but we need to specificy the Tcl and X libraries paths. XQuartz is installed on
2020-12-12 02:12:27 +01:00
/opt/X11 , so we do:
2020-12-12 02:13:42 +01:00
NOTE: before running 'make' inspect the Makefile and ensure the LIB_RUNTIME_DIR is set as follows. Make the correction if not:
```
LIB_RUNTIME_DIR = $(libdir)
```
2020-12-12 02:16:57 +01:00
```
cd <extracted-folder>/unix
./configure --prefix=/usr/local/opt/tcl-tk \
2020-12-12 02:12:27 +01:00
--with-tcl=/usr/local/opt/tcl-tk/lib --with-x \
2020-12-12 02:16:57 +01:00
--x-includes=/opt/X11/include --x-libraries=/opt/X11/lib
make
make install
```
2020-12-12 02:12:27 +01:00
2020-12-12 02:13:42 +01:00
## xschem compilation
Besides referencing the X libraries, we need to also point to the Tcl/Tk installation path. Let's use a recent
2020-12-12 02:12:27 +01:00
xschem repository and install it on ~/xschem-macos (adapt this to your username):
2020-12-12 02:13:42 +01:00
2020-12-12 02:16:57 +01:00
```
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
## default if unspecified is /usr/local
2020-12-12 02:16:57 +01:00
./configure --prefix=/Users/$(whoami)/xschem-macos
```
2020-12-12 02:12:27 +01:00
Before building the application, we need to adjust `Makefile.conf` because the current configure
script doesn't support custom flags. So we need to replace the CFLAGS and LDFLAGS variables in that file
2020-12-12 02:12:27 +01:00
as below:
2020-12-12 02:16:57 +01:00
```
CFLAGS=-I/opt/X11/include -I/opt/X11/include/cairo \
2020-12-12 02:12:27 +01:00
-I/usr/local/opt/tcl-tk/include -O2
LDFLAGS=-L/opt/X11/lib -L/usr/local/opt/tcl-tk/lib -lm -lcairo \
2020-12-12 02:16:57 +01:00
-lX11 -lXrender -lxcb -lxcb-render -lX11-xcb -lXpm -ltcl8.6 -ltk8.6
```
2020-12-12 02:12:27 +01:00
Finally, we compile and install the application.
2020-12-12 02:13:42 +01:00
2020-12-12 02:16:57 +01:00
```
make
make install
```
2020-12-12 02:12:27 +01:00
2020-12-12 02:18:39 +01:00
The application will be placed in `/Users/$(whoami)/xschem-macos/bin` and can be started with
`./xschem` in that folder.