Getting "tcl wasn't compiled with threads enabled" error

Ryan Schmidt ryandesign at
Sat Sep 1 13:18:31 PDT 2007

On Sep 1, 2007, at 12:00, Bernard Desgraupes wrote:

> I wrote:
>> I'm having a problem trying to selfupdate MacPorts on my machine:  
>> the configure script stops on the following
>> checking for Tcl configuration... found /usr/local/lib/
>> checking for existence of /usr/local/lib/ loading
>> checking for Tcl public headers... /usr/local/include
>> checking for tclsh... /usr/bin/tclsh
>> checking for Tcl package directory... /Library/Tcl
>> checking whether tclsh was compiled with threads... no
>> configure: error: tcl wasn't compiled with threads enabled
>> I currently have MacPorts 1.5.0 installed from the .dmg archive.
>> My version of tclsh was 8.4.10 in /usr/bin and probably indeed it  
>> was not compiled with threads.
>> So I installed the MacPorts version of Tcl (sudo port install tcl)  
>> thinking that this one would be compiled with threads enabled.  
>> This installed version 8.4.15 in /opt/local/bin.
>> Then trying again to "port -selfupdate"
>> Same error and still the configure script finds tclsh in /usr/bin
>> checking for tclsh... /usr/bin/tclsh
>> So I changed the /usr/bin/tclsh symlink so that it points to the  
>> newly compiled tclsh:
>> lrwxr-xr-x   1 root  wheel  20 Sep  1 14:12 /usr/bin/tclsh -> /opt/ 
>> local/bin/tclsh
>> Still I get the same error from the MacPorts configure script.
>> How can I get out of this ?
>> How do I do to have tclsh compiled with threads enabled?  
>> Apparently even with the MacPorts version it is not. I found the  
>> following line in /opt/local/lib/
>>    # Flag, 1: we built Tcl with threads enables, 0 we didn't
>> And why is the MacPorts configure script looking for the wrong  
>> Tcl. It is loading /usr/local/lib/
> OK, I've solved my problem: I edited the Portfile and added  
> manually --enable-threads to the [configure.args] proc arguments  
> and rebuilt tcl from scratch. Then I fiddled with sym links to make  
> sure that the tclsh in /usr/bin points to /opt/local/bin/tclsh and  
> similarly with the file.
> After that, the selfupdate configuration went fine.
> I'm still wondering why the --enable-threads configure argument is  
> not present by default (or at least via a variant) if it is needed  
> by something as basic as "port selfupdate".
> I'm probably missing something.
> Any insight is very welcome.
> Bernard
> PS  It would be nice if there were a Tcl folder in /opt/local/var/ 
> macports/sources/ (just like  
> Python, Ruby, etc) in order to add Portfiles for various Tcl  
> compiled extensions. I suppose I'd have to make a feature request  
> for this somewhere.

It sounds like a rogue Tcl in /usr/local was interfering. I recommend  
you remove it, and anything else you have directly in /usr/local. It  
will likely interfere with other MacPorts ports. I recommend you  
install any software you need by using MacPorts. If ports do not  
exist for software you want, they can probably be created.

More information about the macports-users mailing list