Tcl Source Code

View Ticket
Login
2023-04-22
13:42 Ticket [ff255adc4c] More on libtommath - this time with Python status still Closed with 5 other changes artifact: 87496a2b95 user: chrstphrchvz
12:41 New ticket [2a5cb49733] Make TCL_NO_TOMMATH_H sufficient for tclTomMathDecls.h. artifact: fbec7a1e1d user: chrstphrchvz
2023-03-27
15:57 Closed ticket [ff255adc4c]: More on libtommath - this time with Python plus 4 other changes artifact: 0eee535147 user: oehhar
15:35 Ticket [ff255adc4c]: 4 changes artifact: 2cb46d9cd4 user: Tunneller
2023-03-26
16:51 Pending ticket [ff255adc4c]. artifact: 1ea75046de user: jan.nijtmans
2023-03-24
17:47 New ticket [ff255adc4c]. artifact: 3f0e6c4d53 user: Tunneller

Ticket UUID: ff255adc4cb5656fd696c95ad08963897d756ce
Title: More on libtommath - this time with Python
Type: Bug Version: 8.7
Submitter: Tunneller Created on: 2023-03-24 17:47:13
Subsystem: 56. LibTomMath Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-04-22 13:42:12
Resolution: Works For Me Closed By: chrstphrchvz
    Closed on: 2023-04-22 13:42:12
Description:

I built 8.7 TCL and TK from scratch as per

https://stackoverflow.com/questions/4783810/install-tkinter-for-python
and it was pleasantly painless. I then built python with -ltcl8.7 and -ltk8.7 but this time the compiler failed. The python code looks for (and finds) tclTomMath.h in /usr/local/include/tlctk and that file wants to include libtommath/tommath.h which it cant find.

I "solved" the problem by just copying over that tommath.h over to /usr/local/include/tlctk and everyone is perfectly happy. Tkinter now plots from 3.11 python running on ancient Centos7 hardware. Appreciate all of the support for this project.

But I'm confused why it didnt work out of the box? Was I supposed to build a -llibtomath or something similar?

Thanks, T.

User Comments: chrstphrchvz added on 2023-04-22 13:42:12:

If [2a5cb49733ff] is accepted, then an alternative to obtaining and including tommath.h might be to define TCL_NO_TOMMATH_H.

Hopefully the reporter is aware that there are other incompatibilities in Tkinter with Tcl 8.7/9.0 and Tk 8.7; I have reported a few of these at https://github.com/python/cpython/issues/103194.


Tunneller (claiming to be tunneller) added on 2023-03-27 15:35:07:
Hi Jan, thanks for the update, this makes sense. The documentation was not completely clear that I would need to find my own copy of "tommath.h" , but it was easy to find, so not a concern.

I had occasion to recently build Python from scratch and it had specific hooks to add zlib, so it'll be interesting to see if they add libtommath in the same way.

Regards, and please close the ticket.

jan.nijtmans added on 2023-03-26 16:51:48:

Starting with Tcl 8.7, libtommath has the same status as zlib: If the system has 'libtommath', it will be used, otherwise it is simply built-in. so, what you are describing is exactly as intended.

If your system has a libtommath library (e.g. "sudo apt-get install libtommath-dev" on Ubuntu), then everything should work out-of-the-box. If not, then - indeed - extensions using libtommath (Tkinter - apparently - uses libtommath too) need access to "tommath.h". If your system provides "tommath.h", that one is prefered. Otherwise you can use the one provided by Tcl 8.7 as well.

Hope this helps, Jan Nijtmans