Installing TCL/TK Headers for development

Hello,

How can I install TCL/TK headers into my system?

I’m trying to compile OpenSTA, and it requests TCLlib and TCL-Headers, I didn’t saw a way to get TCL/TK headers installed yet, how should I do it ?

brew install tcl-tk should do it

Hello,

Well it didn’t installed the headers, I can’t find them on /usr/local/include

Because it’s keg-only. Find it at /usr/local/Cellar/tcl-tk.

You said it is keg-only, how to change it to install the headers too?

The headers are, in fact, installed, they’re just not linked into /usr/local/. You’ll either need to link these yourself with brew link --force (not recommended) or by setting the appropriate flags for your compiler. See this yourself via brew info tcl-tk:

==> Caveats
tcl-tk is keg-only, which means it was not symlinked into /usr/local,
because tk installs some X11 headers and macOS provides an (older) Tcl/Tk.

If you need to have tcl-tk first in your PATH run:
  echo 'export PATH="/usr/local/opt/tcl-tk/bin:$PATH"' >> ~/.bash_profile

For compilers to find tcl-tk you may need to set:
  export LDFLAGS="-L/usr/local/opt/tcl-tk/lib"
  export CPPFLAGS="-I/usr/local/opt/tcl-tk/include"

For pkg-config to find tcl-tk you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig"

got it, I missed the

/opt/

Thank you will try that, my current .zshrc for brew is like the following (fixes and sugestions are welcome):

#Verilator with my SystemC for C++14
export PATH=/usr/local/opt/flex/bin:$PATH
export SYSTEMC_INCLUDE=/opt/systemc/2.3.3/include
export SYSTEMC_LIB=/opt/systemc/2.3.3/lib
export SYSTEMC_LIBDIR=$SYSTEMC_LIB
export VERILATOR_ROOT=/opt/verilator
export PATH=$VERILATOR_ROOT/bin:$PATH
export PATH=/usr/local/opt/llvm/bin:$PATH
export PATH=/usr/local/opt/openssl/bin:$PATH

export PATH=/usr/local/opt/sqlite/bin:$PATH
export PATH=/usr/local/opt/ncurses/bin:$PATH
export PATH=/usr/local/opt/bison/bin:$PATH
export LDFLAGS="-L/usr/local/opt/flex/lib -L/usr/local/opt/gettext/lib -L/usr/local/opt/bison/lib -L/usr/local/opt/icu4c/lib -L/usr/local/opt/qt/lib -L/usr/local/opt/tcl-tk/lib"
export CPPFLAGS="-I/usr/local/opt/flex/include -I/usr/local/opt/gettext/include -I/usr/local/opt/icu4c/include -I/usr/local/opt/qt/include -I/usr/local/opt/tcl-tk/include"
export PATH="/usr/local/opt/qt/bin:$PATH"

export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export PATH="/usr/local/opt/tcl-tk/bin:$PATH"