FreeBSD

FreeBSD is one of the Unix-like operating systems; see [L1 ].

JMN 2008-01-02

Tcl8.5 no longer appears to work as a threaded build on FreeBSD. The port /usr/ports/lang/tcl85-threads installs, but dumps core when thread::create is called.

I got the same result when building from CVS sources.

Submitted as SourceForge bug # 1860425 [L2 ]

If anyone has had success on the FreeBSD platform with a threaded build, or knows anything about whether this is a Tcl bug or compiler toolchain problem, please update this bug report and/or comment here.

GWL this bug was closed in SourceForge on 2008-01-11 by MS. Mind you I do not know if the FreeBSD ports has a version that works.


Nowadays (2006?) a threaded build is easy to install from the ports collection.

/usr/ports/lang/tcl8.4/

 make WITH_THREADS=YES install

For an ordinary build/install of Tcl 8.3.4 on FreeBSD, the standard instructions should work just fine:

  ./configure
  make
  su                    (if needed)
  make install
  exit                  (the su)
  make test             (if desired)

For a thread-enabled build, though:

  ./configure --enable-threads
  ...
  configure: warning: Don t know how to find pthread lib on your system - you must disable thread support or edit the LIBS in the Makefile...
  ...

So, here's the recipe, involving some file editing, for building, installing and testing a thread-enabled Tcl on FreeBSD:

  • ./configure --enable-threads --enable-gcc
  • Edit Makefile:
        LIBS = $(MATH_LIBS) -pthread
  • make tcltest
  • Edit tclConfig.sh - linking of Tcl into static applications will need the -pthread switch to gcc
        TCL_LIBS=' -lm -pthread'
  • make
  • make install (as root, if necessary)
  • Rename tests/stack.test -> tests/stack.test_ to avoid known crash in test suite.
  • make test

DGP


LV why not submit a bug report to http://tcl.sf.net/ and have these fixes moved into the configure script for all ?


DGP See Tcl Bug 473708.

Jeff and I spent some time trying to fix this for the Tcl 8.3.4 release, but the apparent right fix for this on FreeBSD broke the build/test on AIX. Neither of us was willing to break something that was working for a patch release, so the backup solution was to post the FreeBSD work-around here. Since threaded builds on FreeBSD have never worked "out of the box" yet, we haven't lost anything.


While Tcl 8.4.6 from FreeBSD ports compiles and runs quite nicely with WITH_THREADS=yes (which I have in my /etc/make.conf), wish8.4 constantly core dumps on the recent (2004-04-24) 5.0-CURRENT.

I tried Tcl 8.4.11 on both ports (tcl84 and tcl84-threads). I installed without hearing any complains. But when I typed "tcl" command, nothing happened. I rehashed. No help. I checked man page. It is there....but it is not working for me...can any body shed some light please?

Did you really type "tcl" rather than "tclsh"? If so, that's probably what is wrong.

Yes, I did type "tcl", not "tclsh". After I posted here, I installed tclX from FreeBSD port. Then it begin to work. Thank you for your such a quick reply! By the way, can I ask if you are familiar with xotcl? It gives me warnings like some thing defined not used, or declared not defined, etc at "make". then refused to install on my FreeBSD....thank you again! ----john


ports interface browser


In the '90s, quite a bit of interesting "core" Tcl development was actually hosted on FreeBSD. In 2007, the BSDs [...] aren't nearly as prominent; there isn't an ActiveTcl specific to FreeBSD, for example [but does modern x86 FreeBSD have a facility for executing the Linux ActiveTcl?]. The TclKit for FreeBSD works quite nicely ...