This is a set of how-to notes for using the new tclquadcode. Your mileage may (WILL!) vary depending on which platform you are setting up, but this shows some of the pitfalls and workarounds you may run into.
Setup for Ubuntu 16.04
These are the steps to install and test the new quadcode on a fresh installation of Ubuntu 16.04
sudo apt-get install libx11-dev
sudo apt-get update sudo apt-get upgrade
apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 m$ apt-get update apt-get install -y clang-5.0 apt-get install -y lldb-5.0
wget https://github.com/dkfellows/llvmtcl/archive/master.tar.gz -O ~/Downloads/llvmtcl-master.tar.gz
cd ~/your-dir tar xvf ~/Downloads/llvmtcl-master.tar.gz
cd ~/Downloads # For example. tar xvf tcllib-1.18.tar.gz cd tcllib-1.18 ./configure make sudo make install
cd ~/your-dir fossil clone http://core.tcl.tk/tcl tcl.fos fossil clone http://core.tcl.tk/tk tk.fos fossil clone http://core.tcl.tk/tclquadcode quadcode.fos
mkdir tcl tk cd tcl
fossil open ../tcl.fos core-8-6-8 cd unix ./configure; make sudo make install cd ../../tk fossil open ../tk.fos core-8-6-8 cd unix ./configure; make sudo make install cd ../../llvmtcl-master ./configure
cd /usr/bin sudo ln -s llvm-config-5.0 llvm-config cd - ./configure make sudo make install
version conflict for package "Tcl": have 9.0a0, need 8.5 while executing "package require Tcl 8.5" Or: version conflict for package "Tcl": have 9.0a0, need 8.2 while executing "package require Tcl 8.2" (file "./installer.tcl" line 10)
mkdir quad-201801 cd quad-201801/ fossil open ../quadcode.fos tclsh8.6 demos/smalltest.tcl
DKF: I recommend only using my releases of llvmtcl (unless you want to help develop it; it really needs attention on Windows as I don't have a development toolchain on that platform at all), the latest of which is at https://github.com/dkfellows/llvmtcl/releases
The configure for llvmtcl takes the option --with-llvm-config=$LLVM_CONFIG_PROGRAM which lets you override the default (which is llvm-config but you probably have a different name). I always have to use that on my system as I need to select the right version of LLVM. Also, right now we _only_ support the latest release of Tcl 8.6 (or maybe one or two patchlevels before). Select your compiler (if necessary; it is for me) by setting the CC environment variable.
Setup for Macos 10.13, Xcode and Macports
While Xcode uses llvm, it doesn't ship the bits to extend and link against llvm. So you have to use an llvm that ships with Homebrew, Macports, etc.
This example uses macports
sudo port install llvm-5.0 mkdir -p ~/tcl/download cd ~/tcl/download fossil clone http://core.tcl.tk/tcl tcl.fos fossil clone http://core.tcl.tk/tk tk.fos fossil clone http://core.tcl.tk/tclquadcode quadcode.fos mkdir -p ~/build/dev-tcl/ cd ~/build/dev-tcl mkdir tcl tk tclquadcode cd ~/build/dev-tcl/tcl fossil open ~/tcl/download/tcl.fos core-8-6-8 cd ~/build/dev-tcl/tcl/unix ./configure --prefix=$HOME/tcl --enable-corefoundation=yes --enable-framework=no make install cd ~/build/dev-tcl/tk fossil open ~/tcl/download/tk.fos core-8-6-8 cd ~/build/dev-tcl/tk/unix ./configure --prefix=$HOME/tcl --enable-aqua=yes make install cd ~/build/dev-tcl/llvmtcl ./configure --with-llvm-config=/opt/local/bin/llvm-config-mp-5.0 --with-tcl=../tcl/unix make install cd ~/build/dev-tcl/ git clone https://github.com/dkfellows/llvmtcl llvmtcl cd ~/build/dev-tcl/tclquadcode fossil open ~/tcl/download/tclquadcode.fos # Just softlink the code sandbox to where the interpreter will find it cd ~/tcl/lib ln -s ~/build/dev-tcl/tclquadcode .
NOTES: We only need the macports llvm to satisfy build requirements for llvmtcl In production the clang that ships with apple seems to be compadible enough with llvm-5.0 that we don't need to set the CC environment variable
To use this tclsh instead of the native tclsh:
alias tclsh=~/tcl/bin/tclsh8.6 alias wish=~/tcl/bin/wish8.6