<#197 Changes to support Mac OS> New issue created...
# open_pdks
g
#197 Changes to support Mac OS New issue created by lantertronics It took me ages to get the open_pdks for the SkyWater 120nm to compile on my Mac, but in the final analysis the needed changes are not actually that extensive. You can put in the install instructions that Mac users should install Homebrew first and type brew install grep brew install gnu-sed to install the GNU versions of these tools, which install as ggrep and gsed. Then in Makefile.in in the sky130 directory, before lines 767 and 768 that read
Copy code
grep -zl 'sky130.lib.spice' $$file || ${SED} -z 's|format="tcleval( @value )"\nvalue="|format="tcleval( @value )"\nvalue="\n.lib \\\\\\\\$$\:\:SKYWATER_MODELS\\\\\\\\/sky130.lib.spice tt |' -i $$file ; \
grep -zl 'format="tcleval( @value )".*value="' $$file || printf 'C {devices/code.sym} -170 0 0 0 {name=TT_MODELS\nonly_toplevel=true\nformat="tcleval( @value )"\nvalue="\n.lib \\\\\\\\$$\:\:SKYWATER_MODELS\\\\\\\\/sky130.lib.spice tt\n"}' >> $$file ; \
Add the lines
Copy code
if [[ "$(shell uname)" == "Darwin" ]]; then \
   ggrep -zl 'sky130.lib.spice' $$file || ${SED} -z 's|format="tcleval( @value )"\nvalue="|format="tcleval( @value )"\nvalue="\n.lib \\\\\\\\$$\:\:SKYWATER_MODELS\\\\\\\\/sky130.lib.spice tt |' -i $$file ; \
   ggrep -zl 'format="tcleval( @value )".*value="' $$file || printf 'C {devices/code.sym} -170 0 0 0 {name=TT_MODELS\nonly_toplevel=true\nformat="tcleval( @value )"\nvalue="\n.lib \\\\\\\\$$\:\:SKYWATER_MODELS\\\\\\\\/sky130.lib.spice tt\n"}' >> $$file ; \
else \
and after them just add "fi." Sorry I'm not conversant enough in the ways of Git to submit this as a formal pull request. I tried to do the OS check using $OSTYPE but within this particular script that returned null for some reason, so I found the uname solution. Fortunately the configure scripts seem to already detect if a Mac user has the special GNU version of SED, gsed, installed and selects it, but the grep needs to be switched explicitly. (There's probably a more elegant solution). I put together this video documenting my progress working through it:

https://youtu.be/CSXPUzwuGGc

RTimothyEdwards/open_pdks