Tcl Source Code

View Ticket
Login
2025-08-05
04:09 • Ticket [15d60c0d2e] make fails for tk8.6.16 on macOS status still Open with ... artifact: f8dd630da1 user: f_phan
04:05 • Ticket [15d60c0d2e]: 3 changes artifact: 0f00cec593 user: f_phan
2025-08-04
15:19 • Ticket [15d60c0d2e]: 3 changes artifact: 1c9431b933 user: apnadkarni
2025-07-30
15:24 • Add attachment tcl-tk dir structure.png to ticket [15d60c0d2e1940f0|15d... artifact: 34e255526d user: f_phan
15:24 • Ticket [15d60c0d2e] make fails for tk8.6.16 on macOS status still Open with ... artifact: 577daa8b0a user: f_phan
03:37 • Ticket [15d60c0d2e]: 4 changes artifact: 9443590682 user: apnadkarni
2025-07-29
21:28 • Add attachment tk8.6.16_make_install_output to ticket [15d60c0d2e1940f0... artifact: 9a8227ae7a user: f_phan
21:28 • Add attachment tcl8.6.16_make_install_output to ticket [15d60c0d2e1940f... artifact: 9dde234b66 user: f_phan
21:25 • Add attachment tk8.6.16_config.log to ticket [15d60c0d2e1940f0|15d60c0d... artifact: 44cdd3c0be user: f_phan
21:24 • Add attachment tcl8.6.16_config.log to ticket [15d60c0d2e1940f0|15d60c0... artifact: 4d1956c859 user: f_phan
21:24 • Add attachment tcl8.6.16_config.log to ticket [15d60c0d2e1940f0|15d60c0... artifact: 731a34cb53 user: f_phan
21:20 • Ticket [15d60c0d2e] make fails for tk8.6.16 on unix status still Open with 3... artifact: e823335377 user: f_phan
21:18 • Ticket [15d60c0d2e]: 3 changes artifact: 32e99fa54f user: f_phan
21:07 • Ticket [15d60c0d2e]: 3 changes artifact: 0e148d109c user: f_phan
2025-07-27
05:54 • Ticket [15d60c0d2e]: 3 changes artifact: a86716edd6 user: apnadkarni
00:35 • Ticket [15d60c0d2e]: 3 changes artifact: 869fe9a1db user: f_phan
2025-07-25
18:00 • Ticket [15d60c0d2e]: 3 changes artifact: 9382b3031d user: apnadkarni
2025-07-24
14:14 • New ticket [15d60c0d2e]. artifact: d45be7ef60 user: f_phan

Ticket UUID: 15d60c0d2e1940f0ede852260e9ebf294f526282
Title: make fails for tk8.6.16 on macOS
Type: Bug Created on: 2025-07-24 14:14:33
Submitter: f_phan Assigned to: nobody
Subsystem: 69. Other Severity: Severe
Priority: 5 Medium Last modified: 2025-08-05 04:09:39
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 8.6.16
Description:
Built and installed tcl8.6.16 on macOS Monterey.
Then tried to build tk8.6.16:
% tar -xzf tk8.6.16-src.tar.gz
% cd tk8.6.16/unix
% ./configure --prefix=/usr/local/tcl8.6.16 --with-tcl=/usr/local/tcl8.6.16/lib --enable-framework --enable-aqua
% make -j8
% sudo make install
.
.
.
application-specific initialization failed: Can't find a usable init.tcl in the following directories: 
    /usr/local/lib/tcl8.6 /usr/local/lib/tcl8.6 /usr/lib/tcl8.6 /usr/local/library /usr/library /usr/tcl8.6.6/library /tcl8.6.6/library



This probably means that Tcl wasn't installed properly.

using Tk source directory tk9.0.2
verbose messages are off
scanning section Tk Applications
.
scanning section Tk Commands, version 9.0.2
shuffling ttk_widget.n to front of processing queue
shuffling options.n to front of processing queue
.........................................................................................
scanning section Tk C API, version 9.0.2
.......................................................................................
Assembling index
Rescanning 177 pages to build cross links and write out
.................................................................................................................................................................................
Done
User Comments:
apnadkarni added on 2025-07-25 18:00:57:
After installing tcl 8.6.16, did you try running the installed tclsh 8.6.16 and see the "Tcl wasn't installed properly error"? Or are you seeing the error only on the Tk build?

f_phan added on 2025-07-27 00:35:10:
Replying to apnadkarni's 2025-07-25 18:00:57 comment:

After installing tcl 8.6.16, I did not try running the installed tclsh 8.6.16. Instead, I did:
% cd ../../tk8.6.16/unix
% ./configure --prefix=/usr/local/tcl8.6.16 --with-tcl=/usr/local/tcl8.6.16/lib --enable-framework --enable-aqua
% make -j8
% sudo make install

That was when I got the message "application-specific initialization failed..." (as I described in the Description).

apnadkarni added on 2025-07-27 05:54:16:
I was hoping you would try running the tclsh you installed and tell us if you are getting that error :-) It would help indicate whether the Tcl install was broken or the Tk build. If possible, attach the config.log and the make install output for both Tcl and Tk.

f_phan added on 2025-07-29 21:07:20:
Please delete my comment where I copied-and-pasted the config.log for Tcl 8.6.16 (https://core.tcl-lang.org/tcl/info/702ec02400464fc7). I will attach the file for it instead.

f_phan added on 2025-07-29 21:18:35:
Please delete my comment where I pasted the "sudo make install" output for Tcl 8.6.16 (https://core.tcl-lang.org/tcl/info/f4ace65d92786f34). I will attach a file for that instead.

f_phan added on 2025-07-29 21:20:36:
Running /usr/local/tcl8.6.16/bin/tclsh8.6 returned only a shell prompt, no messages.

I will attach files for the requested outputs.

apnadkarni added on 2025-07-30 03:37:49:

I changed the title to "fails to build on macos", not unix to be accurate.

Anyways, the fact that tclsh shell runs without error messages implies the Tcl build and install was fine and something is wrong with the Tk build. Looking at the logs, the build environment or configuration seems strange. For example,

  • While you are building 8.6.16, your original ticket logging the Tk make install shows the message using Tk source directory tk9.0.2. Why is it using the tk9.0.2 directory?

  • On the other hand, the make install log you attached shows the error /usr/local/lib/tcl8.6/init.tcl: version conflict for package "Tcl": have 8.6.6, need exactly 8.6.16. Where is this 8.6.6 coming from?

I suspect previous installs or system installed libraries are somehow interfering with the paths.

One thing I can suggest you try is to add the --with-tclinclude flag to the Tk configure:

./configure --prefix=/usr/local/tcl8.6.16 --with-tcl=/usr/local/tcl8.6.16/lib --with-tclinclude=/usr/local/tcl8.6.16/include --enable-framework --enable-aqua

That comes from my experience with mingw builds.

Otherwise, I'm afraid you have to wait for someone knowledgeable about macOS builds and how it resolves libraries and include paths to speak up.


f_phan added on 2025-07-30 15:24:00:
There were no previous installs of Tcl-Tk on the machine (MacBook Air). I first tried 'make install' of 9.0.2 and encountered this similar problem; see ticket: https://core.tcl-lang.org/tcl/tktview/ba4a2704d0. That's when I decided to try version 8.6.16. Both installs were strangely trying to find their own init.tcl in the directory of the other version. I have the same question as you about where the 8.6.6 is coming from.

I will attach a screen shot of the directory structure.

apnadkarni added on 2025-08-04 15:19:36:

I had asked if you tried including the --with-tclinclude=path/to/your/8.6.16/include on the Tk configure? Did you try that.

Also those directories are your installs. Possible the system path has a 8.6.6?

Anyways, I'm afraid I am out of my depth on the Mac. For all I know, I am sending you down the wrong path. Someone who has actually worked with macos might chip in.


f_phan added on 2025-08-05 04:05:32:
I got an even longer failure message trying your suggestion; I ran:
% ./configure --prefix=/usr/local/tcl8.6.16 --with-tcl=/usr/local/tcl8.6.16/lib --with-tclinclude=/usr/local/tcl8.6.16/include --enable-framework --enable-aqua

After that, I ran:
% make -j8

After that, when I ran 'make install':

% sudo make install
Password:
Creating package index /Library/Frameworks/Tk.framework/Versions/8.6/Resources/Scripts/pkgIndex.tcl
Installing Tk to /Library/Frameworks/Tk.framework/Versions/8.6/
...
application-specific initialization failed: Can't find a usable init.tcl in the following directories: 
    /usr/local/lib/tcl8.6 /usr/local/lib/tcl8.6 /usr/lib/tcl8.6 /usr/local/library /usr/library /usr/tcl8.6.6/library /tcl8.6.6/library

/usr/local/lib/tcl8.6/init.tcl: version conflict for package "Tcl": have 8.6.6, need exactly 8.6.16
version conflict for package "Tcl": have 8.6.6, need exactly 8.6.16
    while executing
"package require -exact Tcl 8.6.16"
    (file "/usr/local/lib/tcl8.6/init.tcl" line 21)
    invoked from within
"source /usr/local/lib/tcl8.6/init.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $tclfile]"
/usr/local/lib/tcl8.6/init.tcl: version conflict for package "Tcl": have 8.6.6, need exactly 8.6.16
version conflict for package "Tcl": have 8.6.6, need exactly 8.6.16
    while executing
"package require -exact Tcl 8.6.16"
    (file "/usr/local/lib/tcl8.6/init.tcl" line 21)
    invoked from within
"source /usr/local/lib/tcl8.6/init.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 [list source $tclfile]"


This probably means that Tcl wasn't installed properly.

using Tk source directory tk9.0.2
verbose messages are off
scanning section Tk Applications
.
scanning section Tk Commands, version 9.0.2
shuffling ttk_widget.n to front of processing queue
shuffling options.n to front of processing queue
.........................................................................................
scanning section Tk C API, version 9.0.2
.......................................................................................
Assembling index
Rescanning 177 pages to build cross links and write out
.................................................................................................................................................................................
Done

f_phan added on 2025-08-05 04:09:39:
As to your question about system path:

% echo $PATH
/usr/local/bin:/usr/local/python3.13/bin:/Users/franklin/anaconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin

Attachments: